1 // File: NMTTools_PaveFiller_0.cxx
2 // Created: Mon Dec 8 11:45:51 2003
3 // Author: Peter KURNEV
7 #include <NMTTools_PaveFiller.ixx>
9 #include <TopAbs_ShapeEnum.hxx>
10 #include <BOPTools_ListOfCoupleOfInteger.hxx>
11 #include <NMTDS_ShapesDataStructure.hxx>
12 #include <BooleanOperations_OnceExplorer.hxx>
14 //=======================================================================
15 //function : SortTypes
17 //=======================================================================
18 void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
19 Standard_Integer& theWith)const
21 Standard_Boolean aReverseFlag=Standard_True;
23 TopAbs_ShapeEnum aType1= myDS->GetShapeType(theWhat),
24 aType2= myDS->GetShapeType(theWith);
29 if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE){
30 aReverseFlag=Standard_False;
33 if (aType1==TopAbs_VERTEX &&
34 (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
35 aReverseFlag=Standard_False;
38 Standard_Integer aWhat, aWith;
39 aWhat=(aReverseFlag) ? theWith : theWhat;
40 aWith=(aReverseFlag) ? theWhat : theWith;
45 //=======================================================================
46 // function: ExpectedPoolLength
48 //=======================================================================
49 Standard_Integer NMTTools_PaveFiller::ExpectedPoolLength()const
51 Standard_Integer aNbIIs;
52 Standard_Real aCfPredict=.5;
54 const BOPTools_ListOfCoupleOfInteger& aLC=myDSIt.ListOfCouple();
61 aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
65 //=======================================================================
66 // function:IsSuccesstorsComputed
68 //=======================================================================
69 Standard_Boolean NMTTools_PaveFiller::IsSuccesstorsComputed(const Standard_Integer aN1,
70 const Standard_Integer aN2)const
72 Standard_Integer nSuc, n1, n2;
74 BooleanOperations_OnceExplorer aExp(*myDS);
75 TopAbs_ShapeEnum aType=myDS->GetShapeType(aN1);
80 if (aType!=TopAbs_VERTEX) {
81 Standard_Integer ntmp=n1;
86 aType=myDS->GetShapeType(n2);
87 if (aType==TopAbs_EDGE) {
88 aExp.Init(n2, TopAbs_VERTEX);
89 for (; aExp.More(); aExp.Next()) {
91 if (myIntrPool->IsComputed(n1, nSuc)) {
95 return Standard_False;
98 else if (aType==TopAbs_FACE) {
99 aExp.Init(n2, TopAbs_VERTEX);
100 for (; aExp.More(); aExp.Next()) {
102 if (myIntrPool->IsComputed(n1, nSuc)) {
103 return Standard_True;
107 aExp.Init(n2, TopAbs_EDGE);
108 for (; aExp.More(); aExp.Next()) {
110 if (myIntrPool->IsComputed(n1, nSuc)) {
111 return Standard_True;
114 return Standard_False;
117 return Standard_False;