]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
change header
authoreap <eap@opencascade.com>
Tue, 9 Feb 2021 11:52:53 +0000 (14:52 +0300)
committereap <eap@opencascade.com>
Tue, 9 Feb 2021 11:52:53 +0000 (14:52 +0300)
31 files changed:
idl/SMESH_Gen.idl
idl/SMESH_Group.idl
src/Controls/SMESH_Controls.cxx
src/Controls/SMESH_ControlsDef.hxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/OBJECT/SMESH_ActorUtils.cxx
src/OBJECT/SMESH_ActorUtils.h
src/OBJECT/SMESH_Object.cxx
src/OBJECT/SMESH_Object.h
src/OBJECT/SMESH_ObjectDef.h
src/SMDS/SMDS_ElementFactory.cxx
src/SMDS/SMDS_ElementFactory.hxx
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_MeshGroup.hxx
src/SMDS/SMDS_UnstructuredGrid.cxx
src/SMESH/SMESH_Algo.hxx
src/SMESHDS/SMESHDS_Group.hxx
src/SMESHDS/SMESHDS_GroupBase.cxx
src/SMESHDS/SMESHDS_GroupBase.hxx
src/SMESHDS/SMESHDS_GroupOnFilter.cxx
src/SMESHDS/SMESHDS_GroupOnFilter.hxx
src/SMESHDS/SMESHDS_GroupOnGeom.hxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHUtils/SMESH_MeshAlgos.cxx
src/SMESHUtils/SMESH_Offset.cxx
src/SMESHUtils/SMESH_Slot.cxx
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_Group_i.cxx
src/SMESH_I/SMESH_Group_i.hxx
src/SMESH_I/SMESH_MeshEditor_i.cxx
src/SMESH_I/SMESH_Mesh_i.cxx

index dd25f1d47ae997a19abda0ecc332b9c44f15d483..4e71c25d5743176b4f7cb914442ae7ff38cd9eec 100644 (file)
@@ -386,8 +386,8 @@ module SMESH
     /*!
      * Evaluates size of prospective mesh on a shape
      */
-    long_array  Evaluate(in SMESH_Mesh        theMesh,
-                         in GEOM::GEOM_Object theSubObject)
+    smIdType_array  Evaluate(in SMESH_Mesh        theMesh,
+                             in GEOM::GEOM_Object theSubObject)
       raises ( SALOME::SALOME_Exception );
 
     /*!
index 0364463afe147bcbbdfcc66cbd440f7de9ed7e1b..9c704d70adefec68c5787ea34a093999e20bad84 100644 (file)
@@ -62,7 +62,7 @@ module SMESH
     /*!
      * Returns the number of elements in the group
      */
-    long Size();
+    smIdType Size();
 
     /*!
      * Returns true if the group does not contain any elements
index 077adc271316cec63de3a2bccdb252421274f27f..4f7b076939c0590f38dbbe02be224e345a5b0e2a 100644 (file)
@@ -127,7 +127,7 @@ namespace {
     return aDist;
   }
 
-  int getNbMultiConnection( const SMDS_Mesh* theMesh, const int theId )
+  int getNbMultiConnection( const SMDS_Mesh* theMesh, const smIdType theId )
   {
     if ( theMesh == 0 )
       return 0;
@@ -225,7 +225,7 @@ void NumericalFunctor::SetMesh( const SMDS_Mesh* theMesh )
   myMesh = theMesh;
 }
 
-bool NumericalFunctor::GetPoints(const int       theId,
+bool NumericalFunctor::GetPoints(const smIdType       theId,
                                  TSequenceOfXYZ& theRes ) const
 {
   theRes.clear();
@@ -322,12 +322,12 @@ bool NumericalFunctor::IsApplicable( long theElementId ) const
  */
 //================================================================================
 
-void NumericalFunctor::GetHistogram(int                     nbIntervals,
-                                    std::vector<int>&       nbEvents,
-                                    std::vector<double>&    funValues,
-                                    const std::vector<int>& elements,
-                                    const double*           minmax,
-                                    const bool              isLogarithmic)
+void NumericalFunctor::GetHistogram(int                          nbIntervals,
+                                    std::vector<int>&            nbEvents,
+                                    std::vector<double>&         funValues,
+                                    const std::vector<smIdType>& elements,
+                                    const double*                minmax,
+                                    const bool                   isLogarithmic)
 {
   if ( nbIntervals < 1 ||
        !myMesh ||
@@ -346,7 +346,7 @@ void NumericalFunctor::GetHistogram(int                     nbIntervals,
   }
   else
   {
-    std::vector<int>::const_iterator id = elements.begin();
+    std::vector<smIdType>::const_iterator id = elements.begin();
     for ( ; id != elements.end(); ++id )
       values.insert( GetValue( *id ));
   }
@@ -1871,7 +1871,7 @@ void Length2D::GetValues(TValues& theValues)
       {
         // use special nodes iterator
         SMDS_NodeIteratorPtr anIter = anElem->interlacedNodesIterator();
-        long aNodeId[4] = { 0,0,0,0 };
+        smIdType aNodeId[4] = { 0,0,0,0 };
         gp_Pnt P[4];
 
         double aLength = 0;
@@ -1908,7 +1908,7 @@ void Length2D::GetValues(TValues& theValues)
       }
       else {
         SMDS_NodeIteratorPtr aNodesIter = anElem->nodeIterator();
-        long aNodeId[2] = {0,0};
+        smIdType aNodeId[2] = {0,0};
         gp_Pnt P[3];
 
         double aLength;
@@ -1923,7 +1923,7 @@ void Length2D::GetValues(TValues& theValues)
         for( ; aNodesIter->more(); )
         {
           aNode = aNodesIter->next();
-          long anId = aNode->GetID();
+          smIdType anId = aNode->GetID();
 
           P[2] = SMESH_NodeXYZ( aNode );
 
@@ -2092,7 +2092,7 @@ double MultiConnection2D::GetValue( long theElementId )
       if (!anIter) break;
 
       const SMDS_MeshNode *aNode, *aNode0 = 0;
-      TColStd_MapOfInteger aMap, aMapPrev;
+      NCollection_Map< smIdType > aMap, aMapPrev;
 
       for (i = 0; i <= len; i++) {
         aMapPrev = aMap;
@@ -2468,7 +2468,7 @@ void CoincidentNodes::SetMesh( const SMDS_Mesh* theMesh )
       std::list< const SMDS_MeshNode*>& coincNodes = *groupIt;
       std::list< const SMDS_MeshNode*>::iterator n = coincNodes.begin();
       for ( ; n != coincNodes.end(); ++n )
-        myCoincidentIDs.Add( FromIdType<int>((*n)->GetID()) );
+        myCoincidentIDs.Add( (*n)->GetID() );
     }
   }
 }
@@ -2575,14 +2575,14 @@ void FreeEdges::SetMesh( const SMDS_Mesh* theMesh )
   myMesh = theMesh;
 }
 
-bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId  )
+bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId  )
 {
   SMDS_ElemIteratorPtr anElemIter = theNodes[ 0 ]->GetInverseElementIterator(SMDSAbs_Face);
   while( anElemIter->more() )
   {
     if ( const SMDS_MeshElement* anElem = anElemIter->next())
     {
-      const int anId = FromIdType<int>(anElem->GetID());
+      const smIdType anId = anElem->GetID();
       if ( anId != theFaceId && anElem->GetNodeIndex( theNodes[1] ) >= 0 )
         return false;
     }
@@ -3084,7 +3084,7 @@ void ConnectedElements::SetPoint( double x, double y, double z )
 
     if ( !foundElems.empty() )
     {
-      myNodeID = FromIdType<int>(foundElems[0]->GetNode(0)->GetID());
+      myNodeID = foundElems[0]->GetNode(0)->GetID();
       if ( myOkIDsReady && !myMeshModifTracer.IsMeshModified() )
         isSameDomain = IsSatisfy( foundElems[0]->GetID() );
     }
@@ -3106,7 +3106,7 @@ bool ConnectedElements::IsSatisfy( long theElementId )
       return false;
 
     std::list< const SMDS_MeshNode* > nodeQueue( 1, node0 );
-    std::set< int > checkedNodeIDs;
+    std::set< smIdType > checkedNodeIDs;
     // algo:
     // foreach node in nodeQueue:
     //   foreach element sharing a node:
@@ -3124,14 +3124,14 @@ bool ConnectedElements::IsSatisfy( long theElementId )
         // keep elements of myType
         const SMDS_MeshElement* element = eIt->next();
         if ( myType == SMDSAbs_All || element->GetType() == myType )
-          myOkIDs.insert( myOkIDs.end(), FromIdType<int>(element->GetID()) );
+          myOkIDs.insert( myOkIDs.end(), element->GetID() );
 
         // enqueue nodes of the element
         SMDS_ElemIteratorPtr nIt = element->nodesIterator();
         while ( nIt->more() )
         {
           const SMDS_MeshNode* n = static_cast< const SMDS_MeshNode* >( nIt->next() );
-          if ( checkedNodeIDs.insert( FromIdType<int>(n->GetID()) ).second )
+          if ( checkedNodeIDs.insert( n->GetID()) )
             nodeQueue.push_back( n );
         }
       }
@@ -3217,7 +3217,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
             gp_Vec norm = getNormale( static_cast<const SMDS_MeshFace*>(f), &normOK );
             if (!normOK || isLessAngle( myNorm, norm, cosTol))
             {
-              myCoplanarIDs.Add( FromIdType<int>(f->GetID()) );
+              myCoplanarIDs.Add( f->GetID() );
               faceQueue.push_back( std::make_pair( f, norm ));
             }
           }
