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_PaveFiller_1.cxx
21 // Created: Mon Dec 8 11:47:55 2003
22 // Author: Peter KURNEV
24 #include <NMTTools_PaveFiller.ixx>
26 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
27 #include <TColStd_ListOfInteger.hxx>
28 #include <TColStd_ListIteratorOfListOfInteger.hxx>
29 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
32 #include <TopoDS_Shape.hxx>
33 #include <TopoDS_Vertex.hxx>
35 #include <TopTools_ListOfShape.hxx>
37 #include <IntTools_Tools.hxx>
38 #include <BOPTools_VVInterference.hxx>
39 #include <BOPTools_CArray1OfVVInterference.hxx>
40 #include <BOPTools_VVInterference.hxx>
41 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
43 #include <NMTDS_ShapesDataStructure.hxx>
44 #include <NMTTools_Tools.hxx>
46 //=======================================================================
47 // function: PerformVV
49 //=======================================================================
50 void NMTTools_PaveFiller::PerformVV()
52 myIsDone=Standard_False;
54 Standard_Integer anIndexIn, aWhat, aWith, aNbVVs, aBlockLength, aNbVSD;
55 Standard_Integer nVnew;
56 TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
57 TColStd_ListIteratorOfListOfInteger aIt;
58 TopTools_ListOfShape aLV;
64 BOPTools_CArray1OfVVInterference& aVVs=myIntrPool->VVInterferences();
66 // BlockLength correction
67 aNbVVs=ExpectedPoolLength();
68 aBlockLength=aVVs.BlockLength();
69 if (aNbVVs > aBlockLength) {
70 aVVs.SetBlockLength(aNbVVs);
73 const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt.SDVertices();
74 aNbVSD=aMVSD.Extent();
79 aIt1.Initialize(aMVSD);
80 for (; aIt1.More(); aIt1.Next()) {
84 const TColStd_ListOfInteger& aLIV=aIt1.Value();
88 for (; aIt.More(); aIt.Next()) {
90 aS=myDS->Shape(aWith);
93 aS=myDS->Shape(aWhat);
96 NMTTools_Tools::MakeNewVertex(aLV, aVnew);
98 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
100 myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq);
101 nVnew=myDS->NumberOfInsertedShapes();
102 myDS->SetState (nVnew, BooleanOperations_ON);
105 aIt.Initialize(aLIV);
106 for (; aIt.More(); aIt.Next()) {
108 BOPTools_VVInterference aVV(aWhat, aWith);
109 aVV.SetNewShape(nVnew);
110 anIndexIn=aVVs.Append(aVV);
111 myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexVertex, anIndexIn);
113 // to find SD-Vertices
114 myVSD.Bind(aWith, nVnew);
116 myVSD.Bind(aWhat, nVnew);
117 }//for (; aIt1.More(); aIt1.Next()) {
118 myIsDone=Standard_True;
120 //=======================================================================
121 // function: PerformNewVertices
123 //=======================================================================
124 void NMTTools_PaveFiller::PerformNewVertices()
127 //=======================================================================
128 // function: FindSDVertex
130 //=======================================================================
131 Standard_Integer NMTTools_PaveFiller::FindSDVertex(const Standard_Integer nV)const
133 Standard_Integer nVSD;
136 if (myVSD.IsBound(nV)) {