Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:24

0001 // Created on: 1994-10-10
0002 // Created by: Jean Yves LEBEY
0003 // Copyright (c) 1994-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _TopOpeBRep_FacesFiller_HeaderFile
0018 #define _TopOpeBRep_FacesFiller_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopAbs_Orientation.hxx>
0025 #include <TopOpeBRep_PFacesIntersector.hxx>
0026 #include <TopOpeBRepDS_PDataStructure.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <TopOpeBRep_PLineInter.hxx>
0029 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0030 #include <TopOpeBRep_PointClassifier.hxx>
0031 #include <TopOpeBRepTool_PShapeClassifier.hxx>
0032 #include <TopOpeBRepDS_ListIteratorOfListOfInterference.hxx>
0033 #include <TopAbs_State.hxx>
0034 class TopOpeBRepDS_HDataStructure;
0035 class TopOpeBRep_FFDumper;
0036 class TopoDS_Shape;
0037 class TopOpeBRep_VPointInter;
0038 class TopOpeBRep_VPointInterClassifier;
0039 class TopOpeBRep_VPointInterIterator;
0040 class TopOpeBRepDS_Interference;
0041 class TopOpeBRepDS_Point;
0042 class gp_Pnt;
0043 
0044 
0045 //! Fills a DataStructure from TopOpeBRepDS with the result
0046 //! of Face/Face instersection described by FacesIntersector from TopOpeBRep.
0047 //! if the faces have same Domain, record it in the DS.
0048 //! else record lines and  points and attach list of interferences
0049 //! to the faces, the lines and the edges.
0050 class TopOpeBRep_FacesFiller 
0051 {
0052 public:
0053 
0054   DEFINE_STANDARD_ALLOC
0055 
0056   
0057   Standard_EXPORT TopOpeBRep_FacesFiller();
0058   
0059   //! Stores in <DS> the intersections of <S1> and <S2>.
0060   Standard_EXPORT void Insert (const TopoDS_Shape& F1, const TopoDS_Shape& F2, TopOpeBRep_FacesIntersector& FACINT, const Handle(TopOpeBRepDS_HDataStructure)& HDS);
0061   
0062   Standard_EXPORT void ProcessSectionEdges();
0063   
0064   Standard_EXPORT TopOpeBRep_PointClassifier& ChangePointClassifier();
0065   
0066   //! return field myPShapeClassifier.
0067   Standard_EXPORT TopOpeBRepTool_PShapeClassifier PShapeClassifier() const;
0068   
0069   //! set field myPShapeClassifier.
0070   Standard_EXPORT void SetPShapeClassifier (const TopOpeBRepTool_PShapeClassifier& PSC);
0071   
0072   Standard_EXPORT void LoadLine (TopOpeBRep_LineInter& L);
0073   
0074   Standard_EXPORT Standard_Boolean CheckLine (TopOpeBRep_LineInter& L) const;
0075   
0076   //! compute position of VPoints of lines
0077   Standard_EXPORT void VP_Position (TopOpeBRep_FacesIntersector& FACINT);
0078   
0079   //! compute position of VPoints of line L
0080   Standard_EXPORT void VP_Position (TopOpeBRep_LineInter& L);
0081   
0082   //! compute position of VPoints of non-restriction line L.
0083   Standard_EXPORT void VP_PositionOnL (TopOpeBRep_LineInter& L);
0084   
0085   //! compute position of VPoints of restriction line L.
0086   Standard_EXPORT void VP_PositionOnR (TopOpeBRep_LineInter& L);
0087   
0088   //! compute position of VP with current faces,
0089   //! according to VP.ShapeIndex() .
0090   Standard_EXPORT void VP_Position (TopOpeBRep_VPointInter& VP, TopOpeBRep_VPointInterClassifier& VPC);
0091   
0092   //! Process current intersection line (set by LoadLine)
0093   Standard_EXPORT void ProcessLine();
0094   
0095   Standard_EXPORT void ResetDSC();
0096   
0097   //! Process current restriction line, adding restriction edge
0098   //! and computing face/edge interference.
0099   Standard_EXPORT void ProcessRLine();
0100   
0101   //! VP processing for restriction  line  and line sharing
0102   //! same domain with  section edges :
0103   //! - if restriction :
0104   //! Adds restriction edges as  section edges and compute
0105   //! face/edge  interference.
0106   //! - if  same domain :
0107   //! If line share same domain  with section edges, compute
0108   //! parts of line IN/IN the two faces, and compute curve/point
0109   //! interference for VP boundaries.
0110   Standard_EXPORT void FillLineVPonR();
0111   
0112   Standard_EXPORT void FillLine();
0113   
0114   //! compute 3d curve, pcurves and face/curve interferences
0115   //! for current NDSC. Add them to the DS.
0116   Standard_EXPORT void AddShapesLine();
0117   
0118   //! Get map <mapES > of restriction edges having parts IN one
0119   //! of the 2 faces.
0120   Standard_EXPORT void GetESL (TopTools_ListOfShape& LES);
0121   
0122   //! calling the following ProcessVPIonR and ProcessVPonR.
0123   Standard_EXPORT void ProcessVPR (TopOpeBRep_FacesFiller& FF, const TopOpeBRep_VPointInter& VP);
0124   
0125   //! processing ProcessVPonR for VPI.
0126   Standard_EXPORT void ProcessVPIonR (TopOpeBRep_VPointInterIterator& VPI, const TopOpeBRepDS_Transition& trans1, const TopoDS_Shape& F1, const Standard_Integer ShapeIndex);
0127   
0128   //! adds <VP>'s   geometric   point (if not   stored)  and
0129   //! computes (curve or edge)/(point or vertex) interference.
0130   Standard_EXPORT void ProcessVPonR (const TopOpeBRep_VPointInter& VP, const TopOpeBRepDS_Transition& trans1, const TopoDS_Shape& F1, const Standard_Integer ShapeIndex);
0131   
0132   //! VP processing on closing arc.
0133   Standard_EXPORT void ProcessVPonclosingR (const TopOpeBRep_VPointInter& VP, const TopoDS_Shape& F1, const Standard_Integer ShapeIndex, const TopOpeBRepDS_Transition& transEdge, const TopOpeBRepDS_Kind PVKind, const Standard_Integer PVIndex, const Standard_Boolean EPIfound, const Handle(TopOpeBRepDS_Interference)& IEPI);
0134   
0135   //! VP processing on degenerated arc.
0136   Standard_EXPORT Standard_Boolean ProcessVPondgE (const TopOpeBRep_VPointInter& VP, const Standard_Integer ShapeIndex, TopOpeBRepDS_Kind& PVKind, Standard_Integer& PVIndex, Standard_Boolean& EPIfound, Handle(TopOpeBRepDS_Interference)& IEPI, Standard_Boolean& CPIfound, Handle(TopOpeBRepDS_Interference)& ICPI);
0137   
0138   //! processing ProcessVPnotonR for VPI.
0139   Standard_EXPORT void ProcessVPInotonR (TopOpeBRep_VPointInterIterator& VPI);
0140   
0141   //! adds <VP>'s  geometrical point to the DS (if not stored)
0142   //! and computes curve point interference.
0143   Standard_EXPORT void ProcessVPnotonR (const TopOpeBRep_VPointInter& VP);
0144   
0145 
0146   //! Get the geometry of a DS point <DSP>.
0147   //! Search for it with ScanInterfList (previous method).
0148   //! if found, set <G> to the geometry of the interference found.
0149   //! else, add the point <DSP> in the <DS> and set <G> to the
0150   //! value of the new geometry such created.
0151   //! returns the value of ScanInterfList().
0152   Standard_EXPORT Standard_Boolean GetGeometry (TopOpeBRepDS_ListIteratorOfListOfInterference& IT, const TopOpeBRep_VPointInter& VP, Standard_Integer& G, TopOpeBRepDS_Kind& K);
0153   
0154   Standard_EXPORT Standard_Integer MakeGeometry (const TopOpeBRep_VPointInter& VP, const Standard_Integer ShapeIndex, TopOpeBRepDS_Kind& K);
0155   
0156 
0157   //! Add interference <I> to list myDSCIL.
0158   //! on a given line, at first call, add a new DS curve.
0159   Standard_EXPORT void StoreCurveInterference (const Handle(TopOpeBRepDS_Interference)& I);
0160   
0161   //! search for G = geometry of Point which is identical to <DSP>
0162   //! among the DS Points created in the CURRENT face/face
0163   //! intersection ( current Insert() call).
0164   Standard_EXPORT Standard_Boolean GetFFGeometry (const TopOpeBRepDS_Point& DSP, TopOpeBRepDS_Kind& K, Standard_Integer& G) const;
0165   
0166   //! search for G = geometry of Point which is identical to <VP>
0167   //! among the DS Points created in the CURRENT face/face
0168   //! intersection ( current Insert() call).
0169   Standard_EXPORT Standard_Boolean GetFFGeometry (const TopOpeBRep_VPointInter& VP, TopOpeBRepDS_Kind& K, Standard_Integer& G) const;
0170   
0171   Standard_EXPORT TopOpeBRep_FacesIntersector& ChangeFacesIntersector();
0172   
0173   Standard_EXPORT Handle(TopOpeBRepDS_HDataStructure) HDataStructure();
0174   
0175   Standard_EXPORT TopOpeBRepDS_DataStructure& ChangeDataStructure();
0176   
0177   Standard_EXPORT const TopoDS_Face& Face (const Standard_Integer I) const;
0178   
0179   Standard_EXPORT const TopOpeBRepDS_Transition& FaceFaceTransition (const TopOpeBRep_LineInter& L, const Standard_Integer I) const;
0180   
0181   Standard_EXPORT const TopOpeBRepDS_Transition& FaceFaceTransition (const Standard_Integer I) const;
0182   
0183   Standard_EXPORT TopOpeBRep_PFacesIntersector PFacesIntersectorDummy() const;
0184   
0185   Standard_EXPORT TopOpeBRepDS_PDataStructure PDataStructureDummy() const;
0186   
0187   Standard_EXPORT TopOpeBRep_PLineInter PLineInterDummy() const;
0188   
0189   Standard_EXPORT void SetTraceIndex (const Standard_Integer exF1, const Standard_Integer exF2);
0190   
0191   Standard_EXPORT void GetTraceIndex (Standard_Integer& exF1, Standard_Integer& exF2) const;
0192   
0193   //! Computes <pmin> and <pmax> the upper and lower bounds of <L>
0194   //! enclosing all vpoints.
0195   Standard_EXPORT static void Lminmax (const TopOpeBRep_LineInter& L, Standard_Real& pmin, Standard_Real& pmax);
0196   
0197   //! Returns <True> if <L> shares a same geometric domain with
0198   //! at least one of the section edges of <ERL>.
0199   Standard_EXPORT static Standard_Boolean LSameDomainERL (const TopOpeBRep_LineInter& L, const TopTools_ListOfShape& ERL);
0200   
0201   //! Computes the transition <T> of the VPoint <iVP> on the edge
0202   //! of <SI12>. Returns <False> if the status is unknown.
0203   Standard_EXPORT static Standard_Boolean IsVPtransLok (const TopOpeBRep_LineInter& L, const Standard_Integer iVP, const Standard_Integer SI12, TopOpeBRepDS_Transition& T);
0204   
0205   //! Computes   transition   on line for  VP<iVP>   on edge
0206   //! restriction of <SI>.  If <isINOUT>  :  returns <true> if
0207   //! transition computed is IN/OUT else : returns <true> if
0208   //! transition computed is OUT/IN.
0209   Standard_EXPORT static Standard_Boolean TransvpOK (const TopOpeBRep_LineInter& L, const Standard_Integer iVP, const Standard_Integer SI, const Standard_Boolean isINOUT);
0210   
0211   //! Returns parameter u of vp on the restriction edge.
0212   Standard_EXPORT static Standard_Real VPParamOnER (const TopOpeBRep_VPointInter& vp, const TopOpeBRep_LineInter& Lrest);
0213   
0214   Standard_EXPORT static Standard_Boolean EqualpPonR (const TopOpeBRep_LineInter& Lrest, const TopOpeBRep_VPointInter& VP1, const TopOpeBRep_VPointInter& VP2);
0215   
0216 
0217 
0218 
0219 
0220 protected:
0221 
0222 
0223 
0224 
0225 
0226 private:
0227 
0228   
0229   Standard_EXPORT Standard_Boolean KeepRLine (const TopOpeBRep_LineInter& Lrest, const Standard_Boolean checkkeep) const;
0230   
0231   Standard_EXPORT TopOpeBRepDS_Transition GetEdgeTrans (const TopOpeBRep_VPointInter& VP, const TopOpeBRepDS_Kind PVKind, const Standard_Integer PVIndex, const Standard_Integer Sind, const TopoDS_Face& F);
0232   
0233   //! If <VP>'s index != 3, calls a classifier to determine
0234   //! <VP>'s state on the face.
0235   Standard_EXPORT TopAbs_State StateVPonFace (const TopOpeBRep_VPointInter& VP) const;
0236   
0237   //! <VP> is of geometry <P>.
0238   //! Looks after a   VPoint on RESTRICTION <Lrest>  with
0239   //! geometric value  <P>. If true, updates states ON for <VP>.
0240   Standard_EXPORT Standard_Boolean PequalVPonR (const gp_Pnt& P3D, const Standard_Integer VPshapeindex, TopOpeBRep_VPointInter& VP, TopOpeBRep_LineInter& Lrest) const;
0241   
0242   //! Classifies (VPf, VPl) middle point on restriction edge
0243   Standard_EXPORT TopAbs_State StBipVPonF (const TopOpeBRep_VPointInter& IVPf, const TopOpeBRep_VPointInter& IVPl, const TopOpeBRep_LineInter& Lrest, const Standard_Boolean isonedge1) const;
0244 
0245 
0246   TopoDS_Face myF1;
0247   TopoDS_Face myF2;
0248   TopAbs_Orientation myF1ori;
0249   TopAbs_Orientation myF2ori;
0250   TopOpeBRep_PFacesIntersector myFacesIntersector;
0251   Handle(TopOpeBRepDS_HDataStructure) myHDS;
0252   TopOpeBRepDS_PDataStructure myDS;
0253   Standard_Integer myFFfirstDSP;
0254   TopOpeBRep_PLineInter myLine;
0255   Standard_Boolean myLineOK;
0256   Standard_Boolean myLineINL;
0257   TopOpeBRepDS_Transition myLineTonF1;
0258   TopOpeBRepDS_Transition myLineTonF2;
0259   Standard_Boolean myLineIsonEdge;
0260   TopTools_ListOfShape myERL;
0261   TopTools_DataMapOfShapeListOfShape myDataforDegenEd;
0262   Standard_Boolean myLastVPison0;
0263   Standard_Integer mykeptVPnbr;
0264   Standard_Integer myDSCIndex;
0265   TopOpeBRepDS_ListOfInterference myDSCIL;
0266   TopOpeBRep_PointClassifier myPointClassifier;
0267   TopOpeBRepTool_PShapeClassifier myPShapeClassifier;
0268   Standard_Integer myexF1;
0269   Standard_Integer myexF2;
0270   Handle(TopOpeBRep_FFDumper) myHFFD;
0271 
0272 
0273 };
0274 
0275 
0276 
0277 
0278 
0279 
0280 
0281 #endif // _TopOpeBRep_FacesFiller_HeaderFile