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