1 // Copyright (C) 2007-2010 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
23 // File: NMTTools_PaveFiller_0.cxx
24 // Created: Mon Dec 8 11:45:51 2003
25 // Author: Peter KURNEV
28 #include <NMTTools_PaveFiller.ixx>
30 #include <TColStd_IndexedMapOfInteger.hxx>
31 #include <TopAbs_ShapeEnum.hxx>
33 #include <NMTDS_InterfPool.hxx>
34 #include <NMTDS_ShapesDataStructure.hxx>
35 #include <NMTDS_Iterator.hxx>
37 //=======================================================================
38 // function:IsSuccesstorsComputed
40 //=======================================================================
41 Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
42 const Standard_Integer aN2)const
44 Standard_Boolean bComputed;
45 Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
46 TopAbs_ShapeEnum aType;
47 TColStd_IndexedMapOfInteger aMSuc;
51 aType=myDS->GetShapeType(aN1);
52 if (aType!=TopAbs_VERTEX) {
58 myDS->GetAllSuccessors(n2, aMSuc);
60 for (i=1; i<=aNbS; ++i) {
62 bComputed=myIP->Contains(n1, nSuc);
70 //=======================================================================
71 // function: ExpectedPoolLength
73 //=======================================================================
74 Standard_Integer NMTTools_PaveFiller::ExpectedPoolLength()const
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
89 aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
95 //=======================================================================
96 //function : SortTypes
98 //=======================================================================
99 void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
100 Standard_Integer& theWith)const
102 Standard_Integer aWhat, aWith;
103 Standard_Boolean aReverseFlag;
104 TopAbs_ShapeEnum aType1, aType2;
106 aType1= myDS->GetShapeType(theWhat),
107 aType2= myDS->GetShapeType(theWith);
109 if (aType1==aType2) {
113 aReverseFlag=Standard_True;
114 if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE) {
115 aReverseFlag=Standard_False;
117 if (aType1==TopAbs_VERTEX &&
118 (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
119 aReverseFlag=Standard_False;
122 aWhat=(aReverseFlag) ? theWith : theWhat;
123 aWith=(aReverseFlag) ? theWhat : theWith;