Salome HOME
Bug 0020043: EDF 865 GEOM: Object is non valid after translation. Fix object after...
[modules/geom.git] / src / NMTTools / NMTTools_PaveFiller_0.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
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.
8 // 
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.
13 //
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
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 // File:        NMTTools_PaveFiller_0.cxx
21 // Created:     Mon Dec  8 11:45:51 2003
22 // Author:      Peter KURNEV
23 //              <pkv@irinox>
24
25
26 #include <NMTTools_PaveFiller.ixx>
27
28 #include <TColStd_IndexedMapOfInteger.hxx>
29 #include <TopAbs_ShapeEnum.hxx>
30
31 #include <NMTDS_InterfPool.hxx>
32 #include <NMTDS_ShapesDataStructure.hxx>
33 #include <NMTDS_Iterator.hxx>
34
35 //=======================================================================
36 // function:IsSuccesstorsComputed
37 // purpose: 
38 //=======================================================================
39   Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
40                                                              const Standard_Integer aN2)const
41 {
42   Standard_Boolean bComputed;
43   Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
44   TopAbs_ShapeEnum aType;
45   TColStd_IndexedMapOfInteger aMSuc;
46   //
47   n1=aN1;
48   n2=aN2;
49   aType=myDS->GetShapeType(aN1);
50   if (aType!=TopAbs_VERTEX) {
51     ntmp=n1;
52     n1=n2;
53     n2=ntmp;
54   }
55   //
56   myDS->GetAllSuccessors(n2, aMSuc);
57   aNbS=aMSuc.Extent();
58   for (i=1; i<=aNbS; ++i) {
59     nSuc=aMSuc(i);
60     bComputed=myIP->Contains(n1, nSuc); 
61     if (bComputed) {
62       break;
63     }
64   }
65   return bComputed;
66 }
67 /*
68 //=======================================================================
69 // function:  ExpectedPoolLength
70 // purpose: 
71 //=======================================================================
72   Standard_Integer NMTTools_PaveFiller::ExpectedPoolLength()const
73 {
74   Standard_Integer aNbIIs;
75   Standard_Real aCfPredict=.5;
76   // Modified  Thu Sep 14 14:35:18 2006 
77   // Contribution of Samtech www.samcef.com BEGIN
78   //const BOPTools_ListOfCoupleOfInteger& aLC=myDSIt.ListOfCouple();
79   //aNbIIs=aLC.Extent();
80   aNbIIs=myDSIt->ExpectedLength();
81   // Contribution of Samtech www.samcef.com END
82   //
83   if (aNbIIs==1) {
84     return aNbIIs;
85   }
86   //
87   aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
88   
89   return aNbIIs;
90 }
91 */
92 /*
93 //=======================================================================
94 //function : SortTypes
95 //purpose  : 
96 //=======================================================================
97   void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
98                                       Standard_Integer& theWith)const 
99
100   Standard_Integer aWhat, aWith;
101   Standard_Boolean aReverseFlag;
102   TopAbs_ShapeEnum aType1, aType2;
103   //
104   aType1= myDS->GetShapeType(theWhat),
105   aType2= myDS->GetShapeType(theWith);
106   //
107   if (aType1==aType2) {
108     return;
109   }
110   //
111   aReverseFlag=Standard_True;
112   if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE) {
113     aReverseFlag=Standard_False;
114   }
115   if (aType1==TopAbs_VERTEX && 
116       (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
117     aReverseFlag=Standard_False;
118   }
119   //
120   aWhat=(aReverseFlag) ? theWith : theWhat;
121   aWith=(aReverseFlag) ? theWhat : theWith;
122   //
123   theWhat=aWhat;
124   theWith=aWith;
125 }
126 */