@@ -3817,7 +3817,7 @@ bool ManifoldPart::process()
 
   // the map of non manifold links and bad geometry
   TMapOfLink aMapOfNonManifold;
-  TColStd_MapOfInteger aMapOfTreated;
+  TIDsMap    aMapOfTreated;
 
   // begin cycle on faces from start index and run on vector till the end
   //  and from begin to start index to cover whole vector
@@ -3830,18 +3830,18 @@ bool ManifoldPart::process()
     // as result next time when fi will be equal to aStartIndx
 
     SMDS_MeshFace* aFacePtr = myAllFacePtr[ fi ];
-    if ( aMapOfTreated.Contains( FromIdType<int>(aFacePtr->GetID()) ) )
+    if ( aMapOfTreated.Contains( aFacePtr->GetID()) )
       continue;
 
-    aMapOfTreated.Add( FromIdType<int>(aFacePtr->GetID()) );
-    TColStd_MapOfInteger aResFaces;
+    aMapOfTreated.Add( aFacePtr->GetID() );
+    TIDsMap aResFaces;
     if ( !findConnected( myAllFacePtrIntDMap, aFacePtr,
                          aMapOfNonManifold, aResFaces ) )
       continue;
-    TColStd_MapIteratorOfMapOfInteger anItr( aResFaces );
+    TIDsMap::Iterator anItr( aResFaces );
     for ( ; anItr.More(); anItr.Next() )
     {
-      int aFaceId = anItr.Key();
+      smIdType aFaceId = anItr.Key();
       aMapOfTreated.Add( aFaceId );
       myMapIds.Add( aFaceId );
     }
@@ -3877,7 +3877,7 @@ bool ManifoldPart::findConnected
                  ( const ManifoldPart::TDataMapFacePtrInt& theAllFacePtrInt,
                   SMDS_MeshFace*                           theStartFace,
                   ManifoldPart::TMapOfLink&                theNonManifold,
-                  TColStd_MapOfInteger&                    theResFaces )
+                  TIDsMap&                                 theResFaces )
 {
   theResFaces.Clear();
   if ( !theAllFacePtrInt.size() )
@@ -3885,13 +3885,13 @@ bool ManifoldPart::findConnected
 
   if ( getNormale( theStartFace ).SquareModulus() <= gp::Resolution() )
   {
-    myMapBadGeomIds.Add( FromIdType<int>(theStartFace->GetID()) );
+    myMapBadGeomIds.Add( theStartFace->GetID() );
     return false;
   }
 
   ManifoldPart::TMapOfLink aMapOfBoundary, aMapToSkip;
   ManifoldPart::TVectorOfLink aSeqOfBoundary;
-  theResFaces.Add( FromIdType<int>(theStartFace->GetID()) );
+  theResFaces.Add( theStartFace->GetID() );
   ManifoldPart::TDataMapOfLinkFacePtr aDMapLinkFace;
 
   expandBoundary( aMapOfBoundary, aSeqOfBoundary,
@@ -3945,7 +3945,7 @@ bool ManifoldPart::findConnected
         SMDS_MeshFace* aNextFace = *pFace;
         if ( aPrevFace == aNextFace )
           continue;
-        int anNextFaceID = FromIdType<int>(aNextFace->GetID());
+        smIdType anNextFaceID = aNextFace->GetID();
         if ( myIsOnlyManifold && theResFaces.Contains( anNextFaceID ) )
          // should not be with non manifold restriction. probably bad topology
           continue;
@@ -3973,7 +3973,7 @@ bool ManifoldPart::isInPlane( const SMDS_MeshFace* theFace1,
   gp_XYZ aNorm2XYZ = getNormale( theFace2 );
   if ( aNorm2XYZ.SquareModulus() <= gp::Resolution() )
   {
-    myMapBadGeomIds.Add( FromIdType<int>(theFace2->GetID()) );
+    myMapBadGeomIds.Add( theFace2->GetID() );
     return false;
   }
   if ( aNorm1.IsParallel( gp_Dir( aNorm2XYZ ), myAngToler ) )
@@ -4176,7 +4176,9 @@ void ElementsOnSurface::process()
   if ( !myMeshModifTracer.GetMesh() )
     return;
 
-  myIds.ReSize( FromIdType<int>(myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType )));
+  int nbElems = FromIdType<int>( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ));
+  if ( nbElems > 0 )
+    myIds.ReSize( nbElems );
 
   SMDS_ElemIteratorPtr anIter = myMeshModifTracer.GetMesh()->elementsIterator( myType );
   for(; anIter->more(); )
@@ -4197,7 +4199,7 @@ void ElementsOnSurface::process( const SMDS_MeshElement* theElemPtr )
     }
   }
   if ( isSatisfy )
-    myIds.Add( FromIdType<int>(theElemPtr->GetID()) );
+    myIds.Add( heElemPtr->GetID() );
 }
 
 bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode )
index 7d25f1dca9b27dfc95ad1653e34e42b92824fd41..c08f752420846842145b9ea3070004f7fe449f0c 100644 (file)
@@ -32,8 +32,8 @@
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <Quantity_Color.hxx>
 #include <TColStd_MapOfInteger.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
 #include <TCollection_AsciiString.hxx>
+#include <NCollection_Map.hxx>
 #include <TopAbs.hxx>
 #include <TopoDS_Face.hxx>
 #include <gp_XYZ.hxx>
@@ -58,6 +58,8 @@ class ShapeAnalysis_Surface;
 class gp_Pln;
 class gp_Pnt;
 
