1 // File: NMTTools_PaveFiller_3.cxx
2 // Created: Mon Dec 8 16:06:56 2003
3 // Author: Peter KURNEV
7 #include <NMTTools_PaveFiller.ixx>
10 #include <TopoDS_Shape.hxx>
11 #include <TopoDS_Vertex.hxx>
12 #include <TopoDS_Face.hxx>
14 #include <BOPTools_VSInterference.hxx>
15 #include <BOPTools_CArray1OfVSInterference.hxx>
17 #include <NMTDS_ShapesDataStructure.hxx>
19 //=======================================================================
20 // function: PerformVF
22 //=======================================================================
23 void NMTTools_PaveFiller::PerformVF()
25 myIsDone=Standard_False;
27 Standard_Boolean aJustAddInterference;
28 Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV;
33 BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
36 myDSIt.Initialize(TopAbs_VERTEX, TopAbs_FACE);
38 // BlockLength correction
39 aNbVSs=ExpectedPoolLength();
40 aBlockLength=aVSs.BlockLength();
41 if (aNbVSs > aBlockLength) {
42 aVSs.SetBlockLength(aNbVSs);
45 for (; myDSIt.More(); myDSIt.Next()) {
46 myDSIt.Current(n1, n2, aJustAddInterference);
48 if (! myIntrPool->IsComputed(n1, n2)) {
49 if (! IsSuccesstorsComputed(n1, n2)) {
53 SortTypes(aWhat, aWith);
55 iSDV=FindSDVertex(aWhat);
57 if(aJustAddInterference) {
58 myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
62 aV1=TopoDS::Vertex(myDS->Shape(aWhat));
64 aV1=TopoDS::Vertex(myDS->Shape(iSDV));
67 aF2=TopoDS::Face(myDS->Shape(aWith));
69 aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
73 // Add Interference to the Pool
74 BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
75 anIndexIn=aVSs.Append(anInterf);
77 // SetState for Vertex in DS;
78 myDS->SetState (aWhat, BooleanOperations_ON);
79 // Insert Vertex in Interference Object
80 BOPTools_VSInterference& aVS=aVSs(anIndexIn);
81 aVS.SetNewShape(aWhat);
83 myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
87 myIsDone=Standard_True;