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
25 #include <NMTTools_PaveFiller.ixx>
27 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
28 #include <TColStd_ListOfInteger.hxx>
29 #include <TColStd_ListIteratorOfListOfInteger.hxx>
30 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
33 #include <TopoDS_Shape.hxx>
34 #include <TopoDS_Vertex.hxx>
36 #include <TopTools_ListOfShape.hxx>
38 #include <IntTools_Tools.hxx>
39 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
40 #include <BOPTools_VVInterference.hxx>
41 #include <BOPTools_CArray1OfVVInterference.hxx>
43 #include <NMTDS_Iterator.hxx>
44 #include <NMTDS_InterfPool.hxx>
45 #include <NMTDS_ShapesDataStructure.hxx>
47 #include <NMTTools_Tools.hxx>
49 //=======================================================================
50 // function: PerformVV
52 //=======================================================================
53 void NMTTools_PaveFiller::PerformVV()
55 myIsDone=Standard_False;
57 Standard_Integer aNbVVs, aBL, aNbVSD, nVnew, i, j, n1, n2;
58 TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
59 TColStd_ListIteratorOfListOfInteger aItX, aItY;
60 TColStd_ListOfInteger aLIX;
61 TopTools_ListOfShape aLV;
66 const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt->SDVertices();
67 aNbVSD=aMVSD.Extent();
72 BOPTools_CArray1OfVVInterference& aVVs=myIP->VVInterferences();
74 // BlockLength correction
75 myDSIt->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
76 aNbVVs=myDSIt->BlockLength();
77 aBL=aVVs.BlockLength();
79 aVVs.SetBlockLength(aNbVVs);
82 aIt1.Initialize(aMVSD);
83 for (; aIt1.More(); aIt1.Next()) {
87 const TColStd_ListOfInteger& aLIV=aIt1.Value();
90 const TopoDS_Shape& aS1=myDS->Shape(n1);
92 aItX.Initialize(aLIV);
93 for (; aItX.More(); aItX.Next()) {
95 const TopoDS_Shape& aS2=myDS->Shape(n2);
99 NMTTools_Tools::MakeNewVertex(aLV, aVnew);
101 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
103 myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq);
104 nVnew=myDS->NumberOfInsertedShapes();
105 myDS->SetState (nVnew, BooleanOperations_ON);
110 myVSD.Bind(n1, nVnew);
112 aItX.Initialize(aLIV);
113 for (; aItX.More(); aItX.Next()) {
116 myVSD.Bind(n2, nVnew);
120 aItX.Initialize(aLIX);
121 for (i=0; aItX.More(); aItX.Next(), ++i) {
122 aItY.Initialize(aLIX);
123 for (j=0; aItY.More(); aItY.Next(), ++j) {
127 myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
129 BOPTools_VVInterference aVV(n1, n2);
130 aVV.SetNewShape(nVnew);
135 }//for (; aIt1.More(); aIt1.Next()) {
136 myIsDone=Standard_True;
138 //=======================================================================
139 // function: FindSDVertex
141 //=======================================================================
142 Standard_Integer NMTTools_PaveFiller::FindSDVertex(const Standard_Integer nV)const
144 Standard_Integer nVSD;
147 if (myVSD.IsBound(nV)) {
153 //=======================================================================
154 // function: PerformNewVertices
156 //=======================================================================
157 void NMTTools_PaveFiller::PerformNewVertices()