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_3.cxx
21 // Created: Mon Dec 8 16:06:56 2003
22 // Author: Peter KURNEV
26 #include <NMTTools_PaveFiller.ixx>
29 #include <TopoDS_Shape.hxx>
30 #include <TopoDS_Vertex.hxx>
31 #include <TopoDS_Face.hxx>
33 #include <BOPTools_VSInterference.hxx>
34 #include <BOPTools_CArray1OfVSInterference.hxx>
36 #include <NMTDS_ShapesDataStructure.hxx>
38 //=======================================================================
39 // function: PerformVF
41 //=======================================================================
42 void NMTTools_PaveFiller::PerformVF()
44 myIsDone=Standard_False;
46 Standard_Boolean aJustAddInterference;
47 Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV;
52 BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
55 myDSIt.Initialize(TopAbs_VERTEX, TopAbs_FACE);
57 // BlockLength correction
58 aNbVSs=ExpectedPoolLength();
59 aBlockLength=aVSs.BlockLength();
60 if (aNbVSs > aBlockLength) {
61 aVSs.SetBlockLength(aNbVSs);
64 for (; myDSIt.More(); myDSIt.Next()) {
65 myDSIt.Current(n1, n2, aJustAddInterference);
67 if (! myIntrPool->IsComputed(n1, n2)) {
68 if (! IsSuccesstorsComputed(n1, n2)) {
72 SortTypes(aWhat, aWith);
74 iSDV=FindSDVertex(aWhat);
76 if(aJustAddInterference) {
77 myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
81 aV1=TopoDS::Vertex(myDS->Shape(aWhat));
83 aV1=TopoDS::Vertex(myDS->Shape(iSDV));
86 aF2=TopoDS::Face(myDS->Shape(aWith));
88 aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
92 // Add Interference to the Pool
93 BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
94 anIndexIn=aVSs.Append(anInterf);
96 // SetState for Vertex in DS;
97 myDS->SetState (aWhat, BooleanOperations_ON);
98 // Insert Vertex in Interference Object
99 BOPTools_VSInterference& aVS=aVSs(anIndexIn);
100 aVS.SetNewShape(aWhat);
102 myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
106 myIsDone=Standard_True;