Back to index

salome-geom  6.5.0
NMTTools_PaveFiller_0.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File:        NMTTools_PaveFiller_0.cxx
00024 // Created:     Mon Dec  8 11:45:51 2003
00025 // Author:      Peter KURNEV
00026 //              <pkv@irinox>
00027 //
00028 #include <NMTTools_PaveFiller.hxx>
00029 
00030 #include <TColStd_IndexedMapOfInteger.hxx>
00031 #include <TopAbs_ShapeEnum.hxx>
00032 
00033 #include <NMTDS_InterfPool.hxx>
00034 #include <NMTDS_ShapesDataStructure.hxx>
00035 #include <NMTDS_Iterator.hxx>
00036 
00037 //=======================================================================
00038 // function:IsSuccesstorsComputed
00039 // purpose:
00040 //=======================================================================
00041   Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
00042                                                              const Standard_Integer aN2)const
00043 {
00044   Standard_Boolean bComputed;
00045   Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
00046   TopAbs_ShapeEnum aType;
00047   TColStd_IndexedMapOfInteger aMSuc;
00048   //
00049   n1=aN1;
00050   n2=aN2;
00051   aType=myDS->GetShapeType(aN1);
00052   if (aType!=TopAbs_VERTEX) {
00053     ntmp=n1;
00054     n1=n2;
00055     n2=ntmp;
00056   }
00057   //
00058   myDS->GetAllSuccessors(n2, aMSuc);
00059   aNbS=aMSuc.Extent();
00060   for (i=1; i<=aNbS; ++i) {
00061     nSuc=aMSuc(i);
00062     bComputed=myIP->Contains(n1, nSuc);
00063     if (bComputed) {
00064       break;
00065     }
00066   }
00067   return bComputed;
00068 }
00069 /*
00070 //=======================================================================
00071 // function:  ExpectedPoolLength
00072 // purpose:
00073 //=======================================================================
00074   Standard_Integer NMTTools_PaveFiller::ExpectedPoolLength()const
00075 {
00076   Standard_Integer aNbIIs;
00077   Standard_Real aCfPredict=.5;
00078   // Modified  Thu Sep 14 14:35:18 2006
00079   // Contribution of Samtech www.samcef.com BEGIN
00080   //const BOPTools_ListOfCoupleOfInteger& aLC=myDSIt.ListOfCouple();
00081   //aNbIIs=aLC.Extent();
00082   aNbIIs=myDSIt->ExpectedLength();
00083   // Contribution of Samtech www.samcef.com END
00084   //
00085   if (aNbIIs==1) {
00086     return aNbIIs;
00087   }
00088   //
00089   aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
00090 
00091   return aNbIIs;
00092 }
00093 */
00094 /*
00095 //=======================================================================
00096 //function : SortTypes
00097 //purpose  :
00098 //=======================================================================
00099   void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
00100                                       Standard_Integer& theWith)const
00101 {
00102   Standard_Integer aWhat, aWith;
00103   Standard_Boolean aReverseFlag;
00104   TopAbs_ShapeEnum aType1, aType2;
00105   //
00106   aType1= myDS->GetShapeType(theWhat),
00107   aType2= myDS->GetShapeType(theWith);
00108   //
00109   if (aType1==aType2) {
00110     return;
00111   }
00112   //
00113   aReverseFlag=Standard_True;
00114   if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE) {
00115     aReverseFlag=Standard_False;
00116   }
00117   if (aType1==TopAbs_VERTEX &&
00118       (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
00119     aReverseFlag=Standard_False;
00120   }
00121   //
00122   aWhat=(aReverseFlag) ? theWith : theWhat;
00123   aWith=(aReverseFlag) ? theWhat : theWith;
00124   //
00125   theWhat=aWhat;
00126   theWith=aWith;
00127 }
00128 */