1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File: NMTTools_PCurveMaker.cxx
24 // Author: Peter KURNEV
27 #include <NMTTools_PCurveMaker.ixx>
29 #include <gp_Pnt2d.hxx>
31 #include <Precision.hxx>
33 #include <Geom_Curve.hxx>
34 #include <Geom_TrimmedCurve.hxx>
35 #include <Geom2d_Curve.hxx>
36 #include <GeomAdaptor_Curve.hxx>
37 #include <GeomAdaptor_HCurve.hxx>
40 #include <TopoDS_Face.hxx>
41 #include <TopoDS_Edge.hxx>
42 #include <TopoDS_Vertex.hxx>
45 #include <TopTools_IndexedMapOfShape.hxx>
47 #include <BRep_Tool.hxx>
48 #include <BRep_Builder.hxx>
49 #include <BRepAdaptor_HSurface.hxx>
51 #include <NMTDS_ShapesDataStructure.hxx>
52 #include <NMTTools_DSFiller.hxx>
54 #include <IntTools_Curve.hxx>
56 #include <BOPTools_InterferencePool.hxx>
57 #include <BOPTools_CArray1OfSSInterference.hxx>
58 #include <BOPTools_SSInterference.hxx>
59 #include <BOPTools_ListOfPaveBlock.hxx>
60 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
61 #include <BOPTools_PaveBlock.hxx>
62 #include <BOPTools_Tools2D.hxx>
63 #include <NMTTools_PaveFiller.hxx>
66 //=======================================================================
67 // function: NMTTools_PCurveMaker
69 //=======================================================================
70 NMTTools_PCurveMaker::NMTTools_PCurveMaker(NMTTools_PDSFiller& pDSFiller)
72 myIsDone(Standard_False)
76 //=======================================================================
79 //=======================================================================
80 Standard_Boolean NMTTools_PCurveMaker::IsDone() const
84 //=======================================================================
87 //=======================================================================
88 void NMTTools_PCurveMaker::Do()
90 Standard_Integer i, aNb, nF1, nF2, nE;
91 BOPTools_ListIteratorOfListOfPaveBlock anIt;
92 TopoDS_Face aF1FWD, aF2FWD;
94 NMTTools_PaveFiller *pFiller=(NMTTools_PaveFiller*) &(myDSFiller->PaveFiller());
95 NMTDS_ShapesDataStructure *pDS=pFiller->DS();
97 BOPTools_CArray1OfSSInterference& aFFs=(pFiller->InterfPool())->SSInterferences();
100 for (i=1; i<=aNb; ++i) {
101 BOPTools_SSInterference& aFF=aFFs(i);
103 aFF.Indices(nF1, nF2);
104 const TopoDS_Face& aF1=TopoDS::Face(pDS->Shape(nF1));
105 const TopoDS_Face& aF2=TopoDS::Face(pDS->Shape(nF2));
107 // 1.Forwarding the Faces
109 aF1FWD.Orientation(TopAbs_FORWARD);
111 aF2FWD.Orientation(TopAbs_FORWARD);
113 // 2. In, On parts processing
114 const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
115 anIt.Initialize(aLPBInOn);
116 for (; anIt.More(); anIt.Next()) {
117 const BOPTools_PaveBlock& aPB=anIt.Value();
118 const BOPTools_PaveBlock& aPBInOn=pFiller->RealPaveBlock(aPB);
121 const TopoDS_Edge& aE=TopoDS::Edge(pDS->Shape(nE));
123 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
124 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
126 } // for (i=1; i<=aNb; i++)
127 myIsDone=Standard_True;