1 // File: NMTTools_PCurveMaker.cxx
3 // Author: Peter KURNEV
7 #include <NMTTools_PCurveMaker.ixx>
9 #include <gp_Pnt2d.hxx>
11 #include <Precision.hxx>
13 #include <Geom_Curve.hxx>
14 #include <Geom_TrimmedCurve.hxx>
15 #include <Geom2d_Curve.hxx>
16 #include <GeomAdaptor_Curve.hxx>
17 #include <GeomAdaptor_HCurve.hxx>
20 #include <TopoDS_Face.hxx>
21 #include <TopoDS_Edge.hxx>
22 #include <TopoDS_Vertex.hxx>
25 #include <TopTools_IndexedMapOfShape.hxx>
27 #include <BRep_Tool.hxx>
28 #include <BRep_Builder.hxx>
29 #include <BRepAdaptor_HSurface.hxx>
31 #include <NMTDS_ShapesDataStructure.hxx>
32 #include <NMTTools_DSFiller.hxx>
34 #include <IntTools_Curve.hxx>
36 #include <BOPTools_InterferencePool.hxx>
37 #include <BOPTools_CArray1OfSSInterference.hxx>
38 #include <BOPTools_SSInterference.hxx>
39 #include <BOPTools_ListOfPaveBlock.hxx>
40 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
41 #include <BOPTools_PaveBlock.hxx>
42 #include <BOPTools_Tools2D.hxx>
43 #include <NMTTools_PaveFiller.hxx>
46 //=======================================================================
47 // function: NMTTools_PCurveMaker
49 //=======================================================================
50 NMTTools_PCurveMaker::NMTTools_PCurveMaker(NMTTools_PDSFiller& pDSFiller)
52 myIsDone(Standard_False)
56 //=======================================================================
59 //=======================================================================
60 Standard_Boolean NMTTools_PCurveMaker::IsDone() const
64 //=======================================================================
67 //=======================================================================
68 void NMTTools_PCurveMaker::Do()
70 Standard_Integer i, aNb, nF1, nF2, nE;
71 BOPTools_ListIteratorOfListOfPaveBlock anIt;
72 TopoDS_Face aF1FWD, aF2FWD;
74 NMTTools_PaveFiller *pFiller=(NMTTools_PaveFiller*) &(myDSFiller->PaveFiller());
75 NMTDS_ShapesDataStructure *pDS=pFiller->DS();
77 BOPTools_CArray1OfSSInterference& aFFs=(pFiller->InterfPool())->SSInterferences();
80 for (i=1; i<=aNb; ++i) {
81 BOPTools_SSInterference& aFF=aFFs(i);
83 aFF.Indices(nF1, nF2);
84 const TopoDS_Face& aF1=TopoDS::Face(pDS->Shape(nF1));
85 const TopoDS_Face& aF2=TopoDS::Face(pDS->Shape(nF2));
87 // 1.Forwarding the Faces
89 aF1FWD.Orientation(TopAbs_FORWARD);
91 aF2FWD.Orientation(TopAbs_FORWARD);
93 // 2. In, On parts processing
94 const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
95 anIt.Initialize(aLPBInOn);
96 for (; anIt.More(); anIt.Next()) {
97 const BOPTools_PaveBlock& aPB=anIt.Value();
98 const BOPTools_PaveBlock& aPBInOn=pFiller->RealPaveBlock(aPB);
101 const TopoDS_Edge& aE=TopoDS::Edge(pDS->Shape(nE));
103 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
104 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
106 } // for (i=1; i<=aNb; i++)
107 myIsDone=Standard_True;