From: Viktor UZLOV Date: Wed, 10 Feb 2021 13:59:04 +0000 (+0300) Subject: fix after review. Build completed X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a9c899c3a08a670164718b8d5ab2d61e036872fd;p=modules%2Fsmesh.git fix after review. Build completed --- diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 4f7b07693..5823bbe87 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -2092,7 +2092,7 @@ double MultiConnection2D::GetValue( long theElementId ) if (!anIter) break; const SMDS_MeshNode *aNode, *aNode0 = 0; - NCollection_Map< smIdType > aMap, aMapPrev; + NCollection_Map< smIdType, smIdHasher > aMap, aMapPrev; for (i = 0; i <= len; i++) { aMapPrev = aMap; @@ -3131,7 +3131,7 @@ bool ConnectedElements::IsSatisfy( long theElementId ) while ( nIt->more() ) { const SMDS_MeshNode* n = static_cast< const SMDS_MeshNode* >( nIt->next() ); - if ( checkedNodeIDs.insert( n->GetID()) ) + if ( checkedNodeIDs.insert( n->GetID()).second ) nodeQueue.push_back( n ); } } @@ -3281,7 +3281,7 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr ) TColStd_SequenceOfInteger anIntSeq; TColStd_SequenceOfAsciiString aStrSeq; - TColStd_MapIteratorOfMapOfInteger anIter( myIds ); + TIDsMap::Iterator anIter( myIds ); for ( ; anIter.More(); anIter.Next() ) { int anId = anIter.Key(); @@ -3290,19 +3290,19 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr ) aStrSeq.Append( aStr ); } - for ( int i = 1, n = myMin.Length(); i <= n; i++ ) + for ( smIdType i = 1, n = myMin.size(); i <= n; i++ ) { - int aMinId = myMin( i ); - int aMaxId = myMax( i ); + smIdType aMinId = myMin[i]; + smIdType aMaxId = myMax[i]; TCollection_AsciiString aStr; if ( aMinId != IntegerFirst() ) - aStr += aMinId; + aStr += FromIdType(aMinId); aStr += "-"; if ( aMaxId != IntegerLast() ) - aStr += aMaxId; + aStr += FromIdType(aMaxId); // find position of the string in result sequence and insert string in it if ( anIntSeq.Length() == 0 ) @@ -3351,8 +3351,8 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr ) //======================================================================= bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr ) { - myMin.Clear(); - myMax.Clear(); + myMin.clear(); + myMax.clear(); myIds.Clear(); TCollection_AsciiString aStr = theStr; @@ -3390,8 +3390,8 @@ bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr ) (!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue()) ) return false; - myMin.Append( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() ); - myMax.Append( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() ); + myMin.push_back( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() ); + myMax.push_back( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() ); } } @@ -3440,8 +3440,8 @@ bool RangeOfIds::IsSatisfy( long theId ) if ( myIds.Contains( theId ) ) return true; - for ( int i = 1, n = myMin.Length(); i <= n; i++ ) - if ( theId >= myMin( i ) && theId <= myMax( i ) ) + for ( int i = 1, n = myMin.size(); i <= n; i++ ) + if ( theId >= myMin[i] && theId <= myMax[i] ) return true; return false; @@ -4199,7 +4199,7 @@ void ElementsOnSurface::process( const SMDS_MeshElement* theElemPtr ) } } if ( isSatisfy ) - myIds.Add( heElemPtr->GetID() ); + myIds.Add( theElemPtr->GetID() ); } bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode ) diff --git a/src/Controls/SMESH_ControlsDef.hxx b/src/Controls/SMESH_ControlsDef.hxx index c08f75242..596d0450e 100644 --- a/src/Controls/SMESH_ControlsDef.hxx +++ b/src/Controls/SMESH_ControlsDef.hxx @@ -58,7 +58,7 @@ class ShapeAnalysis_Surface; class gp_Pln; class gp_Pnt; -typedef NCollection_Map< smIdType > TIDsMap; +typedef NCollection_Map< smIdType, smIdHasher > TIDsMap; namespace SMESH{ namespace Controls{ diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 1cc7927bf..626ef8d42 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -2495,7 +2495,7 @@ void SMESH_ActorDef::UpdateDistribution() SMESH_VisualObjDef::TEntityList elems; if ( dynamic_cast(myVisualObj.get())) dynamic_cast(myVisualObj.get())->GetEntities( fun->GetType(), elems ); - std::vector elemIds; elemIds.reserve( elems.size() ); + std::vector elemIds; elemIds.reserve( elems.size() ); for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e) elemIds.push_back( (*e)->GetID()); vtkLookupTable* lookupTable = static_cast(myScalarBarActor->GetLookupTable()); @@ -2681,7 +2681,7 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() SMESH_VisualObjDef::TEntityList elems; if ( dynamic_cast(myVisualObj.get())) dynamic_cast(myVisualObj.get())->GetEntities( fun->GetType(), elems ); - std::vector elemIds; + std::vector elemIds; for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e) elemIds.push_back( (*e)->GetID()); diff --git a/src/OBJECT/SMESH_ActorUtils.cxx b/src/OBJECT/SMESH_ActorUtils.cxx index 1d5ab2d86..43c16d5af 100644 --- a/src/OBJECT/SMESH_ActorUtils.cxx +++ b/src/OBJECT/SMESH_ActorUtils.cxx @@ -157,7 +157,7 @@ namespace SMESH } } - std::map GetEntitiesFromObject(SMESH_VisualObj *theObject) { + std::map GetEntitiesFromObject(SMESH_VisualObj *theObject) { std::map entities; entities.insert(std::pair(SMDSAbs_0DElement, theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0)); diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 191ff8626..44ce2472b 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -491,10 +491,10 @@ void SMESH_VisualObjDef::buildElemPrs() // function : GetEdgeNodes // purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 0 ) //================================================================================= -bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const +bool SMESH_VisualObjDef::GetEdgeNodes( const smIdType theElemId, + const int theEdgeNum, + smIdType& theNodeId1, + smIdType& theNodeId2 ) const { const SMDS_Mesh* aMesh = GetMesh(); if ( aMesh == 0 ) @@ -681,7 +681,7 @@ bool SMESH_MeshObj::NulData() // function : GetElemDimension // purpose : Get dimension of element //================================================================================= -int SMESH_MeshObj::GetElemDimension( const int theObjId ) +int SMESH_MeshObj::GetElemDimension( const smIdType theObjId ) { const SMDS_MeshElement* anElem = myClient->FindElement( theObjId ); if ( anElem == 0 ) @@ -703,7 +703,7 @@ int SMESH_MeshObj::GetElemDimension( const int theObjId ) // function : GetEntities // purpose : Get entities of specified type. Return number of entities //================================================================================= -int SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const +smIdType SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const { switch ( theType ) { @@ -742,7 +742,7 @@ int SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const } } -int SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const +smIdType SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const { theObjs.clear(); @@ -834,7 +834,7 @@ SMESH_SubMeshObj::~SMESH_SubMeshObj() // function : GetElemDimension // purpose : Get dimension of element //================================================================================= -int SMESH_SubMeshObj::GetElemDimension( const int theObjId ) +int SMESH_SubMeshObj::GetElemDimension( const smIdType theObjId ) { return myMeshObj == 0 ? 0 : myMeshObj->GetElemDimension( theObjId ); } @@ -962,7 +962,7 @@ static int getPointers( const SMDSAbs_ElementType theRequestType, // function : GetEntities // purpose : Get entities of specified type. Return number of entities //================================================================================= -int SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const +smIdType SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const { if(SMDSAbs_ElementType(myGroupServer->GetType()) == theType) { return myGroupServer->Size(); @@ -973,7 +973,7 @@ int SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const return 0; } -int SMESH_GroupObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const +smIdType SMESH_GroupObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const { theResList.clear(); SMDS_Mesh* aMesh = myMeshObj->GetMesh(); @@ -1028,7 +1028,7 @@ SMESH_subMeshObj::~SMESH_subMeshObj() // function : GetEntities // purpose : Get entities of specified type. Return number of entities //================================================================================= -int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const +smIdType SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const { switch ( theType ) { @@ -1053,7 +1053,7 @@ int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const } } -int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const +smIdType SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const { theResList.clear(); diff --git a/src/OBJECT/SMESH_Object.h b/src/OBJECT/SMESH_Object.h index 2d7af67ec..7fd4d1450 100644 --- a/src/OBJECT/SMESH_Object.h +++ b/src/OBJECT/SMESH_Object.h @@ -45,6 +45,7 @@ #include "SMDSAbs_ElementType.hxx" #include +#include #include CORBA_SERVER_HEADER(SMESH_Mesh) class SMDS_Mesh; diff --git a/src/OBJECT/SMESH_ObjectDef.h b/src/OBJECT/SMESH_ObjectDef.h index 6ad154ad9..678a34fa5 100644 --- a/src/OBJECT/SMESH_ObjectDef.h +++ b/src/OBJECT/SMESH_ObjectDef.h @@ -160,7 +160,7 @@ public: virtual bool Update( int theIsClear = true ); virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ); - virtual int GetElemDimension( const smidtype 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 smidtype GetNbEntities( const SMDSAbs_ElementType) const; - virtual smidtype 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 smIdtype GetNbEntities( const SMDSAbs_ElementType) const; - virtual smIdtype 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/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index eed10525b..03ad4d5fc 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1917,7 +1917,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) bool ret = true; if (_subShape.ShapeType() == TopAbs_VERTEX) { - vector aVec(SMDSEntity_Last,0); + vector aVec(SMDSEntity_Last,0); aVec[SMDSEntity_Node] = 1; aResMap.insert(make_pair(this,aVec)); return ret; @@ -1944,7 +1944,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) SMESH_subMesh* sm = smIt->next(); int dim = SMESH_Gen::GetShapeDim( sm->GetSubShape() ); if (dim < dimToCheck) break; // the rest subMeshes are all of less dimension - const vector & nbs = aResMap[ sm ]; + const vector & nbs = aResMap[ sm ]; subMeshEvaluated = (std::accumulate( nbs.begin(), nbs.end(), 0 ) > 0 ); } if ( !subMeshEvaluated ) @@ -1954,7 +1954,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) if ( IsMeshComputed() ) { - vector & nbEntities = aResMap[ this ]; + vector & nbEntities = aResMap[ this ]; nbEntities.resize( SMDSEntity_Last, 0 ); if ( SMESHDS_SubMesh* sm = GetSubMeshDS() ) { @@ -1968,7 +1968,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) { ret = algo->Evaluate((*_father), _subShape, aResMap); } - aResMap.insert( make_pair( this,vector(0))); + aResMap.insert( make_pair( this,vector(0))); } return ret; diff --git a/src/SMESHDS/SMESHDS_Group.cxx b/src/SMESHDS/SMESHDS_Group.cxx index 4554e5adc..6783d14bd 100644 --- a/src/SMESHDS/SMESHDS_Group.cxx +++ b/src/SMESHDS/SMESHDS_Group.cxx @@ -45,7 +45,7 @@ SMESHDS_Group::SMESHDS_Group (const int theID, //purpose : //======================================================================= -int SMESHDS_Group::Extent() const +smIdType SMESHDS_Group::Extent() const { return myGroup.Extent(); } @@ -66,7 +66,7 @@ bool SMESHDS_Group::IsEmpty() */ //============================================================================= -bool SMESHDS_Group::Contains (const int theID) +bool SMESHDS_Group::Contains (const smIdType theID) { const SMDS_MeshElement* aElem = findInMesh (theID); if (aElem) @@ -92,7 +92,7 @@ bool SMESHDS_Group::Contains (const SMDS_MeshElement* elem) */ //============================================================================= -bool SMESHDS_Group::Add (const int theID) +bool SMESHDS_Group::Add (const smIdType theID) { return Add( findInMesh( theID )); } @@ -121,7 +121,7 @@ bool SMESHDS_Group::Add (const SMDS_MeshElement* aElem ) */ //============================================================================= -bool SMESHDS_Group::Remove (const int theID) +bool SMESHDS_Group::Remove (const smIdType theID) { bool removed = false; if ( const SMDS_MeshElement* aElem = findInMesh( theID )) diff --git a/src/SMESHDS/SMESHDS_GroupBase.cxx b/src/SMESHDS/SMESHDS_GroupBase.cxx index dc83665f5..f2245d40a 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.cxx +++ b/src/SMESHDS/SMESHDS_GroupBase.cxx @@ -75,7 +75,7 @@ smIdType SMESHDS_GroupBase::GetID (const int theIndex) */ //============================================================================= -const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const int theID) const +const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const smIdType theID) const { SMDSAbs_ElementType aType = GetType(); const SMDS_MeshElement* aElem = NULL; @@ -107,10 +107,10 @@ void SMESHDS_GroupBase::resetIterator() //purpose : //======================================================================= -int SMESHDS_GroupBase::Extent() const +smIdType SMESHDS_GroupBase::Extent() const { SMDS_ElemIteratorPtr it = GetElements(); - int nb = 0; + smIdType nb = 0; if ( it ) for ( ; it->more(); it->next() ) nb++; @@ -136,7 +136,7 @@ bool SMESHDS_GroupBase::IsEmpty() //purpose : //======================================================================= -bool SMESHDS_GroupBase::Contains (const int theID) +bool SMESHDS_GroupBase::Contains (const smIdType theID) { if ( SMDS_ElemIteratorPtr it = GetElements() ) { while ( it->more() ) diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx index 04ae87d0b..1343f8864 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx @@ -79,7 +79,7 @@ void SMESHDS_GroupOnFilter::SetPredicate( const SMESH_PredicatePtr& thePredicate */ //================================================================================ -int SMESHDS_GroupOnFilter::Extent() const +smIdType SMESHDS_GroupOnFilter::Extent() const { update(); return std::accumulate( myMeshInfo.begin(), myMeshInfo.end(), 0 ); @@ -120,7 +120,7 @@ bool SMESHDS_GroupOnFilter::IsEmpty() */ //================================================================================ -bool SMESHDS_GroupOnFilter::Contains (const int theID) +bool SMESHDS_GroupOnFilter::Contains (const smIdType theID) { return myPredicate && myPredicate->IsSatisfy( theID ); } @@ -288,7 +288,7 @@ SMDS_ElemIteratorPtr SMESHDS_GroupOnFilter::GetElements() const */ //================================================================================ -std::vector< int > SMESHDS_GroupOnFilter::GetMeshInfo() const +std::vector< smIdType > SMESHDS_GroupOnFilter::GetMeshInfo() const { update(); return myMeshInfo; @@ -325,11 +325,11 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const me->myMeshInfo.assign( SMDSEntity_Last, 0 ); me->myMeshInfo[ firstOkElem->GetEntityType() ]++; - (*(smidtype*) curID) = firstOkElem->GetID(); + (*(smIdType*) curID) = firstOkElem->GetID(); for ( curID += idSize; elIt->more(); curID += idSize ) { const SMDS_MeshElement* e = elIt->next(); - (*(smIdtype*) curID) = 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 cc9fd2ea9..887a0c1cf 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.hxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.hxx @@ -47,7 +47,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme SMESH_PredicatePtr GetPredicate() const { return myPredicate; } - std::vector< int > GetMeshInfo() const; + std::vector< smIdType > GetMeshInfo() const; template< typename IDTYPE > smIdType GetElementIds( IDTYPE* ids ) const diff --git a/src/SMESHDS/SMESHDS_GroupOnGeom.cxx b/src/SMESHDS/SMESHDS_GroupOnGeom.cxx index 8107798c1..3e3d15fab 100644 --- a/src/SMESHDS/SMESHDS_GroupOnGeom.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnGeom.cxx @@ -132,7 +132,7 @@ SMDS_ElemIteratorPtr SMESHDS_GroupOnGeom::GetElements() const //purpose : //======================================================================= -bool SMESHDS_GroupOnGeom::Contains (const int theID) +bool SMESHDS_GroupOnGeom::Contains (const smIdType theID) { return mySubMesh->Contains( findInMesh( theID )); } diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index f34b206e0..984c4a1c5 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -1216,7 +1216,7 @@ namespace SMESH::Controls::NumericalFunctor* aNumFun = dynamic_cast( aFunctor.get() ); if ( aNumFun ) { - std::vector elements; + std::vector elements; SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface(anIO); if ( mesh->_is_nil() ) { SMESH::SMESH_IDSource_var idSource = diff --git a/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx b/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx index 6f329dd13..6fc23c57d 100644 --- a/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx +++ b/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx @@ -45,7 +45,7 @@ void SMESHGUI_PreVisualObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& th if ( theFunctor ) theFunctor->SetMesh( GetMesh() ); } -int SMESHGUI_PreVisualObj::GetElemDimension( const int theObjId ) +int SMESHGUI_PreVisualObj::GetElemDimension( const smIdType theObjId ) { if ( const SMDS_MeshElement* anElem = myMesh->FindElement( theObjId )) { @@ -62,7 +62,7 @@ int SMESHGUI_PreVisualObj::GetElemDimension( const int theObjId ) return -1; } -int SMESHGUI_PreVisualObj::GetNbEntities( const SMDSAbs_ElementType theType ) const +smIdType SMESHGUI_PreVisualObj::GetNbEntities( const SMDSAbs_ElementType theType ) const { return myMesh->GetMeshInfo().NbElements( theType ); } @@ -77,10 +77,10 @@ SMESH::SMESH_Mesh_ptr SMESHGUI_PreVisualObj::GetMeshServer() // purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 1 ) //================================================================================= -bool SMESHGUI_PreVisualObj::GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const +bool SMESHGUI_PreVisualObj::GetEdgeNodes( const smIdType theElemId, + const int theEdgeNum, + smIdType& theNodeId1, + smIdType& theNodeId2 ) const { const SMDS_MeshElement* e = myMesh->FindElement( theElemId ); if ( !e || e->GetType() != SMDSAbs_Face ) diff --git a/src/SMESHGUI/SMESHGUI_PreVisualObj.h b/src/SMESHGUI/SMESHGUI_PreVisualObj.h index 9cd8e4ef5..f103c5809 100644 --- a/src/SMESHGUI/SMESHGUI_PreVisualObj.h +++ b/src/SMESHGUI/SMESHGUI_PreVisualObj.h @@ -51,13 +51,13 @@ class SMESHGUI_EXPORT SMESHGUI_PreVisualObj : public SMESH_VisualObj virtual bool Update( int theIsClear ); virtual bool NulData() { return false; } virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ); - virtual int GetElemDimension( const int theObjId ); - virtual int GetNbEntities( const SMDSAbs_ElementType theType) const; + virtual int GetElemDimension( const smIdType theObjId ); + virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const; 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 vtkIdType GetNodeObjId( int theVTKID ); virtual vtkIdType GetNodeVTKId( int theObjID ); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 39966b6d6..a6bfbd353 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -1226,8 +1226,8 @@ namespace SMESH int GetEdgeNodes(SVTK_Selector* theSelector, const TVisualObjPtr& theVisualObject, - int& theId1, - int& theId2) + smIdType& theId1, + smIdType& theId2) { const SALOME_ListIO& selected = theSelector->StoredIObjects(); @@ -1243,9 +1243,9 @@ namespace SMESH if ( aMapIndex.Extent() != 2 ) return -1; - int anObjId = -1, anEdgeNum = -1; - for ( int i = 1; i <= aMapIndex.Extent(); i++ ) { - int aVal = aMapIndex( i ); + smIdType anObjId = -1, anEdgeNum = -1; + for ( smIdType i = 1; i <= aMapIndex.Extent(); i++ ) { + smIdType aVal = aMapIndex( i ); if ( aVal > 0 ) anObjId = aVal; else @@ -1343,7 +1343,7 @@ namespace SMESH } - int GetEdgeNodes( LightApp_SelectionMgr* theMgr, int& theId1, int& theId2 ) + int GetEdgeNodes( LightApp_SelectionMgr* theMgr, smIdType& theId1, smIdType& theId2 ) { SALOME_ListIO selected; theMgr->selectedObjects( selected ); @@ -1363,9 +1363,9 @@ namespace SMESH if ( aMapIndex.Extent() != 2 ) return -1; - int anObjId = -1, anEdgeNum = -1; - for ( int i = 1; i <= aMapIndex.Extent(); i++ ) { - int aVal = aMapIndex( i ); + smIdType anObjId = -1, anEdgeNum = -1; + for ( smIdType i = 1; i <= aMapIndex.Extent(); i++ ) { + smIdType aVal = aMapIndex( i ); if ( aVal > 0 ) anObjId = aVal; else diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.h b/src/SMESHGUI/SMESHGUI_VTKUtils.h index 756f6b7c9..76a68149b 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.h +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.h @@ -169,7 +169,7 @@ SMESHGUI_EXPORT const Handle(SALOME_InteractiveObject)&, QString& ); SMESHGUI_EXPORT - int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& ); + int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, smIdType&, smIdType& ); //---------------------------------------------------------------------------- SMESHGUI_EXPORT @@ -189,7 +189,7 @@ SMESHGUI_EXPORT const bool = true ); SMESHGUI_EXPORT - int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& ); + int GetEdgeNodes( LightApp_SelectionMgr*, smIdType&, smIdType& ); SMESHGUI_EXPORT void SetControlsPrecision( const long ); diff --git a/src/SMESHUtils/SMESH_Slot.cxx b/src/SMESHUtils/SMESH_Slot.cxx index 7f5aff200..1b6e5d246 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< smIdType, TGroupVec > & theFaceID2Groups, - TGroupVec & theWorkGroups ) + void findGroups( const SMDS_MeshElement * theFace, + TGroupVec & theGroupsToUpdate, + NCollection_DataMap< smIdType, TGroupVec, smIdHasher > & theFaceID2Groups, + TGroupVec & theWorkGroups ) { theWorkGroups.clear(); for ( size_t i = 0; i < theGroupsToUpdate.size(); ++i ) @@ -583,7 +583,7 @@ SMESH_MeshAlgos::MakeSlot( SMDS_ElemIteratorPtr theSegmentIt, std::vector< SMESH_NodeXYZ > facePoints(4); std::vector< Intersector::TFace > cutFacePoints; - NCollection_DataMap< smIdType, TGroupVec > faceID2Groups; + NCollection_DataMap< smIdType, TGroupVec, smIdHasher > faceID2Groups; TGroupVec groupVec; std::vector< gp_Ax1 > planeNormalVec(2); diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index e6afef511..05e73a160 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -228,7 +228,7 @@ SMESH::Histogram* NumericalFunctor_i::GetHistogram(CORBA::Short nbIntervals, COR { std::vector nbEvents; std::vector funValues; - std::vector elements; + std::vector elements; myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues,elements,0,isLogarithmic); SMESH::Histogram_var histogram = new SMESH::Histogram; @@ -255,9 +255,9 @@ SMESH::Histogram* NumericalFunctor_i::GetLocalHistogram(CORBA::Short { SMESH::Histogram_var histogram = new SMESH::Histogram; - std::vector nbEvents; - std::vector funValues; - std::vector elements; + std::vector nbEvents; + std::vector funValues; + std::vector elements; SMDS_ElemIteratorPtr elemIt; if ( SMESH::DownCast< SMESH_GroupOnFilter_i* >( object ) || diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 4a9796ea3..03a2bcfdf 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2372,7 +2372,7 @@ SMESH::smIdType_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, /*CORBA::Boolean ret =*/ myGen.Evaluate( myLocMesh, myLocShape, aResMap); MapShapeNbElemsItr anIt = aResMap.begin(); for(; anIt!=aResMap.end(); anIt++) { - const vector& aVec = (*anIt).second; + const vector& aVec = (*anIt).second; for ( i = SMESH::Entity_Node; i < (int)aVec.size(); i++ ) { int nbElem = aVec[i]; if ( nbElem < 0 ) // algo failed, check that it has reported a message diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 6b9929808..e35d50d99 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -286,7 +286,7 @@ public: * returns statistic of mesh elements * Result array of number enityties */ - SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh, + SMESH::smIdType_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShapeObject); // Returns true if mesh contains enough data to be computed diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index fb62b1983..23d585a21 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::smIdType SMESH_GroupBase_i::Size() +SMESH::smIdType SMESH_GroupBase_i::Size() { if ( myPreMeshInfo ) return GetType() == SMESH::NODE ? myPreMeshInfo->NbNodes() : myPreMeshInfo->NbElements(); @@ -361,7 +361,7 @@ SMESH::smIdType SMESH_Group_i::Remove( const SMESH::smIdType_array& theIDs ) */ //============================================================================= -typedef bool (SMESHDS_Group::*TFunChangeGroup)(const int); +typedef bool (SMESHDS_Group::*TFunChangeGroup)(const smIdType); CORBA::Long ChangeByPredicate( SMESH::Predicate_i* thePredicate, @@ -938,7 +938,7 @@ SMESH::smIdType_array* SMESH_GroupOnFilter_i::GetMeshInfo() if ( g->GetType() != SMDSAbs_Node ) { - std::vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo(); + std::vector< SMESH::smIdType > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo(); for ( size_t i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) if ( i < nbElems.size() ) aRes[i] = nbElems[ i ]; diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index df7593af9..b96233569 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -93,7 +93,7 @@ public: SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::smIdType_array& IDsOfElements, SMESH::ElementType type); static bool IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSource ); - static SMESH::smIdType* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, int& nbIds ); + static SMESH::smIdType* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, smIdType& nbIds ); /*! * \brief Generates the unique group name diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index 0324fc92a..ee78f4ac6 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -1121,32 +1121,32 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh& theMesh, lessComplexSide = & *face; // Get an 1D size of lessComplexSide - int nbSeg1 = 0; + smIdType nbSeg1 = 0; vector edges; if ( !lessComplexSide->GetHoriEdges(edges) ) return false; for ( size_t i = 0; i < edges.size(); ++i ) { - const vector& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )]; + const vector& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )]; if ( !nbElems.empty() ) - nbSeg1 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]); + nbSeg1 += std::max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]); } // Get an 1D size of a box side orthogonal to lessComplexSide - int nbSeg2 = 0; + smIdType nbSeg2 = 0; _QuadFaceGrid* ortoSide = lessComplexSide->FindAdjacentForSide( Q_LEFT, boxFaceContainer, B_UNDEFINED ); edges.clear(); if ( !ortoSide || !ortoSide->GetHoriEdges(edges) ) return false; for ( size_t i = 0; i < edges.size(); ++i ) { - const vector& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )]; + const vector& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )]; if ( !nbElems.empty() ) - nbSeg2 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]); + nbSeg2 += std::max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]); } // Get an 2D size of a box side orthogonal to lessComplexSide - int nbFaces = 0, nbQuadFace = 0; + smIdType nbFaces = 0, nbQuadFace = 0; list< TopoDS_Face > sideFaces; if ( ortoSide->IsComplex() ) for ( _QuadFaceGrid::TChildIterator child = ortoSide->GetChildren(); child.more(); ) @@ -1157,7 +1157,7 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh& theMesh, list< TopoDS_Face >::iterator f = sideFaces.begin(); for ( ; f != sideFaces.end(); ++f ) { - const vector& nbElems = aResMap[ theMesh.GetSubMesh( *f )]; + const vector& nbElems = aResMap[ theMesh.GetSubMesh( *f )]; if ( !nbElems.empty() ) { nbFaces = nbElems[ SMDSEntity_Quadrangle ]; @@ -1166,8 +1166,8 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh& theMesh, } // Fill nb of elements - vector aResVec(SMDSEntity_Last,0); - int nbSeg3 = ( nbFaces + nbQuadFace ) / nbSeg2; + vector aResVec(SMDSEntity_Last,0); + smIdType nbSeg3 = ( nbFaces + nbQuadFace ) / nbSeg2; aResVec[SMDSEntity_Node] = (nbSeg1-1) * (nbSeg2-1) * (nbSeg3-1); aResVec[SMDSEntity_Hexa] = nbSeg1 * nbFaces; aResVec[SMDSEntity_Quad_Hexa] = nbSeg1 * nbQuadFace; diff --git a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx index bc1a2c98e..4d8fb02a5 100644 --- a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx +++ b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx @@ -1200,7 +1200,7 @@ bool StdMeshers_HexaFromSkin_3D::Evaluate(SMESH_Mesh & aMesh, bool secondOrder = aMesh.NbFaces( ORDER_QUADRATIC ); int entity = secondOrder ? SMDSEntity_Quad_Hexa : SMDSEntity_Hexa; - vector& nbByType = aResMap[ aMesh.GetSubMesh( aShape )]; + vector& nbByType = aResMap[ aMesh.GetSubMesh( aShape )]; if ( entity >= (int) nbByType.size() ) nbByType.resize( SMDSEntity_Last, 0 ); diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 43e013377..94db1c220 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -988,7 +988,7 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh, TopoDS_Shape aFace = aFaces.Value(i+1); SMESH_Algo *algo = _gen->GetAlgo(aMesh, aFace); if( !algo ) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec = (*anIt).second; - int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + std::vector aVec = (*anIt).second; + smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); if( nbtri == 0 ) isAllQuad = true; } @@ -1022,8 +1022,8 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh, if( sm ) { MapShapeNbElemsItr anIt = aResMap.find(sm); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + std::vector aVec = (*anIt).second; + nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); if(IsFirst) { IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]); IsFirst = false; @@ -1051,16 +1051,16 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh, if( i == OppNum ) continue; MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] ); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } MapShapeNbElemsItr anIt = aResMap.find( meshFaces[0] ); - std::vector aVec = (*anIt).second; - int nb2d_face0 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); - int nb0d_face0 = aVec[SMDSEntity_Node]; + std::vector aVec = (*anIt).second; + smIdType nb2d_face0 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + smIdType nb0d_face0 = aVec[SMDSEntity_Node]; - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec(SMDSEntity_Last,0); + vector aVec(SMDSEntity_Last,0); bool toCopyMesh, toCopyGroups; _sourceHyp->GetCopySourceMesh(toCopyMesh, toCopyGroups); diff --git a/src/StdMeshers/StdMeshers_Import_1D2D.cxx b/src/StdMeshers/StdMeshers_Import_1D2D.cxx index 30f3d163c..4d8849cf3 100644 --- a/src/StdMeshers/StdMeshers_Import_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D2D.cxx @@ -823,7 +823,7 @@ bool StdMeshers_Import_1D2D::Evaluate(SMESH_Mesh & theMesh, if ( srcGroups.empty() ) return error("Invalid source groups"); - vector aVec(SMDSEntity_Last,0); + vector aVec(SMDSEntity_Last,0); bool toCopyMesh, toCopyGroups; _sourceHyp->GetCopySourceMesh(toCopyMesh, toCopyGroups); @@ -913,7 +913,7 @@ bool StdMeshers_Import_1D2D::Evaluate(SMESH_Mesh & theMesh, { TopoDS_Edge geomEdge = TopoDS::Edge( exp.Current() ); SMESH_subMesh* sm = theMesh.GetSubMesh( geomEdge ); - vector& edgeVec = aResMap[sm]; + vector& edgeVec = aResMap[sm]; if ( edgeVec.empty() ) { edgeVec.resize(SMDSEntity_Last,0); diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx index 0e0c0beea..fe2afe3ef 100644 --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx @@ -318,7 +318,7 @@ bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh, TopoDS_Edge E = TopoDS::Edge(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find( aMesh.GetSubMesh(E) ); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; int nbe = Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); NbSeg += nbe; if(IsFirst) { @@ -339,7 +339,7 @@ bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh, } } if(NbSeg<1) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec(SMDSEntity_Last); + std::vector aVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec = (*anIt).second; - int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - int nbqua = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + smIdType nbqua = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); if( nbtri>0 && nbqua==0 ) { NumBase = i; } } if(NumBase==0) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec = (*anIt).second; - nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + std::vector aVec = (*anIt).second; + nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); } } // find face opposite to base face @@ -1923,14 +1923,14 @@ bool StdMeshers_Penta_3D::Evaluate(SMESH_Mesh& aMesh, if( i==OppNum || i==NumBase ) continue; MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] ); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] ); - std::vector aVec = (*anIt).second; - int nb2d_face0 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); - int nb0d_face0 = aVec[SMDSEntity_Node]; + std::vector aVec = (*anIt).second; + smIdType nb2d_face0 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + smIdType nb0d_face0 = aVec[SMDSEntity_Node]; anIt = aResMap.find( meshFaces[OppNum-1] ); for(i=SMDSEntity_Node; i aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; isecond.at( SMDSEntity_Quad_Edge ); } - std::vector aVec( SMDSEntity_Last, 0 ); + std::vector aVec( SMDSEntity_Last, 0 ); switch ( nbLinSegs + nbQuadSegs ) { case 3: aVec[ nbQuadSegs ? SMDSEntity_Quad_Triangle : SMDSEntity_Triangle ] = 1; diff --git a/src/StdMeshers/StdMeshers_PolyhedronPerSolid_3D.cxx b/src/StdMeshers/StdMeshers_PolyhedronPerSolid_3D.cxx index eeb19d48e..02d793cb3 100644 --- a/src/StdMeshers/StdMeshers_PolyhedronPerSolid_3D.cxx +++ b/src/StdMeshers/StdMeshers_PolyhedronPerSolid_3D.cxx @@ -577,7 +577,7 @@ bool StdMeshers_PolyhedronPerSolid_3D::Evaluate(SMESH_Mesh& theMesh, case TopAbs_FACE: { myFaceMesher->Evaluate( theMesh, shape, theResMap ); - std::vector & quantities = theResMap[ sm ]; + std::vector & quantities = theResMap[ sm ]; _quadraticMesh = ( !quantities.empty() && ( quantities[ SMDSEntity_Quad_Triangle ] + quantities[ SMDSEntity_Quad_Quadrangle ] + @@ -587,7 +587,7 @@ bool StdMeshers_PolyhedronPerSolid_3D::Evaluate(SMESH_Mesh& theMesh, case TopAbs_SOLID: { - std::vector & quantities = theResMap[ sm ]; + std::vector & quantities = theResMap[ sm ]; quantities.resize( SMDSEntity_Last, 0 ); SMESH_MesherHelper helper( theMesh ); diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 421710511..5fdd4b326 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -2146,9 +2146,9 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, if( anIt==aResMap.end() ) return toSM( error( "Submesh can not be evaluated")); - std::vector aVec = (*anIt).second; - int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - int nbqua = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + smIdType nbqua = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); if( nbtri==0 && nbqua>0 ) { NbQFs++; } @@ -2158,7 +2158,7 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, } if(NbQFs<4) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i set 1 faces as base // find number of 1d elems for base face - int nb1d = 0; + smIdType nb1d = 0; TopTools_MapOfShape Edges1; for (TopExp_Explorer exp(aFaces.Value(NumBase), TopAbs_EDGE); exp.More(); exp.Next()) { Edges1.Add(exp.Current()); @@ -2176,8 +2176,8 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, if( sm ) { MapShapeNbElemsItr anIt = aResMap.find(sm); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + std::vector aVec = (*anIt).second; + nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); } } // find face opposite to base face @@ -2197,25 +2197,25 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, } } // find number of 2d elems on side faces - int nb2d = 0; + smIdType nb2d = 0; for(i=1; i<=6; i++) { if( i==OppNum || i==NumBase ) continue; MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] ); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] ); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; bool IsQuadratic = (aVec[SMDSEntity_Quad_Triangle]>aVec[SMDSEntity_Triangle]) || (aVec[SMDSEntity_Quad_Quadrangle]>aVec[SMDSEntity_Quadrangle]); - int nb2d_face0_3 = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - int nb2d_face0_4 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); - int nb0d_face0 = aVec[SMDSEntity_Node]; - int nb1d_face0_int = ( nb2d_face0_3*3 + nb2d_face0_4*4 - nb1d ) / 2; + smIdType nb2d_face0_3 = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + smIdType nb2d_face0_4 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + smIdType nb0d_face0 = aVec[SMDSEntity_Node]; + smIdType nb1d_face0_int = ( nb2d_face0_3*3 + nb2d_face0_4*4 - nb1d ) / 2; - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec(SMDSEntity_Last); + std::vector aVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; iGetSubShape().ShapeType(); if ( shapeType == TopAbs_EDGE ) { - std::vector aVec; + std::vector aVec; SMESHDS_SubMesh* srcSubMeshDS = srcSM->GetSubMeshDS(); if ( srcSubMeshDS && srcSubMeshDS->NbElements() ) { diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index 4ef3b3f67..b730fe232 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -1796,7 +1796,7 @@ bool StdMeshers_Projection_2D::Evaluate(SMESH_Mesh& theMesh, // Assure that mesh on a source Face is computed/evaluated // ------------------------------------------------------- - std::vector aVec; + std::vector aVec; SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcFace ); if ( srcSubMesh->IsMeshComputed() ) diff --git a/src/StdMeshers/StdMeshers_Projection_3D.cxx b/src/StdMeshers/StdMeshers_Projection_3D.cxx index 7ba244c2b..a19676529 100644 --- a/src/StdMeshers/StdMeshers_Projection_3D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_3D.cxx @@ -475,7 +475,7 @@ bool StdMeshers_Projection_3D::Evaluate(SMESH_Mesh& aMesh, return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed"); - std::vector aVec(SMDSEntity_Last); + std::vector aVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; iGetSubMeshDS()->NbNodes(); diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index 5f4796266..3909c172b 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -917,7 +917,7 @@ bool StdMeshers_Quadrangle_2D::Evaluate(SMESH_Mesh& aMesh, std::vector aNbNodes(4); bool IsQuadratic = false; if (!checkNbEdgesForEvaluate(aMesh, aFace, aResMap, aNbNodes, IsQuadratic)) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for (int i=SMDSEntity_Node; i aVec(SMDSEntity_Last,0); + std::vector aVec(SMDSEntity_Last,0); if (IsQuadratic) { aVec[SMDSEntity_Quad_Triangle] = nbFaces3; aVec[SMDSEntity_Quad_Quadrangle] = nbFaces4; @@ -1768,7 +1768,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes if (anIt==aResMap.end()) { return false; } - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]); if (nbEdgesInWire.front() == 3) { // exactly 3 edges if (myTriaVertexID>0) { @@ -1790,7 +1790,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes SMESH_subMesh * sm = aMesh.GetSubMesh(E1); MapShapeNbElemsItr anIt = aResMap.find(sm); if (anIt==aResMap.end()) return false; - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; if (IsQuadratic) aNbNodes[0] = (aVec[SMDSEntity_Node]-1)/2 + 2; else @@ -1824,7 +1824,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes if (anIt==aResMap.end()) { return false; } - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; if (IsQuadratic) aNbNodes[nbSides] = (aVec[SMDSEntity_Node]-1)/2 + 2; else @@ -1861,7 +1861,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes if (anIt==aResMap.end()) { return false; } - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; if (IsQuadratic) aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1; else @@ -1902,7 +1902,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes if (anIt==aResMap.end()) { return false; } - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; if (IsQuadratic) aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1; else @@ -3179,7 +3179,7 @@ bool StdMeshers_Quadrangle_2D::evaluateQuadPref(SMESH_Mesh & aMesh, nbFaces += (drl+addv)*(nb-1) + (nt-1); } // end new version implementation - std::vector aVec(SMDSEntity_Last); + std::vector aVec(SMDSEntity_Last); for (int i=SMDSEntity_Node; i aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_Out += aVec[SMDSEntity_Node]; - nb2d_3_Out += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - nb2d_4_Out += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + nb2d_3_Out += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + nb2d_4_Out += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } - int nb1d_Out = 0; + smIdType nb1d_Out = 0; TopTools_MapOfShape tmpMap; for (TopExp_Explorer exp(outerShell, TopAbs_EDGE); exp.More(); exp.Next()) { if( tmpMap.Contains( exp.Current() ) ) @@ -479,9 +479,9 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, tmpMap.Add( exp.Current() ); SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find(aSubMesh); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_Out += aVec[SMDSEntity_Node]; - nb1d_Out += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + nb1d_Out += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); } tmpMap.Clear(); for (TopExp_Explorer exp(outerShell, TopAbs_VERTEX); exp.More(); exp.Next()) { @@ -492,18 +492,18 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, } // get info for inner shell - int nb0d_In=0, nb2d_3_In=0, nb2d_4_In=0; + smIdType nb0d_In=0, nb2d_3_In=0, nb2d_4_In=0; //TopTools_SequenceOfShape FacesIn; for (TopExp_Explorer exp(innerShell, TopAbs_FACE); exp.More(); exp.Next()) { //FacesIn.Append(exp.Current()); SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find(aSubMesh); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_In += aVec[SMDSEntity_Node]; - nb2d_3_In += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - nb2d_4_In += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + nb2d_3_In += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + nb2d_4_In += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } - int nb1d_In = 0; + smIdType nb1d_In = 0; tmpMap.Clear(); bool IsQuadratic = false; bool IsFirst = true; @@ -513,9 +513,9 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, tmpMap.Add( exp.Current() ); SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find(aSubMesh); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_In += aVec[SMDSEntity_Node]; - nb1d_In += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + nb1d_In += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); if(IsFirst) { IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]); IsFirst = false; @@ -532,7 +532,7 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, bool IsOK = (nb0d_Out==nb0d_In) && (nb1d_Out==nb1d_In) && (nb2d_3_Out==nb2d_3_In) && (nb2d_4_Out==nb2d_4_In); if(!IsOK) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; iGetLayerDistribution() ) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i& aResVec = - aResMap.insert( make_pair(sm, vector(SMDSEntity_Last,0))).first->second; + vector& aResVec = + aResMap.insert( make_pair(sm, vector(SMDSEntity_Last,0))).first->second; myHelper = new SMESH_MesherHelper( aMesh ); myHelper->SetSubShape( aShape ); @@ -1204,23 +1204,23 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, for ( TopExp_Explorer edge( aShape, TopAbs_EDGE ); edge.More() && !isQuadratic ; edge.Next() ) { sm = aMesh.GetSubMesh( edge.Current() ); - vector& nbElems = aResMap[ sm ]; + vector& nbElems = aResMap[ sm ]; if ( SMDSEntity_Quad_Edge < (int) nbElems.size() ) isQuadratic = nbElems[ SMDSEntity_Quad_Edge ]; } - int nbCircSegments = 0; + smIdType nbCircSegments = 0; for ( int iE = 0; iE < circSide->NbEdges(); ++iE ) { sm = aMesh.GetSubMesh( circSide->Edge( iE )); - vector& nbElems = aResMap[ sm ]; + vector& nbElems = aResMap[ sm ]; if ( SMDSEntity_Quad_Edge < (int) nbElems.size() ) nbCircSegments += ( nbElems[ SMDSEntity_Edge ] + nbElems[ SMDSEntity_Quad_Edge ]); } - int nbQuads = nbCircSegments * ( layerPositions.size() - 1 ); - int nbTria = nbCircSegments; - int nbNodes = ( nbCircSegments - 1 ) * ( layerPositions.size() - 2 ); + smIdType nbQuads = nbCircSegments * ( layerPositions.size() - 1 ); + smIdType nbTria = nbCircSegments; + smIdType nbNodes = ( nbCircSegments - 1 ) * ( layerPositions.size() - 2 ); if ( isQuadratic ) { nbNodes += (( nbCircSegments - 1 ) * ( layerPositions.size() - 1 ) + // radial @@ -1238,7 +1238,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, if ( linSide1 ) { // evaluation for linSides - vector aResVec(SMDSEntity_Last, 0); + vector aResVec(SMDSEntity_Last, 0); if ( isQuadratic ) { aResVec[SMDSEntity_Node ] = 2 * ( layerPositions.size() - 1 ) + 1; aResVec[SMDSEntity_Quad_Edge] = layerPositions.size() - 1; diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index c6e41cbb2..79f32fbc2 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -1312,7 +1312,7 @@ bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh, ASSERT(!VFirst.IsNull()); ASSERT(!VLast.IsNull()); - std::vector aVec(SMDSEntity_Last,0); + std::vector aVec(SMDSEntity_Last,0); double length = EdgeLength( E ); if ( !Curve.IsNull() && length > 0 )