+typedef NCollection_Map< smIdType > TIDsMap;
+
 namespace SMESH{
   namespace Controls{
 
@@ -130,12 +132,12 @@ namespace SMESH{
       virtual void SetMesh( const SMDS_Mesh* theMesh );
       virtual double GetValue( long theElementId );
       virtual double GetValue(const TSequenceOfXYZ& /*thePoints*/) { return -1.0;};
-      void GetHistogram(int                     nbIntervals,
-                        std::vector<int>&       nbEvents,
-                        std::vector<double>&    funValues,
-                        const std::vector<int>& elements,
-                        const double*           minmax=0,
-                        const bool              isLogarithmic = false);
+      void GetHistogram(int                          nbIntervals,
+                        std::vector<int>&            nbEvents,
+                        std::vector<double>&         funValues,
+                        const std::vector<smIdType>& elements,
+                        const double*                minmax=0,
+                        const bool                   isLogarithmic = false);
       bool IsApplicable( long theElementId ) const;
       virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
       virtual SMDSAbs_ElementType GetType() const = 0;
@@ -144,7 +146,7 @@ namespace SMESH{
       void  SetPrecision( const long thePrecision );
       double Round( const double & value );
       
-      bool GetPoints(const int theId, TSequenceOfXYZ& theRes) const;
+      bool GetPoints(const smIdType theId, TSequenceOfXYZ& theRes) const;
       static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes);
     protected:
       const SMDS_Mesh*        myMesh;
@@ -423,9 +425,9 @@ namespace SMESH{
       double GetTolerance () const { return myToler; }
 
     private:
-      double               myToler;
-      TColStd_MapOfInteger myCoincidentIDs;
-      TMeshModifTracer     myMeshModifTracer;
+      double           myToler;
+      TIDsMap          myCoincidentIDs;
+      TMeshModifTracer myMeshModifTracer;
     };
     typedef boost::shared_ptr<CoincidentNodes> CoincidentNodesPtr;
    
@@ -591,7 +593,7 @@ namespace SMESH{
       virtual void SetMesh( const SMDS_Mesh* theMesh );
       virtual bool IsSatisfy( long theElementId );
       virtual SMDSAbs_ElementType GetType() const;
-      static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId  );
+      static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId  );
       typedef long TElemId;
       struct Border{
         TElemId myElemId;
@@ -650,9 +652,9 @@ namespace SMESH{
     protected:
       const SMDS_Mesh*              myMesh;
 
-      TColStd_SequenceOfInteger     myMin;
-      TColStd_SequenceOfInteger     myMax;
-      TColStd_MapOfInteger          myIds;
+      std::vector< smIdType>        myMin;
+      std::vector< smIdType >       myMax;
+      TIDsMap                       myIds;
 
       SMDSAbs_ElementType           myType;
     };
@@ -833,7 +835,7 @@ namespace SMESH{
       bool    findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
                              SMDS_MeshFace*            theStartFace,
                              TMapOfLink&               theNonManifold,
-                             TColStd_MapOfInteger&     theResFaces );
+                             TIDsMap&                  theResFaces );
       bool    isInPlane( const SMDS_MeshFace* theFace1,
                           const SMDS_MeshFace* theFace2 );
       void    expandBoundary( TMapOfLink&            theMapOfBoundary,
@@ -847,8 +849,8 @@ namespace SMESH{
 
     private:
       const SMDS_Mesh*      myMesh;
-      TColStd_MapOfInteger  myMapIds;
-      TColStd_MapOfInteger  myMapBadGeomIds;
+      TIDsMap               myMapIds;
+      TIDsMap               myMapBadGeomIds;
       TVectorOfFacePtr      myAllFacePtr;
       TDataMapFacePtrInt    myAllFacePtrIntDMap;
       double                myAngToler;
@@ -909,7 +911,7 @@ namespace SMESH{
 
     private:
       TMeshModifTracer      myMeshModifTracer;
-      TColStd_MapOfInteger  myIds;
+      TIDsMap               myIds;
       SMDSAbs_ElementType   myType;
       TopoDS_Face           mySurf;
       double                myToler;
@@ -1149,7 +1151,7 @@ namespace SMESH{
       TMeshModifTracer     myMeshModifTracer;
       long                 myFaceID;
       double               myToler;
-      TColStd_MapOfInteger myCoplanarIDs;
+      TIDsMap              myCoplanarIDs;
     };
     typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
 
@@ -1176,14 +1178,14 @@ namespace SMESH{
       //const std::set<long>& GetDomainIDs() const { return myOkIDs; }
 
     private:
-      int                 myNodeID;
+      smIdType            myNodeID;
       std::vector<double> myXYZ;
       SMDSAbs_ElementType myType;
       TMeshModifTracer    myMeshModifTracer;
 
       void                clearOkIDs();
       bool                myOkIDsReady;
-      std::set< int >     myOkIDs; // empty means that there is one domain
+      std::set<smIdType>  myOkIDs; // empty means that there is one domain
     };
     typedef boost::shared_ptr<ConnectedElements> ConnectedElementsPtr;
 
index 704cfdb6c35ccbe89165fe1b78b490f6285e3060..35520743691bd7f63ddc246a6dc0645642a8727b 100644 (file)
@@ -539,7 +539,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
     const EBooleen      theIsElemNames = eFAUX;
     const EConnectivite theConnMode    = eNOD;
 
-    TInt aNbNodes = FromIdType<int>(myMesh->NbNodes());
+    TInt aNbNodes = FromIdType<TInt>( myMesh->NbNodes() );
     PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes,
                                             theMode, theSystem, theIsElemNum, theIsElemNames);
 
@@ -625,66 +625,66 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
 #endif
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eBALL,
-                                             FromIdType<int>(nbElemInfo.NbBalls()),
+                                             FromIdType<TInt>(nbElemInfo.NbBalls()),
                                              SMDSAbs_Ball));
 #ifdef _ELEMENTS_BY_DIM_
     anEntity = eARETE;
 #endif
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eSEG2,
-                                             FromIdType<int>(nbElemInfo.NbEdges( ORDER_LINEAR )),
+                                             FromIdType<TInt>(nbElemInfo.NbEdges( ORDER_LINEAR )),
                                              SMDSAbs_Edge));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eSEG3,
-                                             FromIdType<int>(nbElemInfo.NbEdges( ORDER_QUADRATIC )),
+                                             FromIdType<TInt>(nbElemInfo.NbEdges( ORDER_QUADRATIC )),
                                              SMDSAbs_Edge));
 #ifdef _ELEMENTS_BY_DIM_
     anEntity = eFACE;
 #endif
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eTRIA3,
-                                             FromIdType<int>(nbElemInfo.NbTriangles( ORDER_LINEAR )),
+                                             FromIdType<TInt>(nbElemInfo.NbTriangles( ORDER_LINEAR )),
                                              SMDSAbs_Face));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eTRIA6,
-                                             FromIdType<int>(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
+                                             FromIdType<TInt>(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
                                              nbElemInfo.NbBiQuadTriangles()),
                                              SMDSAbs_Face));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eTRIA7,
-                                             FromIdType<int>(nbElemInfo.NbBiQuadTriangles()),
+                                             FromIdType<TInt>(nbElemInfo.NbBiQuadTriangles()),
                                              SMDSAbs_Face));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eQUAD4,
-                                             FromIdType<int>(nbElemInfo.NbQuadrangles( ORDER_LINEAR )),
+                                             FromIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_LINEAR )),
                                              SMDSAbs_Face));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eQUAD8,
-                                             FromIdType<int>(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
+                                             FromIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
                                              nbElemInfo.NbBiQuadQuadrangles()),
                                              SMDSAbs_Face));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eQUAD9,
