1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: NMTTools_PCurveMaker.cxx
22 // Author: Peter KURNEV
26 #include <NMTTools_PCurveMaker.ixx>
28 #include <gp_Pnt2d.hxx>
30 #include <Precision.hxx>
32 #include <Geom_Curve.hxx>
33 #include <Geom_TrimmedCurve.hxx>
34 #include <Geom2d_Curve.hxx>
35 #include <GeomAdaptor_Curve.hxx>
36 #include <GeomAdaptor_HCurve.hxx>
39 #include <TopoDS_Face.hxx>
40 #include <TopoDS_Edge.hxx>
41 #include <TopoDS_Vertex.hxx>
44 #include <TopTools_IndexedMapOfShape.hxx>
46 #include <BRep_Tool.hxx>
47 #include <BRep_Builder.hxx>
48 #include <BRepAdaptor_HSurface.hxx>
50 #include <NMTDS_ShapesDataStructure.hxx>
51 #include <NMTTools_DSFiller.hxx>
53 #include <IntTools_Curve.hxx>
55 #include <BOPTools_InterferencePool.hxx>
56 #include <BOPTools_CArray1OfSSInterference.hxx>
57 #include <BOPTools_SSInterference.hxx>
58 #include <BOPTools_ListOfPaveBlock.hxx>
59 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
60 #include <BOPTools_PaveBlock.hxx>
61 #include <BOPTools_Tools2D.hxx>
62 #include <NMTTools_PaveFiller.hxx>
65 //=======================================================================
66 // function: NMTTools_PCurveMaker
68 //=======================================================================
69 NMTTools_PCurveMaker::NMTTools_PCurveMaker(NMTTools_PDSFiller& pDSFiller)
71 myIsDone(Standard_False)
75 //=======================================================================
78 //=======================================================================
79 Standard_Boolean NMTTools_PCurveMaker::IsDone() const
83 //=======================================================================
86 //=======================================================================
87 void NMTTools_PCurveMaker::Do()
89 Standard_Integer i, aNb, nF1, nF2, nE;
90 BOPTools_ListIteratorOfListOfPaveBlock anIt;
91 TopoDS_Face aF1FWD, aF2FWD;
93 NMTTools_PaveFiller *pFiller=(NMTTools_PaveFiller*) &(myDSFiller->PaveFiller());
94 NMTDS_ShapesDataStructure *pDS=pFiller->DS();
96 BOPTools_CArray1OfSSInterference& aFFs=(pFiller->InterfPool())->SSInterferences();
99 for (i=1; i<=aNb; ++i) {
100 BOPTools_SSInterference& aFF=aFFs(i);
102 aFF.Indices(nF1, nF2);
103 const TopoDS_Face& aF1=TopoDS::Face(pDS->Shape(nF1));
104 const TopoDS_Face& aF2=TopoDS::Face(pDS->Shape(nF2));
106 // 1.Forwarding the Faces
108 aF1FWD.Orientation(TopAbs_FORWARD);
110 aF2FWD.Orientation(TopAbs_FORWARD);
112 // 2. In, On parts processing
113 const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
114 anIt.Initialize(aLPBInOn);
115 for (; anIt.More(); anIt.Next()) {
116 const BOPTools_PaveBlock& aPB=anIt.Value();
117 const BOPTools_PaveBlock& aPBInOn=pFiller->RealPaveBlock(aPB);
120 const TopoDS_Edge& aE=TopoDS::Edge(pDS->Shape(nE));
122 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
123 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
125 } // for (i=1; i<=aNb; i++)
126 myIsDone=Standard_True;