1 // Copyright (C) 2007-2010 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
23 // File: NMTTools_PCurveMaker.cxx
25 // Author: Peter KURNEV
28 #include <NMTTools_PCurveMaker.ixx>
30 #include <gp_Pnt2d.hxx>
32 #include <Precision.hxx>
34 #include <Geom_Curve.hxx>
35 #include <Geom_TrimmedCurve.hxx>
36 #include <Geom2d_Curve.hxx>
37 #include <GeomAdaptor_Curve.hxx>
38 #include <GeomAdaptor_HCurve.hxx>
41 #include <TopoDS_Face.hxx>
42 #include <TopoDS_Edge.hxx>
43 #include <TopoDS_Vertex.hxx>
46 #include <TopTools_IndexedMapOfShape.hxx>
48 #include <BRep_Tool.hxx>
49 #include <BRep_Builder.hxx>
50 #include <BRepAdaptor_HSurface.hxx>
52 #include <NMTDS_ShapesDataStructure.hxx>
53 #include <NMTTools_DSFiller.hxx>
55 #include <IntTools_Curve.hxx>
57 #include <BOPTools_InterferencePool.hxx>
58 #include <BOPTools_CArray1OfSSInterference.hxx>
59 #include <BOPTools_SSInterference.hxx>
60 #include <BOPTools_ListOfPaveBlock.hxx>
61 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
62 #include <BOPTools_PaveBlock.hxx>
63 #include <BOPTools_Tools2D.hxx>
64 #include <NMTTools_PaveFiller.hxx>
67 //=======================================================================
68 // function: NMTTools_PCurveMaker
70 //=======================================================================
71 NMTTools_PCurveMaker::NMTTools_PCurveMaker(NMTTools_PDSFiller& pDSFiller)
73 myIsDone(Standard_False)
77 //=======================================================================
80 //=======================================================================
81 Standard_Boolean NMTTools_PCurveMaker::IsDone() const
85 //=======================================================================
88 //=======================================================================
89 void NMTTools_PCurveMaker::Do()
91 Standard_Integer i, aNb, nF1, nF2, nE;
92 BOPTools_ListIteratorOfListOfPaveBlock anIt;
93 TopoDS_Face aF1FWD, aF2FWD;
95 NMTTools_PaveFiller *pFiller=(NMTTools_PaveFiller*) &(myDSFiller->PaveFiller());
96 NMTDS_ShapesDataStructure *pDS=pFiller->DS();
98 BOPTools_CArray1OfSSInterference& aFFs=(pFiller->InterfPool())->SSInterferences();
101 for (i=1; i<=aNb; ++i) {
102 BOPTools_SSInterference& aFF=aFFs(i);
104 aFF.Indices(nF1, nF2);
105 const TopoDS_Face& aF1=TopoDS::Face(pDS->Shape(nF1));
106 const TopoDS_Face& aF2=TopoDS::Face(pDS->Shape(nF2));
108 // 1.Forwarding the Faces
110 aF1FWD.Orientation(TopAbs_FORWARD);
112 aF2FWD.Orientation(TopAbs_FORWARD);
114 // 2. In, On parts processing
115 const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
116 anIt.Initialize(aLPBInOn);
117 for (; anIt.More(); anIt.Next()) {
118 const BOPTools_PaveBlock& aPB=anIt.Value();
119 const BOPTools_PaveBlock& aPBInOn=pFiller->RealPaveBlock(aPB);
122 const TopoDS_Edge& aE=TopoDS::Edge(pDS->Shape(nE));
124 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
125 BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
127 } // for (i=1; i<=aNb; i++)
128 myIsDone=Standard_True;