1 // Copyright (C) 2007-2012 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_PaveFiller_1.cxx
24 // Created: Mon Dec 8 11:47:55 2003
25 // Author: Peter KURNEV
28 #include <NMTTools_PaveFiller.hxx>
30 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
31 #include <TColStd_ListOfInteger.hxx>
32 #include <TColStd_ListIteratorOfListOfInteger.hxx>
33 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
36 #include <TopoDS_Shape.hxx>
37 #include <TopoDS_Vertex.hxx>
39 #include <TopTools_ListOfShape.hxx>
41 #include <IntTools_Tools.hxx>
42 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
43 #include <BOPTools_VVInterference.hxx>
44 #include <BOPTools_CArray1OfVVInterference.hxx>
46 #include <NMTDS_Iterator.hxx>
47 #include <NMTDS_InterfPool.hxx>
48 #include <NMTDS_ShapesDataStructure.hxx>
50 #include <NMTTools_Tools.hxx>
52 //=======================================================================
53 // function: PerformVV
55 //=======================================================================
56 void NMTTools_PaveFiller::PerformVV()
58 myIsDone=Standard_False;
60 Standard_Integer aNbVVs, aBL, aNbVSD, nVnew, i, j, n1, n2;
61 TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
62 TColStd_ListIteratorOfListOfInteger aItX, aItY;
63 TColStd_ListOfInteger aLIX;
64 TopTools_ListOfShape aLV;
69 const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt->SDVertices();
70 aNbVSD=aMVSD.Extent();
75 BOPTools_CArray1OfVVInterference& aVVs=myIP->VVInterferences();
77 // BlockLength correction
78 myDSIt->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
79 aNbVVs=myDSIt->BlockLength();
80 aBL=aVVs.BlockLength();
82 aVVs.SetBlockLength(aNbVVs);
85 aIt1.Initialize(aMVSD);
86 for (; aIt1.More(); aIt1.Next()) {
90 const TColStd_ListOfInteger& aLIV=aIt1.Value();
93 const TopoDS_Shape& aS1=myDS->Shape(n1);
95 aItX.Initialize(aLIV);
96 for (; aItX.More(); aItX.Next()) {
98 const TopoDS_Shape& aS2=myDS->Shape(n2);
102 NMTTools_Tools::MakeNewVertex(aLV, aVnew);
104 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
106 myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq);
107 nVnew=myDS->NumberOfInsertedShapes();
108 myDS->SetState (nVnew, BooleanOperations_ON);
113 myVSD.Bind(n1, nVnew);
115 aItX.Initialize(aLIV);
116 for (; aItX.More(); aItX.Next()) {
119 myVSD.Bind(n2, nVnew);
123 aItX.Initialize(aLIX);
124 for (i=0; aItX.More(); aItX.Next(), ++i) {
125 aItY.Initialize(aLIX);
126 for (j=0; aItY.More(); aItY.Next(), ++j) {
130 myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
132 BOPTools_VVInterference aVV(n1, n2);
133 aVV.SetNewShape(nVnew);
138 }//for (; aIt1.More(); aIt1.Next()) {
139 myIsDone=Standard_True;
141 //=======================================================================
142 // function: FindSDVertex
144 //=======================================================================
145 Standard_Integer NMTTools_PaveFiller::FindSDVertex(const Standard_Integer nV)const
147 Standard_Integer nVSD;
150 if (myVSD.IsBound(nV)) {
156 //=======================================================================
157 // function: PerformNewVertices
159 //=======================================================================
160 void NMTTools_PaveFiller::PerformNewVertices()