-                                             FromIdType<int>(nbElemInfo.NbBiQuadQuadrangles()),
+                                             FromIdType<TInt>(nbElemInfo.NbBiQuadQuadrangles()),
                                              SMDSAbs_Face));
     if ( polyTypesSupported ) {
       aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                                ePOLYGONE,
-                                               FromIdType<int>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
+                                               FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
                                                SMDSAbs_Face));
       // we need one more loop on poly elements to count nb of their nodes
       aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                                ePOLYGONE,
-                                               FromIdType<int>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
+                                               FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
                                                SMDSAbs_Face));
       aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                                ePOLYGON2,
-                                               FromIdType<int>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
+                                               FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
                                                SMDSAbs_Face));
       // we need one more loop on QUAD poly elements to count nb of their nodes
       aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                                ePOLYGON2,
-                                               FromIdType<int>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
+                                               FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
                                                SMDSAbs_Face));
     }
 #ifdef _ELEMENTS_BY_DIM_
@@ -692,58 +692,58 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
 #endif
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eTETRA4,
-                                             FromIdType<int>(nbElemInfo.NbTetras( ORDER_LINEAR )),
+                                             FromIdType<TInt>(nbElemInfo.NbTetras( ORDER_LINEAR )),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eTETRA10,
-                                             FromIdType<int>(nbElemInfo.NbTetras( ORDER_QUADRATIC )),
+                                             FromIdType<TInt>(nbElemInfo.NbTetras( ORDER_QUADRATIC )),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              ePYRA5,
-                                             FromIdType<int>(nbElemInfo.NbPyramids( ORDER_LINEAR )),
+                                             FromIdType<TInt>(nbElemInfo.NbPyramids( ORDER_LINEAR )),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              ePYRA13,
-                                             FromIdType<int>(nbElemInfo.NbPyramids( ORDER_QUADRATIC )),
+                                             FromIdType<TInt>(nbElemInfo.NbPyramids( ORDER_QUADRATIC )),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              ePENTA6,
-                                             FromIdType<int>(nbElemInfo.NbPrisms( ORDER_LINEAR )),
+                                             FromIdType<TInt>(nbElemInfo.NbPrisms( ORDER_LINEAR )),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              ePENTA15,
-                                             FromIdType<int>(nbElemInfo.NbQuadPrisms()),
+                                             FromIdType<TInt>(nbElemInfo.NbQuadPrisms()),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              ePENTA18,
-                                             FromIdType<int>(nbElemInfo.NbBiQuadPrisms()),
+                                             FromIdType<TInt>(nbElemInfo.NbBiQuadPrisms()),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eHEXA8,
-                                             FromIdType<int>(nbElemInfo.NbHexas( ORDER_LINEAR )),
+                                             FromIdType<TInt>(nbElemInfo.NbHexas( ORDER_LINEAR )),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eHEXA20,
-                                             FromIdType<int>(nbElemInfo.NbHexas( ORDER_QUADRATIC )-
+                                             FromIdType<TInt>(nbElemInfo.NbHexas( ORDER_QUADRATIC )-
                                              nbElemInfo.NbTriQuadHexas()),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eHEXA27,
-                                             FromIdType<int>(nbElemInfo.NbTriQuadHexas()),
+                                             FromIdType<TInt>(nbElemInfo.NbTriQuadHexas()),
                                              SMDSAbs_Volume));
     aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                              eOCTA12,
-                                             FromIdType<int>(nbElemInfo.NbHexPrisms()),
+                                             FromIdType<TInt>(nbElemInfo.NbHexPrisms()),
                                              SMDSAbs_Volume));
     if ( polyTypesSupported ) {
       aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                                ePOLYEDRE,
-                                               FromIdType<int>(nbElemInfo.NbPolyhedrons()),
+                                               FromIdType<TInt>(nbElemInfo.NbPolyhedrons()),
                                                SMDSAbs_Volume));
       // we need one more loop on poly elements to count nb of their nodes
       aTElemTypeDatas.push_back( TElemTypeData(anEntity,
                                                ePOLYEDRE,
-                                               FromIdType<int>(nbElemInfo.NbPolyhedrons()),
+                                               FromIdType<TInt>(nbElemInfo.NbPolyhedrons()),
                                                SMDSAbs_Volume));
     }
 
@@ -822,13 +822,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
             for(TInt iNode = 0; iNode < aNbNodes; iNode++) {
               const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
 #ifdef _EDF_NODE_IDS_
-              aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<int>(aNode->GetID())];
+              aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
 #else
               aTConnSlice[ iNode ] = aNode->GetID();
 #endif
             }
             // element number
-            aPolygoneInfo->SetElemNum( iElem, FromIdType<int>(anElem->GetID()) );
+            aPolygoneInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
 
             // family number
             int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
@@ -896,14 +896,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
             while ( nodeIt->more() ) {
               const SMDS_MeshElement* aNode = nodeIt->next();
 #ifdef _EDF_NODE_IDS_
-              conn[ iNode ] = aNodeIdMap[FromIdType<int>(aNode->GetID())];
+              conn[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
 #else
               conn[ iNode ] = aNode->GetID();
 #endif
               ++iNode;
             }
             // element number
-            aPolyhInfo->SetElemNum( iElem, FromIdType<int>(anElem->GetID()) );
+            aPolyhInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
 
             // family number
             int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
@@ -930,12 +930,12 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
           // connectivity
           const SMDS_MeshElement* aNode = anElem->GetNode( 0 );
 #ifdef _EDF_NODE_IDS_
-          (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType<int>(aNode->GetID())];
+          (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
 #else
           (*aBallInfo->myConn)[ iElem ] = aNode->GetID();
 #endif
           // element number
-          aBallInfo->SetElemNum( iElem, FromIdType<int>(anElem->GetID()) );
+          aBallInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
 
           // diameter
           aBallInfo->myDiameters[ iElem ] =
@@ -978,13 +978,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
           for (TInt iNode = 0; iNode < aNbNodes; iNode++) {
             const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
 #ifdef _EDF_NODE_IDS_
-            aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<int>(aNode->GetID())];
+            aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
 #else
             aTConnSlice[ iNode ] = aNode->GetID();
 #endif
           }
           // element number
-          aCellInfo->SetElemNum( iElem, FromIdType<int>(anElem->GetID()) );
+          aCellInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
 
           // family number
           int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
index 81f51a9869aaaaf1588220b2011312120520f7fc..1d5ab2d868002ea91693c0f17e41999906c6f78f 100644 (file)
@@ -158,16 +158,16 @@ namespace SMESH
   }
 
   std::map<SMDSAbs_ElementType,int> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
-    std::map<SMDSAbs_ElementType,int> entities;
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_0DElement,
+    std::map<SMDSAbs_ElementType,smIdType> entities;
+    entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_0DElement,
                 theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Ball,
+    entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Ball,
                 theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Edge,
+    entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Edge,
                 theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Face,
+    entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Face,
                 theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0));
-    entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Volume,
+    entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Volume,
                 theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
     return entities;
   }
index d4d45fa8341e8e81c3f8340601c7d01d9d112dd2..90520f295229d91f860f5e35633f4d3be8f3db2f 100644 (file)
@@ -84,7 +84,7 @@ SMESHOBJECT_EXPORT
               QString def);
    
  SMESHOBJECT_EXPORT
-   std::map<SMDSAbs_ElementType,int>
+   std::map<SMDSAbs_ElementType,smIdType>
    GetEntitiesFromObject(SMESH_VisualObj *theObject);
    
 SMESHOBJECT_EXPORT
