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;
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 );
}
}
TColStd_SequenceOfInteger anIntSeq;
TColStd_SequenceOfAsciiString aStrSeq;
- TColStd_MapIteratorOfMapOfInteger anIter( myIds );
+ TIDsMap::Iterator anIter( myIds );
for ( ; anIter.More(); anIter.Next() )
{
int anId = anIter.Key();
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<int>(aMinId);
aStr += "-";
if ( aMaxId != IntegerLast() )
- aStr += aMaxId;
+ aStr += FromIdType<int>(aMaxId);
// find position of the string in result sequence and insert string in it
if ( anIntSeq.Length() == 0 )
//=======================================================================
bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr )
{
- myMin.Clear();
- myMax.Clear();
+ myMin.clear();
+ myMax.clear();
myIds.Clear();
TCollection_AsciiString aStr = 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() );
}
}
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;
}
}
if ( isSatisfy )
- myIds.Add( heElemPtr->GetID() );
+ myIds.Add( theElemPtr->GetID() );
}
bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode )
class gp_Pln;
class gp_Pnt;
-typedef NCollection_Map< smIdType > TIDsMap;
+typedef NCollection_Map< smIdType, smIdHasher > TIDsMap;
namespace SMESH{
namespace Controls{
SMESH_VisualObjDef::TEntityList elems;
if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get()))
dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())->GetEntities( fun->GetType(), elems );
- std::vector<int> elemIds; elemIds.reserve( elems.size() );
+ std::vector<smIdType> 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<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
SMESH_VisualObjDef::TEntityList elems;
if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get()))
dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())->GetEntities( fun->GetType(), elems );
- std::vector<int> elemIds;
+ std::vector<smIdType> elemIds;
for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e)
elemIds.push_back( (*e)->GetID());
}
}
- std::map<SMDSAbs_ElementType,int> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
+ std::map<SMDSAbs_ElementType,smIdType> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
std::map<SMDSAbs_ElementType,smIdType> entities;
entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_0DElement,
theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0));
// 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 )
// 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 )
// 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 )
{
}
}
-int SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const
+smIdType SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const
{
theObjs.clear();
// 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 );
}
// 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();
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();
// 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 )
{
}
}
-int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const
+smIdType SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const
{
theResList.clear();
#include "SMDSAbs_ElementType.hxx"
#include <SALOMEconfig.h>
+#include <smIdType.hxx>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
class SMDS_Mesh;
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(); }
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;
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:
bool ret = true;
if (_subShape.ShapeType() == TopAbs_VERTEX) {
- vector<int> aVec(SMDSEntity_Last,0);
+ vector<smIdType> aVec(SMDSEntity_Last,0);
aVec[SMDSEntity_Node] = 1;
aResMap.insert(make_pair(this,aVec));
return ret;
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<int> & nbs = aResMap[ sm ];
+ const vector<smIdType> & nbs = aResMap[ sm ];
subMeshEvaluated = (std::accumulate( nbs.begin(), nbs.end(), 0 ) > 0 );
}
if ( !subMeshEvaluated )
if ( IsMeshComputed() )
{
- vector<int> & nbEntities = aResMap[ this ];
+ vector<smIdType> & nbEntities = aResMap[ this ];
nbEntities.resize( SMDSEntity_Last, 0 );
if ( SMESHDS_SubMesh* sm = GetSubMeshDS() )
{
{
ret = algo->Evaluate((*_father), _subShape, aResMap);
}
- aResMap.insert( make_pair( this,vector<int>(0)));
+ aResMap.insert( make_pair( this,vector<smIdType>(0)));
}
return ret;
//purpose :
//=======================================================================
-int SMESHDS_Group::Extent() const
+smIdType SMESHDS_Group::Extent() const
{
return myGroup.Extent();
}
*/
//=============================================================================
-bool SMESHDS_Group::Contains (const int theID)
+bool SMESHDS_Group::Contains (const smIdType theID)
{
const SMDS_MeshElement* aElem = findInMesh (theID);
if (aElem)
*/
//=============================================================================
-bool SMESHDS_Group::Add (const int theID)
+bool SMESHDS_Group::Add (const smIdType theID)
{
return Add( findInMesh( theID ));
}
*/
//=============================================================================
-bool SMESHDS_Group::Remove (const int theID)
+bool SMESHDS_Group::Remove (const smIdType theID)
{
bool removed = false;
if ( const SMDS_MeshElement* aElem = findInMesh( theID ))
*/
//=============================================================================
-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;
//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++;
//purpose :
//=======================================================================
-bool SMESHDS_GroupBase::Contains (const int theID)
+bool SMESHDS_GroupBase::Contains (const smIdType theID)
{
if ( SMDS_ElemIteratorPtr it = GetElements() ) {
while ( it->more() )
*/
//================================================================================
-int SMESHDS_GroupOnFilter::Extent() const
+smIdType SMESHDS_GroupOnFilter::Extent() const
{
update();
return std::accumulate( myMeshInfo.begin(), myMeshInfo.end(), 0 );
*/
//================================================================================
-bool SMESHDS_GroupOnFilter::Contains (const int theID)
+bool SMESHDS_GroupOnFilter::Contains (const smIdType theID)
{
return myPredicate && myPredicate->IsSatisfy( theID );
}
*/
//================================================================================
-std::vector< int > SMESHDS_GroupOnFilter::GetMeshInfo() const
+std::vector< smIdType > SMESHDS_GroupOnFilter::GetMeshInfo() const
{
update();
return myMeshInfo;
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() ]++;
}
}
SMESH_PredicatePtr GetPredicate() const { return myPredicate; }
- std::vector< int > GetMeshInfo() const;
+ std::vector< smIdType > GetMeshInfo() const;
template< typename IDTYPE >
smIdType GetElementIds( IDTYPE* ids ) const
//purpose :
//=======================================================================
-bool SMESHDS_GroupOnGeom::Contains (const int theID)
+bool SMESHDS_GroupOnGeom::Contains (const smIdType theID)
{
return mySubMesh->Contains( findInMesh( theID ));
}
SMESH::Controls::NumericalFunctor* aNumFun =
dynamic_cast<SMESH::Controls::NumericalFunctor*>( aFunctor.get() );
if ( aNumFun ) {
- std::vector<int> elements;
+ std::vector<SMESH::smIdType> elements;
SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIO);
if ( mesh->_is_nil() ) {
SMESH::SMESH_IDSource_var idSource =
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 ))
{
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 );
}
// 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 )
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 );
int GetEdgeNodes(SVTK_Selector* theSelector,
const TVisualObjPtr& theVisualObject,
- int& theId1,
- int& theId2)
+ smIdType& theId1,
+ smIdType& theId2)
{
const SALOME_ListIO& selected = theSelector->StoredIObjects();
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
}
- int GetEdgeNodes( LightApp_SelectionMgr* theMgr, int& theId1, int& theId2 )
+ int GetEdgeNodes( LightApp_SelectionMgr* theMgr, smIdType& theId1, smIdType& theId2 )
{
SALOME_ListIO selected; theMgr->selectedObjects( selected );
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
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
const bool = true );
SMESHGUI_EXPORT
- int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );
+ int GetEdgeNodes( LightApp_SelectionMgr*, smIdType&, smIdType& );
SMESHGUI_EXPORT
void SetControlsPrecision( const long );
*/
//================================================================================
- 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 )
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);
{
std::vector<int> nbEvents;
std::vector<double> funValues;
- std::vector<int> elements;
+ std::vector<SMESH::smIdType> elements;
myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues,elements,0,isLogarithmic);
SMESH::Histogram_var histogram = new SMESH::Histogram;
{
SMESH::Histogram_var histogram = new SMESH::Histogram;
- std::vector<int> nbEvents;
- std::vector<double> funValues;
- std::vector<int> elements;
+ std::vector<int> nbEvents;
+ std::vector<double> funValues;
+ std::vector<SMESH::smIdType> elements;
SMDS_ElemIteratorPtr elemIt;
if ( SMESH::DownCast< SMESH_GroupOnFilter_i* >( object ) ||
/*CORBA::Boolean ret =*/ myGen.Evaluate( myLocMesh, myLocShape, aResMap);
MapShapeNbElemsItr anIt = aResMap.begin();
for(; anIt!=aResMap.end(); anIt++) {
- const vector<int>& aVec = (*anIt).second;
+ const vector<smIdType>& 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
* 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
*/
//=============================================================================
-CORBA::smIdType SMESH_GroupBase_i::Size()
+SMESH::smIdType SMESH_GroupBase_i::Size()
{
if ( myPreMeshInfo )
return GetType() == SMESH::NODE ? myPreMeshInfo->NbNodes() : myPreMeshInfo->NbElements();
*/
//=============================================================================
-typedef bool (SMESHDS_Group::*TFunChangeGroup)(const int);
+typedef bool (SMESHDS_Group::*TFunChangeGroup)(const smIdType);
CORBA::Long
ChangeByPredicate( SMESH::Predicate_i* thePredicate,
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 ];
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
lessComplexSide = & *face;
// Get an 1D size of lessComplexSide
- int nbSeg1 = 0;
+ smIdType nbSeg1 = 0;
vector<TopoDS_Edge> edges;
if ( !lessComplexSide->GetHoriEdges(edges) )
return false;
for ( size_t i = 0; i < edges.size(); ++i )
{
- const vector<int>& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )];
+ const vector<smIdType>& 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<int>& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )];
+ const vector<smIdType>& 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(); )
list< TopoDS_Face >::iterator f = sideFaces.begin();
for ( ; f != sideFaces.end(); ++f )
{
- const vector<int>& nbElems = aResMap[ theMesh.GetSubMesh( *f )];
+ const vector<smIdType>& nbElems = aResMap[ theMesh.GetSubMesh( *f )];
if ( !nbElems.empty() )
{
nbFaces = nbElems[ SMDSEntity_Quadrangle ];
}
// Fill nb of elements
- vector<int> aResVec(SMDSEntity_Last,0);
- int nbSeg3 = ( nbFaces + nbQuadFace ) / nbSeg2;
+ vector<smIdType> 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;
bool secondOrder = aMesh.NbFaces( ORDER_QUADRATIC );
int entity = secondOrder ? SMDSEntity_Quad_Hexa : SMDSEntity_Hexa;
- vector<int>& nbByType = aResMap[ aMesh.GetSubMesh( aShape )];
+ vector<smIdType>& nbByType = aResMap[ aMesh.GetSubMesh( aShape )];
if ( entity >= (int) nbByType.size() )
nbByType.resize( SMDSEntity_Last, 0 );
TopoDS_Shape aFace = aFaces.Value(i+1);
SMESH_Algo *algo = _gen->GetAlgo(aMesh, aFace);
if( !algo ) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
if (algoName == "Quadrangle_2D") {
MapShapeNbElemsItr anIt = aResMap.find(meshFaces[i]);
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
if( nbtri == 0 )
isAllQuad = true;
}
if( sm ) {
MapShapeNbElemsItr anIt = aResMap.find(sm);
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+ std::vector<smIdType> 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;
if( i == OppNum ) continue;
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] );
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[0] );
- std::vector<int> aVec = (*anIt).second;
- int nb2d_face0 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
- int nb0d_face0 = aVec[SMDSEntity_Node];
+ std::vector<smIdType> aVec = (*anIt).second;
+ smIdType nb2d_face0 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ smIdType nb0d_face0 = aVec[SMDSEntity_Node];
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(IsQuadratic) {
aResVec[SMDSEntity_Quad_Hexa] = nb2d_face0 * ( nb2d/nb1d );
if ( srcGroups.empty() )
return error("Invalid source groups");
- vector<int> aVec(SMDSEntity_Last,0);
+ vector<smIdType> aVec(SMDSEntity_Last,0);
bool toCopyMesh, toCopyGroups;
_sourceHyp->GetCopySourceMesh(toCopyMesh, toCopyGroups);
if ( srcGroups.empty() )
return error("Invalid source groups");
- vector<int> aVec(SMDSEntity_Last,0);
+ vector<smIdType> aVec(SMDSEntity_Last,0);
bool toCopyMesh, toCopyGroups;
_sourceHyp->GetCopySourceMesh(toCopyMesh, toCopyGroups);
{
TopoDS_Edge geomEdge = TopoDS::Edge( exp.Current() );
SMESH_subMesh* sm = theMesh.GetSubMesh( geomEdge );
- vector<int>& edgeVec = aResMap[sm];
+ vector<smIdType>& edgeVec = aResMap[sm];
if ( edgeVec.empty() )
{
edgeVec.resize(SMDSEntity_Last,0);
TopoDS_Edge E = TopoDS::Edge(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find( aMesh.GetSubMesh(E) );
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
int nbe = Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
NbSeg += nbe;
if(IsFirst) {
}
}
if(NbSeg<1) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
(int)( anArea/(tmpLength*tmpLength*sqrt(3.)/4) );
int nbNodes = (int) ( nbFaces*3 - (NbSeg-1)*2 ) / 6;
- std::vector<int> aVec(SMDSEntity_Last);
+ std::vector<smIdType> aVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
if(IsQuadratic) {
aVec[SMDSEntity_Quad_Triangle] = nbFaces;
NumBase = 0;
break;
}
- std::vector<int> 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<smIdType> 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<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
if( sm ) {
MapShapeNbElemsItr anIt = aResMap.find(sm);
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
}
}
// find face opposite to base face
if( i==OppNum || i==NumBase ) continue;
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] );
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] );
- std::vector<int> aVec = (*anIt).second;
- int nb2d_face0 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
- int nb0d_face0 = aVec[SMDSEntity_Node];
+ std::vector<smIdType> 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<SMDSEntity_Last; i++)
SMESH_MesherHelper aTool (aMesh);
bool _quadraticMesh = aTool.IsQuadraticSubMesh(aShape);
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(_quadraticMesh) {
aResVec[SMDSEntity_Quad_Penta] = nb2d_face0 * ( nb2d/nb1d );
nbQuadSegs += sm2vec->second.at( SMDSEntity_Quad_Edge );
}
- std::vector<int> aVec( SMDSEntity_Last, 0 );
+ std::vector<smIdType> aVec( SMDSEntity_Last, 0 );
switch ( nbLinSegs + nbQuadSegs ) {
case 3:
aVec[ nbQuadSegs ? SMDSEntity_Quad_Triangle : SMDSEntity_Triangle ] = 1;
case TopAbs_FACE:
{
myFaceMesher->Evaluate( theMesh, shape, theResMap );
- std::vector<int> & quantities = theResMap[ sm ];
+ std::vector<smIdType> & quantities = theResMap[ sm ];
_quadraticMesh = ( !quantities.empty() &&
( quantities[ SMDSEntity_Quad_Triangle ] +
quantities[ SMDSEntity_Quad_Quadrangle ] +
case TopAbs_SOLID:
{
- std::vector<int> & quantities = theResMap[ sm ];
+ std::vector<smIdType> & quantities = theResMap[ sm ];
quantities.resize( SMDSEntity_Last, 0 );
SMESH_MesherHelper helper( theMesh );
if( anIt==aResMap.end() )
return toSM( error( "Submesh can not be evaluated"));
- std::vector<int> 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<smIdType> 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++;
}
}
if(NbQFs<4) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
aResMap.insert(std::make_pair(sm,aResVec));
if(NumBase==0) NumBase = 1; // only quads => 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());
if( sm ) {
MapShapeNbElemsItr anIt = aResMap.find(sm);
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
}
}
// find face opposite to base face
}
}
// 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<int> aVec = (*anIt).second;
- nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] );
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> 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<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(IsQuadratic) {
aResVec[SMDSEntity_Quad_Penta] = nb2d_face0_3 * ( nb2d/nb1d );
int nbNodes = params.size();
- std::vector<int> aVec(SMDSEntity_Last);
+ std::vector<smIdType> aVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
aVec[SMDSEntity_Node] = nbNodes;
TopAbs_ShapeEnum shapeType = srcSM->GetSubShape().ShapeType();
if ( shapeType == TopAbs_EDGE )
{
- std::vector<int> aVec;
+ std::vector<smIdType> aVec;
SMESHDS_SubMesh* srcSubMeshDS = srcSM->GetSubMeshDS();
if ( srcSubMeshDS && srcSubMeshDS->NbElements() )
{
// Assure that mesh on a source Face is computed/evaluated
// -------------------------------------------------------
- std::vector<int> aVec;
+ std::vector<smIdType> aVec;
SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcFace );
if ( srcSubMesh->IsMeshComputed() )
return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
- std::vector<int> aVec(SMDSEntity_Last);
+ std::vector<smIdType> aVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
aVec[SMDSEntity_Node] = srcSubMesh->GetSubMeshDS()->NbNodes();
std::vector<int> aNbNodes(4);
bool IsQuadratic = false;
if (!checkNbEdgesForEvaluate(aMesh, aFace, aResMap, aNbNodes, IsQuadratic)) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for (int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aFace);
aResMap.insert(std::make_pair(sm,aResVec));
//int nbFaces4 = (nbhoriz-1-kdh)*(nbvertic-1-kdv);
int nbFaces4 = (nbhoriz-1)*(nbvertic-1);
- std::vector<int> aVec(SMDSEntity_Last,0);
+ std::vector<smIdType> aVec(SMDSEntity_Last,0);
if (IsQuadratic) {
aVec[SMDSEntity_Quad_Triangle] = nbFaces3;
aVec[SMDSEntity_Quad_Quadrangle] = nbFaces4;
if (anIt==aResMap.end()) {
return false;
}
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
if (nbEdgesInWire.front() == 3) { // exactly 3 edges
if (myTriaVertexID>0) {
SMESH_subMesh * sm = aMesh.GetSubMesh(E1);
MapShapeNbElemsItr anIt = aResMap.find(sm);
if (anIt==aResMap.end()) return false;
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
if (IsQuadratic)
aNbNodes[0] = (aVec[SMDSEntity_Node]-1)/2 + 2;
else
if (anIt==aResMap.end()) {
return false;
}
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
if (IsQuadratic)
aNbNodes[nbSides] = (aVec[SMDSEntity_Node]-1)/2 + 2;
else
if (anIt==aResMap.end()) {
return false;
}
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
if (IsQuadratic)
aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1;
else
if (anIt==aResMap.end()) {
return false;
}
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
if (IsQuadratic)
aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1;
else
nbFaces += (drl+addv)*(nb-1) + (nt-1);
} // end new version implementation
- std::vector<int> aVec(SMDSEntity_Last);
+ std::vector<smIdType> aVec(SMDSEntity_Last);
for (int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
if (IsQuadratic) {
aVec[SMDSEntity_Quad_Quadrangle] = nbFaces;
if ( !outerShell.IsSame( It.Value() ))
innerShell = It.Value();
if ( nbShells != 2 ) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
if ( !ProjectionUtils::FindSubShapeAssociation( outerShell, &aMesh,
innerShell, &aMesh,
shape2ShapeMap) ) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
//FacesOut.Append(exp.Current());
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> 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() ) )
tmpMap.Add( exp.Current() );
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> 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()) {
}
// 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<int> aVec = (*anIt).second;
+ std::vector<smIdType> 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;
tmpMap.Add( exp.Current() );
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> 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;
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<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
}
if ( myDistributionHypo ) {
if ( !myDistributionHypo->GetLayerDistribution() ) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
nbLayers = myLayerPositions.size() + 1;
}
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(IsQuadratic) {
aResVec[SMDSEntity_Quad_Penta] = nb2d_3_Out * nbLayers;
aResVec[SMDSEntity_Quad_Hexa] = nb2d_4_Out * nbLayers;
- int nb1d = ( nb2d_3_Out*3 + nb2d_4_Out*4 ) / 2;
+ smIdType nb1d = ( nb2d_3_Out*3 + nb2d_4_Out*4 ) / 2;
aResVec[SMDSEntity_Node] = nb0d_Out * ( 2*nbLayers - 1 ) - nb1d * nbLayers;
}
else {
if( aResMap.count(sm) )
return false;
- vector<int>& aResVec =
- aResMap.insert( make_pair(sm, vector<int>(SMDSEntity_Last,0))).first->second;
+ vector<smIdType>& aResVec =
+ aResMap.insert( make_pair(sm, vector<smIdType>(SMDSEntity_Last,0))).first->second;
myHelper = new SMESH_MesherHelper( aMesh );
myHelper->SetSubShape( aShape );
for ( TopExp_Explorer edge( aShape, TopAbs_EDGE ); edge.More() && !isQuadratic ; edge.Next() )
{
sm = aMesh.GetSubMesh( edge.Current() );
- vector<int>& nbElems = aResMap[ sm ];
+ vector<smIdType>& 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<int>& nbElems = aResMap[ sm ];
+ vector<smIdType>& 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
if ( linSide1 )
{
// evaluation for linSides
- vector<int> aResVec(SMDSEntity_Last, 0);
+ vector<smIdType> aResVec(SMDSEntity_Last, 0);
if ( isQuadratic ) {
aResVec[SMDSEntity_Node ] = 2 * ( layerPositions.size() - 1 ) + 1;
aResVec[SMDSEntity_Quad_Edge] = layerPositions.size() - 1;
ASSERT(!VFirst.IsNull());
ASSERT(!VLast.IsNull());
- std::vector<int> aVec(SMDSEntity_Last,0);
+ std::vector<smIdType> aVec(SMDSEntity_Last,0);
double length = EdgeLength( E );
if ( !Curve.IsNull() && length > 0 )