1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File: NMTTools_PaveFiller_0.cxx
23 // Created: Mon Dec 8 11:45:51 2003
24 // Author: Peter KURNEV
27 #include <NMTTools_PaveFiller.ixx>
29 #include <TColStd_IndexedMapOfInteger.hxx>
30 #include <TopAbs_ShapeEnum.hxx>
32 #include <NMTDS_InterfPool.hxx>
33 #include <NMTDS_ShapesDataStructure.hxx>
34 #include <NMTDS_Iterator.hxx>
36 //=======================================================================
37 // function:IsSuccesstorsComputed
39 //=======================================================================
40 Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
41 const Standard_Integer aN2)const
43 Standard_Boolean bComputed;
44 Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
45 TopAbs_ShapeEnum aType;
46 TColStd_IndexedMapOfInteger aMSuc;
50 aType=myDS->GetShapeType(aN1);
51 if (aType!=TopAbs_VERTEX) {
57 myDS->GetAllSuccessors(n2, aMSuc);
59 for (i=1; i<=aNbS; ++i) {
61 bComputed=myIP->Contains(n1, nSuc);
69 //=======================================================================
70 // function: ExpectedPoolLength
72 //=======================================================================
73 Standard_Integer NMTTools_PaveFiller::ExpectedPoolLength()const
75 Standard_Integer aNbIIs;
76 Standard_Real aCfPredict=.5;
77 // Modified Thu Sep 14 14:35:18 2006
78 // Contribution of Samtech www.samcef.com BEGIN
79 //const BOPTools_ListOfCoupleOfInteger& aLC=myDSIt.ListOfCouple();
80 //aNbIIs=aLC.Extent();
81 aNbIIs=myDSIt->ExpectedLength();
82 // Contribution of Samtech www.samcef.com END
88 aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
94 //=======================================================================
95 //function : SortTypes
97 //=======================================================================
98 void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
99 Standard_Integer& theWith)const
101 Standard_Integer aWhat, aWith;
102 Standard_Boolean aReverseFlag;
103 TopAbs_ShapeEnum aType1, aType2;
105 aType1= myDS->GetShapeType(theWhat),
106 aType2= myDS->GetShapeType(theWith);
108 if (aType1==aType2) {
112 aReverseFlag=Standard_True;
113 if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE) {
114 aReverseFlag=Standard_False;
116 if (aType1==TopAbs_VERTEX &&
117 (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
118 aReverseFlag=Standard_False;
121 aWhat=(aReverseFlag) ? theWith : theWhat;
122 aWith=(aReverseFlag) ? theWhat : theWith;