index 72fbe672c9412caf0ec15326dd8b418d2ccaadeb..191ff862672bd09a6b83b79ffffd3a184ca746f1 100644 (file)
@@ -557,7 +557,7 @@ void SMESH_VisualObjDef::updateEntitiesFlags()
   unsigned int tmp = myEntitiesState;
   ClearEntitiesFlags();
 
-  map<SMDSAbs_ElementType,int> entities = SMESH::GetEntitiesFromObject(this);
+  map<SMDSAbs_ElementType,smIdType> entities = SMESH::GetEntitiesFromObject(this);
 
 
   if( myEntitiesCache[SMDSAbs_0DElement] != 0 ||
index d7c1a3688d9094e17b122bc75105e0eedfad9bc3..2d7af67ec25f0467f8d251297be3d261a4bd6acf 100644 (file)
@@ -61,24 +61,24 @@ public:
   virtual bool Update( int theIsClear = true ) = 0;
   virtual bool NulData() = 0;
   virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
-  virtual int GetElemDimension( const int theObjId ) = 0;
+  virtual int GetElemDimension( const smIdType theObjId ) = 0;
 
-  virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
+  virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
   virtual SMDS_Mesh* GetMesh() const = 0;
   virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0;
 
-  virtual bool GetEdgeNodes( const int theElemId,
-                             const int theEdgeNum,
-                             int&      theNodeId1,
-                             int&      theNodeId2 ) const = 0;
+  virtual bool GetEdgeNodes( const smIdType theElemId,
+                             const int      theEdgeNum,
+                             smIdType&      theNodeId1,
+                             smIdType&      theNodeId2 ) const = 0;
   virtual bool              IsValid() const = 0;
   
   virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
   
-  virtual vtkIdType GetNodeObjId( int theVTKID ) = 0;
-  virtual vtkIdType GetNodeVTKId( int theObjID ) = 0;
-  virtual vtkIdType GetElemObjId( int theVTKID ) = 0;
-  virtual vtkIdType GetElemVTKId( int theObjID ) = 0;
+  virtual vtkIdType GetNodeObjId( vtkIdType theVTKID ) = 0;
+  virtual vtkIdType GetNodeVTKId( vtkIdType theObjID ) = 0;
+  virtual vtkIdType GetElemObjId( vtkIdType theVTKID ) = 0;
+  virtual vtkIdType GetElemVTKId( vtkIdType theObjID ) = 0;
   virtual void              ClearEntitiesFlags() = 0;
   virtual bool              GetEntitiesFlag() = 0;
   virtual unsigned int      GetEntitiesState() = 0;
index de5cee59c0f4bed25a7a2bce3a8c0e57536ee686..6ad154ad917bc5809108d764af0cadc4e012330d 100644 (file)
@@ -63,27 +63,27 @@ public:
   virtual bool              Update( int theIsClear = true ) = 0;
   virtual bool              NulData() {return 0; };
   virtual void              UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
-  virtual int               GetElemDimension( const int theObjId ) = 0;
+  virtual int               GetElemDimension( const smIdType theObjId ) = 0;
 
-  virtual int               GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
-  virtual int               GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0;
+  virtual smIdType          GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
+  virtual smIdType          GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0;
   virtual bool              IsNodePrs() const = 0;
   virtual SMDS_Mesh*        GetMesh() const = 0;
   virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0;
 
   virtual bool              IsValid() const;
 
-  virtual bool              GetEdgeNodes( const int theElemId,
-                                          const int theEdgeNum,
-                                          int&      theNodeId1,
-                                          int&      theNodeId2 ) const;
+  virtual bool              GetEdgeNodes( const smIdType theElemId,
+                                          const int      theEdgeNum,
+                                          smIdType&      theNodeId1,
+                                          smIdType&      theNodeId2 ) const;
 
   virtual vtkUnstructuredGrid* GetUnstructuredGrid();
   
-  virtual vtkIdType         GetNodeObjId( int theVTKID );
-  virtual vtkIdType         GetNodeVTKId( int theObjID );
-  virtual vtkIdType         GetElemObjId( int theVTKID );
-  virtual vtkIdType         GetElemVTKId( int theObjID );
+  virtual vtkIdType         GetNodeObjId( vtkIdType theVTKID );
+  virtual vtkIdType         GetNodeVTKId( vtkIdType theObjID );
+  virtual vtkIdType         GetElemObjId( vtkIdType theVTKID );
+  virtual vtkIdType         GetElemVTKId( vtkIdType theObjID );
   
   virtual void              ClearEntitiesFlags();
   virtual bool              GetEntitiesFlag();
@@ -108,7 +108,7 @@ protected:
   unsigned int              myEntitiesState;
 
   vtkUnstructuredGrid*      myGrid;
-  std::map<SMDSAbs_ElementType,int> myEntitiesCache;
+  std::map<SMDSAbs_ElementType,smIdType> myEntitiesCache;
 };
 
 
@@ -127,11 +127,11 @@ public:
   virtual bool              Update( int theIsClear = true );
   virtual bool              NulData();
   
-  virtual int               GetNbEntities( const SMDSAbs_ElementType) const;
-  virtual int               GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
+  virtual smIdType          GetNbEntities( const SMDSAbs_ElementType) const;
+  virtual smIdType          GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
   virtual bool              IsNodePrs() const;
 
-  virtual int               GetElemDimension( const int theObjId );
+  virtual int               GetElemDimension( const smIdType theObjId );
 
   virtual void              UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
   
@@ -160,7 +160,7 @@ public:
   virtual bool              Update( int theIsClear = true );
   
   virtual void              UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
-  virtual int               GetElemDimension( const int theObjId );
+  virtual int               GetElemDimension( const smidtype theObjId );
   virtual SMDS_Mesh*        GetMesh() const { return myMeshObj->GetMesh(); }
   virtual SMESH::SMESH_Mesh_ptr GetMeshServer() { return myMeshObj->GetMeshServer(); }
   
@@ -181,8 +181,8 @@ public:
                             SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr, SMESH_MeshObj* );
   virtual                   ~SMESH_GroupObj();
 
-  virtual int               GetNbEntities( const SMDSAbs_ElementType) const;
-  virtual int               GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
+  virtual smidtype          GetNbEntities( const SMDSAbs_ElementType) const;
+  virtual smidtype          GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
   virtual bool              IsNodePrs() const;
 
   virtual SMDSAbs_ElementType GetElementType() const;
@@ -206,8 +206,8 @@ public:
                                               SMESH_MeshObj* );
   virtual                   ~SMESH_subMeshObj();
 
-  virtual int               GetNbEntities( const SMDSAbs_ElementType) const;
-  virtual int               GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
+  virtual smIdtype          GetNbEntities( const SMDSAbs_ElementType) const;
+  virtual smIdtype          GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
   virtual bool              IsNodePrs() const;    
   
 protected:
