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_PaveFiller_1.cxx
23 // Created: Mon Dec 8 11:47:55 2003
24 // Author: Peter KURNEV
27 #include <NMTTools_PaveFiller.ixx>
29 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
30 #include <TColStd_ListOfInteger.hxx>
31 #include <TColStd_ListIteratorOfListOfInteger.hxx>
32 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
35 #include <TopoDS_Shape.hxx>
36 #include <TopoDS_Vertex.hxx>
38 #include <TopTools_ListOfShape.hxx>
40 #include <IntTools_Tools.hxx>
41 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
42 #include <BOPTools_VVInterference.hxx>
43 #include <BOPTools_CArray1OfVVInterference.hxx>
45 #include <NMTDS_Iterator.hxx>
46 #include <NMTDS_InterfPool.hxx>
47 #include <NMTDS_ShapesDataStructure.hxx>
49 #include <NMTTools_Tools.hxx>
51 //=======================================================================
52 // function: PerformVV
54 //=======================================================================
55 void NMTTools_PaveFiller::PerformVV()
57 myIsDone=Standard_False;
59 Standard_Integer aNbVVs, aBL, aNbVSD, nVnew, i, j, n1, n2;
60 TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
61 TColStd_ListIteratorOfListOfInteger aItX, aItY;
62 TColStd_ListOfInteger aLIX;
63 TopTools_ListOfShape aLV;
68 const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt->SDVertices();
69 aNbVSD=aMVSD.Extent();
74 BOPTools_CArray1OfVVInterference& aVVs=myIP->VVInterferences();
76 // BlockLength correction
77 myDSIt->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
78 aNbVVs=myDSIt->BlockLength();
79 aBL=aVVs.BlockLength();
81 aVVs.SetBlockLength(aNbVVs);
84 aIt1.Initialize(aMVSD);
85 for (; aIt1.More(); aIt1.Next()) {
89 const TColStd_ListOfInteger& aLIV=aIt1.Value();
92 const TopoDS_Shape& aS1=myDS->Shape(n1);
94 aItX.Initialize(aLIV);
95 for (; aItX.More(); aItX.Next()) {
97 const TopoDS_Shape& aS2=myDS->Shape(n2);
101 NMTTools_Tools::MakeNewVertex(aLV, aVnew);
103 BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
105 myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq);
106 nVnew=myDS->NumberOfInsertedShapes();
107 myDS->SetState (nVnew, BooleanOperations_ON);
112 myVSD.Bind(n1, nVnew);
114 aItX.Initialize(aLIV);
115 for (; aItX.More(); aItX.Next()) {
118 myVSD.Bind(n2, nVnew);
122 aItX.Initialize(aLIX);
123 for (i=0; aItX.More(); aItX.Next(), ++i) {
124 aItY.Initialize(aLIX);
125 for (j=0; aItY.More(); aItY.Next(), ++j) {
129 myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
131 BOPTools_VVInterference aVV(n1, n2);
132 aVV.SetNewShape(nVnew);
137 }//for (; aIt1.More(); aIt1.Next()) {
138 myIsDone=Standard_True;
140 //=======================================================================
141 // function: FindSDVertex
143 //=======================================================================
144 Standard_Integer NMTTools_PaveFiller::FindSDVertex(const Standard_Integer nV)const
146 Standard_Integer nVSD;
149 if (myVSD.IsBound(nV)) {
155 //=======================================================================
156 // function: PerformNewVertices
158 //=======================================================================
159 void NMTTools_PaveFiller::PerformNewVertices()