From e0662f46783c10ba8808ffd72cae7bff7ea786d0 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 9 Feb 2021 14:52:53 +0300 Subject: [PATCH] change header --- idl/SMESH_Gen.idl | 4 +- idl/SMESH_Group.idl | 2 +- src/Controls/SMESH_Controls.cxx | 70 +++++++++++----------- src/Controls/SMESH_ControlsDef.hxx | 46 +++++++------- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 70 +++++++++++----------- src/OBJECT/SMESH_ActorUtils.cxx | 12 ++-- src/OBJECT/SMESH_ActorUtils.h | 2 +- src/OBJECT/SMESH_Object.cxx | 2 +- src/OBJECT/SMESH_Object.h | 20 +++---- src/OBJECT/SMESH_ObjectDef.h | 40 ++++++------- src/SMDS/SMDS_ElementFactory.cxx | 13 ++-- src/SMDS/SMDS_ElementFactory.hxx | 2 +- src/SMDS/SMDS_Mesh.cxx | 8 +-- src/SMDS/SMDS_MeshGroup.hxx | 2 +- src/SMDS/SMDS_UnstructuredGrid.cxx | 12 ++-- src/SMESH/SMESH_Algo.hxx | 4 +- src/SMESHDS/SMESHDS_Group.hxx | 8 +-- src/SMESHDS/SMESHDS_GroupBase.cxx | 4 +- src/SMESHDS/SMESHDS_GroupBase.hxx | 12 ++-- src/SMESHDS/SMESHDS_GroupOnFilter.cxx | 6 +- src/SMESHDS/SMESHDS_GroupOnFilter.hxx | 8 +-- src/SMESHDS/SMESHDS_GroupOnGeom.hxx | 2 +- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 4 +- src/SMESHUtils/SMESH_MeshAlgos.cxx | 11 +++- src/SMESHUtils/SMESH_Offset.cxx | 6 +- src/SMESHUtils/SMESH_Slot.cxx | 12 ++-- src/SMESH_I/SMESH_Gen_i.cxx | 7 +-- src/SMESH_I/SMESH_Group_i.cxx | 2 +- src/SMESH_I/SMESH_Group_i.hxx | 2 +- src/SMESH_I/SMESH_MeshEditor_i.cxx | 4 +- src/SMESH_I/SMESH_Mesh_i.cxx | 2 +- 31 files changed, 204 insertions(+), 195 deletions(-) diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index dd25f1d47..4e71c25d5 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -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 ); /*! diff --git a/idl/SMESH_Group.idl b/idl/SMESH_Group.idl index 0364463af..9c704d70a 100644 --- a/idl/SMESH_Group.idl +++ b/idl/SMESH_Group.idl @@ -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 diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 077adc271..4f7b07693 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -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& nbEvents, - std::vector& funValues, - const std::vector& elements, - const double* minmax, - const bool isLogarithmic) +void NumericalFunctor::GetHistogram(int nbIntervals, + std::vector& nbEvents, + std::vector& funValues, + const std::vector& elements, + const double* minmax, + const bool isLogarithmic) { if ( nbIntervals < 1 || !myMesh || @@ -346,7 +346,7 @@ void NumericalFunctor::GetHistogram(int nbIntervals, } else { - std::vector::const_iterator id = elements.begin(); + std::vector::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((*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(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(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(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(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(f), &normOK ); if (!normOK || isLessAngle( myNorm, norm, cosTol)) { - myCoplanarIDs.Add( FromIdType(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(aFacePtr->GetID()) ) ) + if ( aMapOfTreated.Contains( aFacePtr->GetID()) ) continue; - aMapOfTreated.Add( FromIdType(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(theStartFace->GetID()) ); + myMapBadGeomIds.Add( theStartFace->GetID() ); return false; } ManifoldPart::TMapOfLink aMapOfBoundary, aMapToSkip; ManifoldPart::TVectorOfLink aSeqOfBoundary; - theResFaces.Add( FromIdType(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(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(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(myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ))); + int nbElems = FromIdType( 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(theElemPtr->GetID()) ); + myIds.Add( heElemPtr->GetID() ); } bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode ) diff --git a/src/Controls/SMESH_ControlsDef.hxx b/src/Controls/SMESH_ControlsDef.hxx index 7d25f1dca..c08f75242 100644 --- a/src/Controls/SMESH_ControlsDef.hxx +++ b/src/Controls/SMESH_ControlsDef.hxx @@ -32,8 +32,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -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& nbEvents, - std::vector& funValues, - const std::vector& elements, - const double* minmax=0, - const bool isLogarithmic = false); + void GetHistogram(int nbIntervals, + std::vector& nbEvents, + std::vector& funValues, + const std::vector& 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 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 CoplanarFacesPtr; @@ -1176,14 +1178,14 @@ namespace SMESH{ //const std::set& GetDomainIDs() const { return myOkIDs; } private: - int myNodeID; + smIdType myNodeID; std::vector myXYZ; SMDSAbs_ElementType myType; TMeshModifTracer myMeshModifTracer; void clearOkIDs(); bool myOkIDsReady; - std::set< int > myOkIDs; // empty means that there is one domain + std::set myOkIDs; // empty means that there is one domain }; typedef boost::shared_ptr ConnectedElementsPtr; diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index 704cfdb6c..355207436 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -539,7 +539,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() const EBooleen theIsElemNames = eFAUX; const EConnectivite theConnMode = eNOD; - TInt aNbNodes = FromIdType(myMesh->NbNodes()); + TInt aNbNodes = FromIdType( 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(nbElemInfo.NbBalls()), + FromIdType(nbElemInfo.NbBalls()), SMDSAbs_Ball)); #ifdef _ELEMENTS_BY_DIM_ anEntity = eARETE; #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eSEG2, - FromIdType(nbElemInfo.NbEdges( ORDER_LINEAR )), + FromIdType(nbElemInfo.NbEdges( ORDER_LINEAR )), SMDSAbs_Edge)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eSEG3, - FromIdType(nbElemInfo.NbEdges( ORDER_QUADRATIC )), + FromIdType(nbElemInfo.NbEdges( ORDER_QUADRATIC )), SMDSAbs_Edge)); #ifdef _ELEMENTS_BY_DIM_ anEntity = eFACE; #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA3, - FromIdType(nbElemInfo.NbTriangles( ORDER_LINEAR )), + FromIdType(nbElemInfo.NbTriangles( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA6, - FromIdType(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) - + FromIdType(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) - nbElemInfo.NbBiQuadTriangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA7, - FromIdType(nbElemInfo.NbBiQuadTriangles()), + FromIdType(nbElemInfo.NbBiQuadTriangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD4, - FromIdType(nbElemInfo.NbQuadrangles( ORDER_LINEAR )), + FromIdType(nbElemInfo.NbQuadrangles( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD8, - FromIdType(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) - + FromIdType(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) - nbElemInfo.NbBiQuadQuadrangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD9, - FromIdType(nbElemInfo.NbBiQuadQuadrangles()), + FromIdType(nbElemInfo.NbBiQuadQuadrangles()), SMDSAbs_Face)); if ( polyTypesSupported ) { aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGONE, - FromIdType(nbElemInfo.NbPolygons( ORDER_LINEAR )), + FromIdType(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(nbElemInfo.NbPolygons( ORDER_LINEAR )), + FromIdType(nbElemInfo.NbPolygons( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGON2, - FromIdType(nbElemInfo.NbPolygons( ORDER_QUADRATIC )), + FromIdType(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(nbElemInfo.NbPolygons( ORDER_QUADRATIC )), + FromIdType(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(nbElemInfo.NbTetras( ORDER_LINEAR )), + FromIdType(nbElemInfo.NbTetras( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTETRA10, - FromIdType(nbElemInfo.NbTetras( ORDER_QUADRATIC )), + FromIdType(nbElemInfo.NbTetras( ORDER_QUADRATIC )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePYRA5, - FromIdType(nbElemInfo.NbPyramids( ORDER_LINEAR )), + FromIdType(nbElemInfo.NbPyramids( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePYRA13, - FromIdType(nbElemInfo.NbPyramids( ORDER_QUADRATIC )), + FromIdType(nbElemInfo.NbPyramids( ORDER_QUADRATIC )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA6, - FromIdType(nbElemInfo.NbPrisms( ORDER_LINEAR )), + FromIdType(nbElemInfo.NbPrisms( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA15, - FromIdType(nbElemInfo.NbQuadPrisms()), + FromIdType(nbElemInfo.NbQuadPrisms()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA18, - FromIdType(nbElemInfo.NbBiQuadPrisms()), + FromIdType(nbElemInfo.NbBiQuadPrisms()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA8, - FromIdType(nbElemInfo.NbHexas( ORDER_LINEAR )), + FromIdType(nbElemInfo.NbHexas( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA20, - FromIdType(nbElemInfo.NbHexas( ORDER_QUADRATIC )- + FromIdType(nbElemInfo.NbHexas( ORDER_QUADRATIC )- nbElemInfo.NbTriQuadHexas()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA27, - FromIdType(nbElemInfo.NbTriQuadHexas()), + FromIdType(nbElemInfo.NbTriQuadHexas()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eOCTA12, - FromIdType(nbElemInfo.NbHexPrisms()), + FromIdType(nbElemInfo.NbHexPrisms()), SMDSAbs_Volume)); if ( polyTypesSupported ) { aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYEDRE, - FromIdType(nbElemInfo.NbPolyhedrons()), + FromIdType(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(nbElemInfo.NbPolyhedrons()), + FromIdType(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(aNode->GetID())]; + aTConnSlice[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; #else aTConnSlice[ iNode ] = aNode->GetID(); #endif } // element number - aPolygoneInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); + aPolygoneInfo->SetElemNum( iElem, FromIdType(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(aNode->GetID())]; + conn[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; #else conn[ iNode ] = aNode->GetID(); #endif ++iNode; } // element number - aPolyhInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); + aPolyhInfo->SetElemNum( iElem, FromIdType(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(aNode->GetID())]; + (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType(aNode->GetID())]; #else (*aBallInfo->myConn)[ iElem ] = aNode->GetID(); #endif // element number - aBallInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); + aBallInfo->SetElemNum( iElem, FromIdType(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(aNode->GetID())]; + aTConnSlice[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; #else aTConnSlice[ iNode ] = aNode->GetID(); #endif } // element number - aCellInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); + aCellInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); // family number int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); diff --git a/src/OBJECT/SMESH_ActorUtils.cxx b/src/OBJECT/SMESH_ActorUtils.cxx index 81f51a986..1d5ab2d86 100644 --- a/src/OBJECT/SMESH_ActorUtils.cxx +++ b/src/OBJECT/SMESH_ActorUtils.cxx @@ -158,16 +158,16 @@ namespace SMESH } std::map GetEntitiesFromObject(SMESH_VisualObj *theObject) { - std::map entities; - entities.insert(std::pair(SMDSAbs_0DElement, + std::map entities; + entities.insert(std::pair(SMDSAbs_0DElement, theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0)); - entities.insert(std::pair(SMDSAbs_Ball, + entities.insert(std::pair(SMDSAbs_Ball, theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0)); - entities.insert(std::pair(SMDSAbs_Edge, + entities.insert(std::pair(SMDSAbs_Edge, theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0)); - entities.insert(std::pair(SMDSAbs_Face, + entities.insert(std::pair(SMDSAbs_Face, theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0)); - entities.insert(std::pair(SMDSAbs_Volume, + entities.insert(std::pair(SMDSAbs_Volume, theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0)); return entities; } diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h index d4d45fa83..90520f295 100644 --- a/src/OBJECT/SMESH_ActorUtils.h +++ b/src/OBJECT/SMESH_ActorUtils.h @@ -84,7 +84,7 @@ SMESHOBJECT_EXPORT QString def); SMESHOBJECT_EXPORT - std::map + std::map GetEntitiesFromObject(SMESH_VisualObj *theObject); SMESHOBJECT_EXPORT diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 72fbe672c..191ff8626 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -557,7 +557,7 @@ void SMESH_VisualObjDef::updateEntitiesFlags() unsigned int tmp = myEntitiesState; ClearEntitiesFlags(); - map entities = SMESH::GetEntitiesFromObject(this); + map entities = SMESH::GetEntitiesFromObject(this); if( myEntitiesCache[SMDSAbs_0DElement] != 0 || diff --git a/src/OBJECT/SMESH_Object.h b/src/OBJECT/SMESH_Object.h index d7c1a3688..2d7af67ec 100644 --- a/src/OBJECT/SMESH_Object.h +++ b/src/OBJECT/SMESH_Object.h @@ -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; diff --git a/src/OBJECT/SMESH_ObjectDef.h b/src/OBJECT/SMESH_ObjectDef.h index de5cee59c..6ad154ad9 100644 --- a/src/OBJECT/SMESH_ObjectDef.h +++ b/src/OBJECT/SMESH_ObjectDef.h @@ -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 myEntitiesCache; + std::map 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: diff --git a/src/SMDS/SMDS_ElementFactory.cxx b/src/SMDS/SMDS_ElementFactory.cxx index 4ac7ca9aa..1501b1eb5 100644 --- a/src/SMDS/SMDS_ElementFactory.cxx +++ b/src/SMDS/SMDS_ElementFactory.cxx @@ -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(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(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(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( this ); - int oldShapeID = me->mySubIDRanges.SetValue( FromIdType(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 )) diff --git a/src/SMDS/SMDS_ElementFactory.hxx b/src/SMDS/SMDS_ElementFactory.hxx index 63288bd6d..165c0af89 100644 --- a/src/SMDS/SMDS_ElementFactory.hxx +++ b/src/SMDS/SMDS_ElementFactory.hxx @@ -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; } diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index f2934ce25..624c4ad24 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -815,9 +815,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector & nodes_ids, const smIdType ID) { - smIdType nbNodes = nodes_ids.size(); + size_t nbNodes = nodes_ids.size(); std::vector 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 & quantities, const smIdType ID) { - smIdType nbNodes = nodes_ids.size(); + size_t nbNodes = nodes_ids.size(); std::vector 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; } diff --git a/src/SMDS/SMDS_MeshGroup.hxx b/src/SMDS/SMDS_MeshGroup.hxx index 39807aab3..2c3660939 100644 --- a/src/SMDS/SMDS_MeshGroup.hxx +++ b/src/SMDS/SMDS_MeshGroup.hxx @@ -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; diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index ca5b300bf..079d15673 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -191,7 +191,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, // Use double type for storing coordinates of nodes instead float. vtkPoints *newPoints = vtkPoints::New(); newPoints->SetDataType( VTK_DOUBLE ); - newPoints->SetNumberOfPoints( FromIdType(newNodeSize) ); + newPoints->SetNumberOfPoints( FromIdType(newNodeSize) ); vtkIdType i = 0, alreadyCopied = 0; while ( i < oldNodeSize ) @@ -298,16 +298,16 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, { smIdType oldCellId = idCellsNewToOld[ newCellID ]; newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 ); - smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType(oldCellId) ); - smIdType nCellFaces = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); - newFaces->InsertNextValue( FromIdType(nCellFaces) ); + smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType(oldCellId) ); + smIdType nCellFaces = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); + newFaces->InsertNextValue( FromIdType(nCellFaces) ); for ( int n = 0; n < nCellFaces; n++ ) { - int nptsInFace = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); + int nptsInFace = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); newFaces->InsertNextValue( nptsInFace ); for ( int k = 0; k < nptsInFace; k++ ) { - vtkIdType oldpt = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); + vtkIdType oldpt = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]); } } diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index 72c17b7f9..b57f52eea 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -60,8 +60,8 @@ class TopoDS_Vertex; class TopoDS_Wire; class gp_XYZ; -typedef std::map< SMESH_subMesh*, std::vector > MapShapeNbElems; -typedef std::map< SMESH_subMesh*, std::vector >::iterator MapShapeNbElemsItr; +typedef std::map< SMESH_subMesh*, std::vector > MapShapeNbElems; +typedef std::map< SMESH_subMesh*, std::vector >::iterator MapShapeNbElemsItr; // ================================================================================== /*! diff --git a/src/SMESHDS/SMESHDS_Group.hxx b/src/SMESHDS/SMESHDS_Group.hxx index c17705ab8..9fa9a7b48 100644 --- a/src/SMESHDS/SMESHDS_Group.hxx +++ b/src/SMESHDS/SMESHDS_Group.hxx @@ -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(); diff --git a/src/SMESHDS/SMESHDS_GroupBase.cxx b/src/SMESHDS/SMESHDS_GroupBase.cxx index e6a9799be..dc83665f5 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.cxx +++ b/src/SMESHDS/SMESHDS_GroupBase.cxx @@ -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(myIterator->next()->GetID()); + myCurID = myIterator->next()->GetID(); } return myCurIndex == theIndex ? myCurID : -1; } diff --git a/src/SMESHDS/SMESHDS_GroupBase.hxx b/src/SMESHDS/SMESHDS_GroupBase.hxx index f08b8a289..c57fc95fb 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.hxx +++ b/src/SMESHDS/SMESHDS_GroupBase.hxx @@ -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; diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx index e11f228c0..04ae87d0b 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx @@ -315,7 +315,7 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const if ( IsUpToDate() ) { for ( ; elIt->more(); curID += idSize ) - (*(int*) curID) = FromIdType(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(firstOkElem->GetID()); + (*(smidtype*) curID) = firstOkElem->GetID(); for ( curID += idSize; elIt->more(); curID += idSize ) { const SMDS_MeshElement* e = elIt->next(); - (*(int*) curID) = FromIdType(e->GetID()); + (*(smIdtype*) curID) = e->GetID(); me->myMeshInfo[ e->GetEntityType() ]++; } } diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.hxx b/src/SMESHDS/SMESHDS_GroupOnFilter.hxx index 9b729bebd..cc9fd2ea9 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.hxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.hxx @@ -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 diff --git a/src/SMESHDS/SMESHDS_GroupOnGeom.hxx b/src/SMESHDS/SMESHDS_GroupOnGeom.hxx index 3ea23e1e7..e81e8d617 100644 --- a/src/SMESHDS/SMESHDS_GroupOnGeom.hxx +++ b/src/SMESHDS/SMESHDS_GroupOnGeom.hxx @@ -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); diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 6844cdea9..f84027be1 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -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; diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index c5bed4dad..b25a81e29 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -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(theMesh->NbFaces()) ); + TLinkSharpMap linkIsSharp; + Standard_Integer nbBuckets = FromIdType( 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(theMesh->NbFaces()) ); + TFacesByLinks facesByLink; + Standard_Integer nbBuckets = FromIdType( theMesh->NbFaces() ); + if ( nbBuckets > 0 ) + facesByLink.ReSize( nbBuckets ); std::vector< const SMDS_MeshNode* > faceNodes; for ( SMDS_FaceIteratorPtr faceIt = theMesh->facesIterator(); faceIt->more(); ) diff --git a/src/SMESHUtils/SMESH_Offset.cxx b/src/SMESHUtils/SMESH_Offset.cxx index 914c68241..cd886ee58 100644 --- a/src/SMESHUtils/SMESH_Offset.cxx +++ b/src/SMESHUtils/SMESH_Offset.cxx @@ -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(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(newFace->GetID()); + const smIdType faceIndex = newFace->GetID(); const gp_XYZ& oldNorm = normals[ faceIndex ]; if ( !SMESH_MeshAlgos::FaceNormal( newFace, faceNorm, /*normalize=*/false ) || //faceNorm * moveVec < 0 ) diff --git a/src/SMESHUtils/SMESH_Slot.cxx b/src/SMESHUtils/SMESH_Slot.cxx index 910ef74f0..7f5aff200 100644 --- a/src/SMESHUtils/SMESH_Slot.cxx +++ b/src/SMESHUtils/SMESH_Slot.cxx @@ -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(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); diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 87111f7aa..4a9796ea3 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -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++) diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index 53d0a4893..fb62b1983 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -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(); diff --git a/src/SMESH_I/SMESH_Group_i.hxx b/src/SMESH_I/SMESH_Group_i.hxx index ec4d8d12a..e98d9e775 100644 --- a/src/SMESH_I/SMESH_Group_i.hxx +++ b/src/SMESH_I/SMESH_Group_i.hxx @@ -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); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 69760aff6..c5f05a089 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -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( idSource )) { - nbIds = (int) tmpIdSource->_ids.length(); + nbIds = (SMESH::smIdType) tmpIdSource->_ids.length(); return & tmpIdSource->_ids[0]; } nbIds = 0; diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 4ad5cb8c6..01994937e 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -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 )); } -- 2.39.2