index 4ac7ca9aa73214c4f1cf81ac7283c59a914bfd66..1501b1eb566c07e6c8006640d6925204daf600e2 100644 (file)
@@ -584,7 +584,7 @@ smIdType SMDS_ElementChunk::GetUnusedID() const
 void SMDS_ElementChunk::Free( const SMDS_MeshElement* e )
 {
   bool hasHoles = ( myUsedRanges.Size() > 1 );
-  myUsedRanges.SetValue( FromIdType<int>(Index( e )), false );
+  myUsedRanges.SetValue( Index( e ), false );
   SetShapeID( e, 0 ); // sub-mesh must do it?
   SetIsMarked( e, false );
   if ( !hasHoles )
@@ -620,10 +620,11 @@ void SMDS_ElementChunk::SetVTKID( const SMDS_MeshElement* e, const vtkIdType vtk
   {
     if ((smIdType) myFactory->myVtkIDs.size() <= e->GetID() - 1 )
     {
-      size_t i = myFactory->myVtkIDs.size();
+      vtkIdType i = (vtkIdType) myFactory->myVtkIDs.size();
       myFactory->myVtkIDs.resize( e->GetID() + 100 );
-      for ( ; i < myFactory->myVtkIDs.size(); ++i )
-        myFactory->myVtkIDs[i] = FromIdType<vtkIdType>(i);
+      vtkIdType newSize = (vtkIdType) myFactory->myVtkIDs.size();
+      for ( ; i < newSize; ++i )
+        myFactory->myVtkIDs[i] = i;
     }
     myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID;
 
@@ -658,7 +659,7 @@ vtkIdType SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const
 
 int SMDS_ElementChunk::GetShapeID( const SMDS_MeshElement* e ) const
 {
-  return mySubIDRanges.GetValue( FromIdType<int>(Index( e )));
+  return mySubIDRanges.GetValue( Index( e ));
 }
 
 //================================================================================
@@ -672,7 +673,7 @@ void SMDS_ElementChunk::SetShapeID( const SMDS_MeshElement* e, int shapeID ) con
   //const size_t nbRanges = mySubIDRanges.Size();
 
   SMDS_ElementChunk* me = const_cast<SMDS_ElementChunk*>( this );
-  int oldShapeID = me->mySubIDRanges.SetValue( FromIdType<int>(Index( e )), shapeID );
+  int oldShapeID = me->mySubIDRanges.SetValue( Index( e ), shapeID );
   if ( oldShapeID == shapeID ) return;
 
   if ( const SMDS_MeshNode* n = dynamic_cast< const SMDS_MeshNode* >( e ))
index 63288bd6d897b6e667e3c7a740dc92d51dcaf073..165c0af89db80fd260d93b0cec4d8e06146b84de 100644 (file)
@@ -405,7 +405,7 @@ public:
   static bool IsUsed( const _UsedRange& r ) { return r.myValue; }
 
   //! Return index of an element in the chunk
-  smIdType Index( const SMDS_MeshElement* e ) const { return e - myElements; }
+  int Index( const SMDS_MeshElement* e ) const { return (int)( e - myElements ); }
 
   //! Return ID of the 1st element in the chunk
   smIdType Get1stID() const { return my1stID; }
index f2934ce25bb803f79c9eebbcfbdd6ed349a29419..624c4ad24092da11580f0d4207ac5d733a92ff4a 100644 (file)
@@ -815,9 +815,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
 SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
                                                   const smIdType               ID)
 {
-  smIdType nbNodes = nodes_ids.size();
+  size_t nbNodes = nodes_ids.size();
   std::vector<const SMDS_MeshNode*> nodes (nbNodes);
-  for (smIdType i = 0; i < nbNodes; i++) {
+  for ( size_t i = 0; i < nbNodes; i++) {
     nodes[i] = myNodeFactory->FindNode( nodes_ids[i] );
     if (!nodes[i]) return NULL;
   }
@@ -911,9 +911,9 @@ SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdTy
                                                         const std::vector<int>      & quantities,
                                                         const smIdType                ID)
 {
-  smIdType nbNodes = nodes_ids.size();
+  size_t nbNodes = nodes_ids.size();
   std::vector<const SMDS_MeshNode*> nodes (nbNodes);
-  for (smIdType i = 0; i < nbNodes; i++) {
+  for ( size_t i = 0; i < nbNodes; i++) {
     nodes[i] = myNodeFactory->FindNode(nodes_ids[i]);
     if (!nodes[i]) return NULL;
   }
index 39807aab32b23f998edd4e1a248d6b6c0f598a76..2c36609390a28c60050fbfe82e3a70d19e927958 100644 (file)
@@ -45,7 +45,7 @@ class SMDS_EXPORT SMDS_MeshGroup: public SMDS_MeshObject, SMDS_ElementHolder
   bool Add(const SMDS_MeshElement * theElem);
   bool Remove(const SMDS_MeshElement * theElem);
   bool IsEmpty() const { return myElements.empty(); }
-  int  Extent() const { return myElements.size(); }
+  smIdType  Extent() const { return (smIdType) myElements.size(); }
   int  Tic() const { return myTic; }
   bool Contains(const SMDS_MeshElement * theElem) const;
 
index ca5b300bf24a95a5a749c4a60ccfcac4f8d4b661..079d1567325e7f5897838e9f768041da5deaba05 100644 (file)
@@ -191,7 +191,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<smIdType>& idNodesOldToNew,
     // Use double type for storing coordinates of nodes instead float.
     vtkPoints *newPoints = vtkPoints::New();
     newPoints->SetDataType( VTK_DOUBLE );
-    newPoints->SetNumberOfPoints( FromIdType<int>(newNodeSize) );
+    newPoints->SetNumberOfPoints( FromIdType<vtkIdType>(newNodeSize) );
 
     vtkIdType i = 0, alreadyCopied = 0;
     while ( i < oldNodeSize )
@@ -298,16 +298,16 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<smIdType>& idNodesOldToNew,
       {
         smIdType oldCellId = idCellsNewToOld[ newCellID ];
         newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 );
-        smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType<int>(oldCellId) );
-        smIdType nCellFaces = this->Faces->GetValue( FromIdType<int>(oldFaceLoc++) );
-        newFaces->InsertNextValue( FromIdType<int>(nCellFaces) );
+        smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType<vtkIdType>(oldCellId) );
+        smIdType nCellFaces = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
+        newFaces->InsertNextValue( FromIdType<vtkIdType>(nCellFaces) );
         for ( int n = 0; n < nCellFaces; n++ )
         {
-          int nptsInFace = this->Faces->GetValue( FromIdType<int>(oldFaceLoc++) );
+          int nptsInFace = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
           newFaces->InsertNextValue( nptsInFace );
           for ( int k = 0; k < nptsInFace; k++ )
           {
-            vtkIdType oldpt = this->Faces->GetValue( FromIdType<int>(oldFaceLoc++) );
+            vtkIdType oldpt = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
             newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]);
           }
         }
index 72c17b7f972d7de7360c7a492ec366cae927daa8..b57f52eea3be6782f26469d5f3ee5bf895ea573f 100644 (file)
@@ -60,8 +60,8 @@ class TopoDS_Vertex;
 class TopoDS_Wire;
 class gp_XYZ;
 
-typedef std::map< SMESH_subMesh*, std::vector<int> >           MapShapeNbElems;
-typedef std::map< SMESH_subMesh*, std::vector<int> >::iterator MapShapeNbElemsItr;
+typedef std::map< SMESH_subMesh*, std::vector<smIdType> >           MapShapeNbElems;
+typedef std::map< SMESH_subMesh*, std::vector<smIdType> >::iterator MapShapeNbElemsItr;
 
 // ==================================================================================
 /*!
index c17705ab83c4a930063788e42736f609ba8d07c5..9fa9a7b4885adc282fbeebfad17d59d0b460defd 100644 (file)
@@ -46,11 +46,11 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase
 
   virtual void SetType(SMDSAbs_ElementType theType);
 
-  virtual int Extent() const;
+  virtual smIdType Extent() const;
 
   virtual bool IsEmpty();
 
-  virtual bool Contains (const int theID);
+  virtual bool Contains (const smIdType theID);
 
   virtual bool Contains (const SMDS_MeshElement* elem);
 
@@ -58,11 +58,11 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase
 
   virtual int GetTic() const;
 
-  bool Add (const int theID);
+  bool Add (const smIdType theID);
 
   bool Add (const SMDS_MeshElement* theElem );
 
-  bool Remove (const int theID);
+  bool Remove (const smIdType theID);
 
   void Clear();
 
index e6a9799be866b79251a48d538f9a4dbd424b2ff9..dc83665f5190b7de0fc796011b7ff1b84ee0f56f 100644 (file)
@@ -55,7 +55,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int                 theID,
  */
 //=============================================================================
 
-int SMESHDS_GroupBase::GetID (const int theIndex)
+smIdType SMESHDS_GroupBase::GetID (const int theIndex)
 {
   if (myCurIndex < 1 || myCurIndex > theIndex) {
     myIterator = GetElements();
@@ -64,7 +64,7 @@ int SMESHDS_GroupBase::GetID (const int theIndex)
   }
   while (myCurIndex < theIndex && myIterator->more()) {
     myCurIndex++;
-    myCurID = FromIdType<int>(myIterator->next()->GetID());
+    myCurID = myIterator->next()->GetID();
   }
   return myCurIndex == theIndex ? myCurID : -1;
 }
index f08b8a28908cd88ec18184f7296351a718093f11..c57fc95fb7fceb5b2ce3d8eae90757ce20d356e5 100644 (file)
@@ -58,17 +58,17 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
 
   const char* GetStoreName () const { return myStoreName.c_str(); }
 
-  virtual int Extent() const;
+  virtual smIdType Extent() const;
 
   virtual bool IsEmpty();
 
-  virtual bool Contains (const int theID);
+  virtual bool Contains (const smIdType theID);
 
   virtual bool Contains (const SMDS_MeshElement* elem);
 
   virtual SMDS_ElemIteratorPtr GetElements() const = 0;
 
-  virtual int GetID (const int theIndex);
+  virtual smIdType GetID (const int theIndex);
   // DON'T use it for iterations 1..Extent()
 
   virtual int GetTic() const = 0;
@@ -89,7 +89,7 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
   { myDefaultColor = theColor;}
 
  protected:
-  const SMDS_MeshElement* findInMesh (const int theID) const;
+  const SMDS_MeshElement* findInMesh (const smIdType theID) const;
   void resetIterator();
 
  private:
@@ -105,8 +105,8 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
   Quantity_Color       myColor;
 
   // for GetID()
-  int                  myCurIndex;
-  int                  myCurID;
+  smIdType             myCurIndex;
+  smIdType             myCurID;
   SMDS_ElemIteratorPtr myIterator;
 
   static Quantity_Color myDefaultColor;
index e11f228c0180d518cfd60936ec0b9db17e20d511..04ae87d0b9c21da73e9d29d1e7ab9ed373a04ff0 100644 (file)
@@ -315,7 +315,7 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
     if ( IsUpToDate() )
     {
       for ( ; elIt->more(); curID += idSize )
-        (*(int*) curID) = FromIdType<int>(elIt->next()->GetID());
+        (*(smIdType*) curID) = elIt->next()->GetID();
     }
     else
     {
@@ -325,11 +325,11 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
       me->myMeshInfo.assign( SMDSEntity_Last, 0 );
       me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
 
-      (*(int*) curID) = FromIdType<int>(firstOkElem->GetID());
+      (*(smidtype*) curID) = firstOkElem->GetID();
       for ( curID += idSize; elIt->more(); curID += idSize )
       {
         const SMDS_MeshElement* e = elIt->next();
-        (*(int*) curID) = FromIdType<int>(e->GetID());
+        (*(smIdtype*) curID) = e->GetID();
         me->myMeshInfo[ e->GetEntityType() ]++;
       }
     }
index 9b729bebd2d706508d1eb05d6b40aa2db99c48ad..cc9fd2ea93a91a13994cb3627e512774dcce691c 100644 (file)
@@ -50,17 +50,17 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme
   std::vector< int > GetMeshInfo() const;
 
   template< typename IDTYPE >
-    int GetElementIds( IDTYPE* ids ) const
+    smIdType GetElementIds( IDTYPE* ids ) const
   {
     return getElementIds( (void*)ids, sizeof(IDTYPE));
   }
 
 
-  virtual int  Extent() const;
+  virtual smIdType  Extent() const;
 
   virtual bool IsEmpty();
 
-  virtual bool Contains (const int theID);
+  virtual bool Contains (const smIdType theID);
 
   virtual bool Contains (const SMDS_MeshElement* elem);
 
@@ -92,7 +92,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme
   // 2) The case of enough free memory. Remember all OK elements (myElements).
 
   SMESH_PredicatePtr                    myPredicate;
-  std::vector< int >                    myMeshInfo;
+  std::vector< smIdType >               myMeshInfo;
   std::vector< const SMDS_MeshElement*> myElements;
   bool                                  myElementsOK;
   size_t                                myMeshModifTime; // when myMeshInfo was updated
index 3ea23e1e785553c4788d6210076dc5c19d18fefa..e81e8d61794d97c921cb77a1e677f9164b127fad 100644 (file)
@@ -47,7 +47,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnGeom: public SMESHDS_GroupBase
 
   TopoDS_Shape GetShape() const { return myShape; }
 
-  virtual bool Contains (const int theID);
+  virtual bool Contains (const smIdType theID);
 
   virtual bool Contains (const SMDS_MeshElement* elem);
 
index 6844cdea9debd56c8f579c8308677635e0ac7802..f84027be1090801b8e9d811f4373e575ebee5f98 100644 (file)
@@ -2229,9 +2229,7 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
     SUIT_OverrideCursor aWaitCursor;
     try {
       OCC_CATCH_SIGNALS;
-      SMESH::long_array_var tmp = gen->Evaluate(myMesh, myMainShape);
-      for ( int i = 0; i < tmp->length(); ++i)
-        aRes[ i ] = tmp [ i ];
+      aRes = gen->Evaluate(myMesh, myMainShape);
     }
     catch(const SALOME::SALOME_Exception & S_ex){
       memoryLack = true;
index c5bed4dad401e3066f316e93087bdf0c99156736..b25a81e29d8762cb43fc8f44018beda1eecbec13 100644 (file)
@@ -1981,7 +1981,11 @@ SMESH_MeshAlgos::FindSharpEdges( SMDS_Mesh* theMesh,
   typedef std::pair< bool, const SMDS_MeshNode* >                            TIsSharpAndMedium;
   typedef NCollection_DataMap< SMESH_TLink, TIsSharpAndMedium, SMESH_TLink > TLinkSharpMap;
 
-  TLinkSharpMap linkIsSharp( FromIdType<int>(theMesh->NbFaces()) );
+  TLinkSharpMap linkIsSharp;
+  Standard_Integer nbBuckets = FromIdType<Standard_Integer>( theMesh->NbFaces() );
+  if ( nbBuckets > 0 )
+    linkIsSharp.ReSize( nbBuckets );
+
   TIsSharpAndMedium sharpMedium( true, 0 );
   bool                 & isSharp = sharpMedium.first;
   const SMDS_MeshNode* & nMedium = sharpMedium.second;
@@ -2088,7 +2092,10 @@ SMESH_MeshAlgos::SeparateFacesByEdges( SMDS_Mesh* theMesh, const std::vector< Ed
 
   typedef std::vector< const SMDS_MeshElement* >                    TFaceVec;
   typedef NCollection_DataMap< SMESH_TLink, TFaceVec, SMESH_TLink > TFacesByLinks;
-  TFacesByLinks facesByLink( FromIdType<int>(theMesh->NbFaces()) );
+  TFacesByLinks facesByLink;
+  Standard_Integer nbBuckets = FromIdType<Standard_Integer>( theMesh->NbFaces() );
+  if ( nbBuckets > 0 )
+    facesByLink.ReSize( nbBuckets );
 
   std::vector< const SMDS_MeshNode* > faceNodes;
   for ( SMDS_FaceIteratorPtr faceIt = theMesh->facesIterator(); faceIt->more(); )
index 914c68241b6bfe7afe1166802fa3a86bca5800b9..cd886ee58026fc4aab3a2c8b8794e7e78ef175bf 100644 (file)
@@ -1934,7 +1934,7 @@ namespace SMESH_MeshAlgos
       {
         const CutFace& cf = *cutFacesIt;
         smIdType index = cf.myInitFace->GetID(); // index in theNew2OldFaces
-        if ((int) theNew2OldFaces.size() <= index )
+        if ((smIdType) theNew2OldFaces.size() <= index )
           theNew2OldFaces.resize( index + 1 );
         theNew2OldFaces[ index ] = std::make_pair( cf.myInitFace, index );
       }
@@ -3226,7 +3226,7 @@ SMDS_Mesh* SMESH_MeshAlgos::MakeOffset( SMDS_ElemIteratorPtr theFaceIt,
     for ( SMDS_ElemIteratorPtr fIt = newNode->GetInverseElementIterator(); fIt->more(); )
     {
       const SMDS_MeshElement* newFace = fIt->next();
-      const int             faceIndex = FromIdType<int>(newFace->GetID());
+      const smIdType        faceIndex = newFace->GetID();
       const gp_XYZ&           oldNorm = normals[ faceIndex ];
       const gp_XYZ             newXYZ = oldXYZ + oldNorm * theOffset;
       if ( multiPos.empty() )
@@ -3275,7 +3275,7 @@ SMDS_Mesh* SMESH_MeshAlgos::MakeOffset( SMDS_ElemIteratorPtr theFaceIt,
       for ( SMDS_ElemIteratorPtr fIt = newNode->GetInverseElementIterator(); fIt->more(); )
       {
         const SMDS_MeshElement* newFace = fIt->next();
-        const int             faceIndex = FromIdType<int>(newFace->GetID());
+        const smIdType        faceIndex = newFace->GetID();
         const gp_XYZ&           oldNorm = normals[ faceIndex ];
         if ( !SMESH_MeshAlgos::FaceNormal( newFace, faceNorm, /*normalize=*/false ) ||
              //faceNorm * moveVec < 0 )
index 910ef74f0754d85073036bc7a4d1b3b1bef492c8..7f5aff200f8c63c96f14df54c5c2cd83ea2fc6e2 100644 (file)
@@ -380,10 +380,10 @@ namespace
    */
   //================================================================================
 
-  void findGroups( const SMDS_MeshElement *                theFace,
-                   TGroupVec &                             theGroupsToUpdate,
-                   NCollection_DataMap< int, TGroupVec > & theFaceID2Groups,
-                   TGroupVec &                             theWorkGroups )
+  void findGroups( const SMDS_MeshElement *                     theFace,
+                   TGroupVec &                                  theGroupsToUpdate,
+                   NCollection_DataMap< smIdType, TGroupVec > & theFaceID2Groups,
+                   TGroupVec &                                  theWorkGroups )
   {
     theWorkGroups.clear();
     for ( size_t i = 0; i < theGroupsToUpdate.size(); ++i )
@@ -391,7 +391,7 @@ namespace
         theWorkGroups.push_back( theGroupsToUpdate[i] );
 
     if ( !theWorkGroups.empty() )
-      theFaceID2Groups.Bind( FromIdType<int>(theFace->GetID()), theWorkGroups );
+      theFaceID2Groups.Bind( theFace->GetID(), theWorkGroups );
   }
 
   //================================================================================
@@ -583,7 +583,7 @@ SMESH_MeshAlgos::MakeSlot( SMDS_ElemIteratorPtr             theSegmentIt,
   std::vector< SMESH_NodeXYZ > facePoints(4);
   std::vector< Intersector::TFace > cutFacePoints;
 
-  NCollection_DataMap< int, TGroupVec > faceID2Groups;
+  NCollection_DataMap< smIdType, TGroupVec > faceID2Groups;
   TGroupVec groupVec;
 
   std::vector< gp_Ax1 > planeNormalVec(2);
index 87111f7aa46f5f1f4fa69b61c456c019a1e01e87..4a9796ea3a00052e8e7ee8d920fa3448ed1dc7b4 100644 (file)
@@ -2330,9 +2330,8 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh
  */
 //=============================================================================
 
-SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
-                                         GEOM::GEOM_Object_ptr theShapeObject)
-//                                     SMESH::long_array& theNbElems)
+SMESH::smIdType_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
+                                             GEOM::GEOM_Object_ptr theShapeObject)
 {
   Unexpect aCatch(SALOME_SalomeException);
   if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Evaluate" );
@@ -2343,7 +2342,7 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
   if ( CORBA::is_nil( theMesh ) )
     THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM );
 
-  SMESH::long_array_var nbels = new SMESH::long_array;
+  SMESH::smIdType_array_var nbels = new SMESH::smIdType_array;
   nbels->length(SMESH::Entity_Last);
   int i = SMESH::Entity_Node;
   for (; i < SMESH::Entity_Last; i++)
index 53d0a4893b7d692c5a0a47b3ca352d46be93905f..fb62b1983a0c3bfdccd4e36528f029063fa7b66e 100644 (file)
@@ -209,7 +209,7 @@ SMESH::ElementType SMESH_GroupBase_i::GetType()
  */
 //=============================================================================
 
-CORBA::Long  SMESH_GroupBase_i::Size()
+CORBA::smIdType SMESH_GroupBase_i::Size()
 {
   if ( myPreMeshInfo )
     return GetType() == SMESH::NODE ? myPreMeshInfo->NbNodes() : myPreMeshInfo->NbElements();
index ec4d8d12afb5f12305507fdc0270facfb68845ed..e98d9e775ea15d07994a8c8076028f8d1c9b7c28 100644 (file)
@@ -61,7 +61,7 @@ class SMESH_I_EXPORT SMESH_GroupBase_i:
   void SetName(const char* name);
   char* GetName();
   SMESH::ElementType GetType();
-  CORBA::Long Size();
+  SMESH::smIdType Size();
   CORBA::Boolean IsEmpty();
   CORBA::Boolean Contains(SMESH::smIdType elem_id);
   SMESH::smIdType GetID(SMESH::smIdType elem_index);
index 69760aff61fb3083172ead7c31aa365b07674319..c5f05a0891e81019ef96ab66c25af3babf97d06b 100644 (file)
@@ -756,11 +756,11 @@ bool SMESH_MeshEditor_i::IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSourc
 }
 
 SMESH::smIdType* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource,
-                                                  int&                       nbIds)
+                                                      SMESH::smIdType&           nbIds)
 {
   if ( _IDSource* tmpIdSource = SMESH::DownCast<SMESH_MeshEditor_i::_IDSource*>( idSource ))
   {
-    nbIds = (int) tmpIdSource->_ids.length();
+    nbIds = (SMESH::smIdType) tmpIdSource->_ids.length();
     return & tmpIdSource->_ids[0];
   }
   nbIds = 0;
index 4ad5cb8c675c041e427fa8c400b0235e42219c1c..01994937e5ba2fcfbf3301ef36a483d804bc07e3 100644 (file)
@@ -6324,7 +6324,7 @@ SMDS_ElemIteratorPtr SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_ptr theObje
     SMDSAbs_ElementType iterType = isNodes ? SMDSAbs_Node : elemType;
     if ( SMESH_MeshEditor_i::IsTemporaryIDSource( theObject ))
     {
-      int nbIds;
+      SMESH::smIdType nbIds;
       if ( SMESH::smIdType* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds ))
         elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids, nbIds, iterType ));
     }