#include "SMDS_CellOfNodes.hxx"
-SMDS_CellOfNodes::SMDS_CellOfNodes( smIdType id, smIdType shapeID )
+SMDS_CellOfNodes::SMDS_CellOfNodes( smIdType id, int shapeID )
: myID( id )
{
setShapeID( shapeID );
return myID;
}
-void SMDS_CellOfNodes::setShapeID( const smIdType shapeID )
+void SMDS_CellOfNodes::setShapeID( const int shapeID )
{
myShapeID = ( shapeID << BITS_SHIFT ) | ( myShapeID & BIT_IS_MARKED );
}
-smIdType SMDS_CellOfNodes::GetShapeID() const
+int SMDS_CellOfNodes::GetShapeID() const
{
return myShapeID >> BITS_SHIFT;
}
public:
virtual smIdType GetID() const;
- virtual smIdType GetShapeID() const;
+ virtual int GetShapeID() const;
virtual void setIsMarked( bool is ) const;
virtual bool isMarked() const;
protected:
- SMDS_CellOfNodes( smIdType id = -1, smIdType shapeID = 0);
+ SMDS_CellOfNodes( smIdType id = -1, int shapeID = 0);
virtual void setID( const smIdType id);
- virtual void setShapeID( const smIdType shapeID );
+ virtual void setShapeID( const int shapeID );
smIdType myID;
- smIdType myShapeID;
+ int myShapeID;
enum Bits { // use the 1st right bit of myShapeId to set/unset a mark
BIT_IS_MARKED = 1,
//================================================================================
/*!
* \brief Return minimal ID of a non-used element
- * \return int - minimal element ID
+ * \return smIdType - minimal element ID
*/
//================================================================================
for ( smIdType i = myChunks.size() - 1; i >= 0; --i )
if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges ))
{
- smIdType index = usedRanges.back().second-1;
+ int index = usedRanges.back().second-1;
id = myChunks[i].Get1stID() + index;
break;
}
smIdType SMDS_ElementFactory::GetMinID()
{
- int id = 0;
+ smIdType id = 0;
TIndexRanges usedRanges;
for ( size_t i = 0; i < myChunks.size(); ++i )
if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges ))
{
smIdType iChunk = ( id - 1 ) / theChunkSize;
smIdType index = ( id - 1 ) % theChunkSize;
- while ((int) myChunks.size() <= iChunk )
+ while ((smIdType) myChunks.size() <= iChunk )
{
smIdType id0 = myChunks.size() * theChunkSize + 1;
myChunks.push_back( new SMDS_ElementChunk( this, id0 ));
{
smIdType iChunk = ( id - 1 ) / theChunkSize;
smIdType index = ( id - 1 ) % theChunkSize;
- if ( iChunk < (int) myChunks.size() )
+ if ( iChunk < (smIdType) myChunks.size() )
{
const SMDS_MeshElement* e = myChunks[iChunk].Element( index );
return e->IsNull() ? 0 : e;
}
else // there are holes in SMDS IDs
{
- int newVtkID = 0; // same as new smds ID (-1)
- for ( int oldID = 1; oldID <= maxCellID; ++oldID ) // smds IDs
+ smIdType newVtkID = 0; // same as new smds ID (-1)
+ for ( smIdType oldID = 1; oldID <= maxCellID; ++oldID ) // smds IDs
{
const SMDS_MeshElement* oldElem = FindElement( oldID );
if ( !oldElem ) continue;
const SMDS_MeshElement* newNode = FindElement( newID+1 );
if ( !newNode )
newNode = NewElement( newID+1 );
- smIdType shapeID = oldNode->GetShapeID();
- int shapeDim = GetShapeDim( shapeID );
- smIdType iChunk = newID / theChunkSize;
+ int shapeID = oldNode->GetShapeID();
+ int shapeDim = GetShapeDim( shapeID );
+ smIdType iChunk = newID / theChunkSize;
myChunks[ iChunk ].SetShapeID( newNode, shapeID );
if ( shapeDim == 2 || shapeDim == 1 )
{
}
else // no holes
{
- for ( int i = 0; i < newNbNodes; ++i )
+ for ( smIdType i = 0; i < newNbNodes; ++i )
theVtkIDsOldToNew[ i ] = i;
}
myChunks.resize( newNbChunks );
{
if ( e->GetID() - 1 != vtkID )
{
- if ((int) myFactory->myVtkIDs.size() <= e->GetID() - 1 )
+ if ((smIdType) myFactory->myVtkIDs.size() <= e->GetID() - 1 )
{
size_t i = myFactory->myVtkIDs.size();
myFactory->myVtkIDs.resize( e->GetID() + 100 );
for ( ; i < myFactory->myVtkIDs.size(); ++i )
- myFactory->myVtkIDs[i] = FromIdType<int>(i);
+ myFactory->myVtkIDs[i] = FromIdType<vtkIdType>(i);
}
myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID;
*/
//================================================================================
-int SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const
+vtkIdType SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const
{
- size_t dfltVtkID = e->GetID() - 1;
- return ( dfltVtkID < myFactory->myVtkIDs.size() ) ? FromIdType<int>(myFactory->myVtkIDs[ dfltVtkID ]) : FromIdType<int>(dfltVtkID);
+ vtkIdType dfltVtkID = e->GetID() - 1;
+ return ( dfltVtkID < (vtkIdType)myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID;
}
//================================================================================
TChunkPtrSet myChunksWithUnused; // sorted chunks having unused elements
std::vector< vtkIdType > myVtkIDs; // myVtkIDs[ smdsID-1 ] == vtkID
std::vector< smIdType > mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1
- int myNbUsedElements; // counter of elements
+ smIdType myNbUsedElements; // counter of elements
friend class SMDS_ElementChunk;
rNext = mySet.upper_bound( theIndex );
r = rNext - 1;
}
- smIdType rSize = Size( r ); // range size
+ int rSize = Size( r ); // range size
attr_t rValue = r->myValue;
if ( rValue == theValue )
return rValue; // it happens while compacting
smIdType GetID( const SMDS_MeshElement* e ) const;
- int GetVtkID( const SMDS_MeshElement* e ) const;
+ vtkIdType GetVtkID( const SMDS_MeshElement* e ) const;
void SetVTKID( const SMDS_MeshElement* e, const vtkIdType id );
int GetShapeID( const SMDS_MeshElement* e ) const;
void SMDS_ElementHolder::beforeCompacting()
{
- int i = 0;
- for ( SMDS_ElemIteratorPtr it = getElements(); it->more(); ++i )
+ for ( SMDS_ElemIteratorPtr it = getElements(); it->more() )
{
const SMDS_MeshElement* e = it->next();
if ( !e ) continue;
std::vector< bool >::iterator isNode = myIsNode.begin();
for ( size_t i = 0; i < myVtkIDs.size(); ++i, ++isNode )
{
- int vtkID = myVtkIDs[i];
+ vtkIdType vtkID = myVtkIDs[i];
if ( vtkID < 0 )
{
elem = myExternalElems[ (-vtkID)-1 ];
}
else if ( *isNode )
{
- if ( vtkID < (int)idNodesOldToNew.size() )
+ if ( vtkID < (vtkIdType)idNodesOldToNew.size() )
elem = myMesh->FindNodeVtk( idNodesOldToNew[ vtkID ]);
else
elem = myMesh->FindNodeVtk( vtkID );
}
else
{
- if ( vtkID < (int)idCellsOldToNew.size() )
+ if ( vtkID < (vtkIdType)idCellsOldToNew.size() )
elem = myMesh->FindElementVtk( idCellsOldToNew[ vtkID ]);
else
elem = myMesh->FindElementVtk( vtkID );
std::vector<const SMDS_MeshElement*> myExternalElems; //!< elements not contained in the mesh
- std::vector< int > myVtkIDs; //!< vtk IDs of elements
+ std::vector< vtkIdType > myVtkIDs; //!< vtk IDs of elements
std::vector< bool > myIsNode;
std::set< SMDS_ElementHolder* >::iterator myPtrInMesh;
};
///////////////////////////////////////////////////////////////////////////////
/// Return the node whose VTK ID is 'vtkId'.
///////////////////////////////////////////////////////////////////////////////
-const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(int vtkId) const
+const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(vtkIdType vtkId) const
{
return myNodeFactory->FindNode( vtkId + 1 );
}
-const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(int IDelem) const
+const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(vtkIdType IDelem) const
{
return myCellFactory->FindElement( FromVtkToSmds( IDelem ));
}
n->RemoveInverseElement((*it));
}
- int vtkid = (*it)->GetVtkID();
+ vtkIdType vtkid = (*it)->GetVtkID();
switch ((*it)->GetType()) {
case SMDSAbs_Node:
///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
{
- const int vtkId = elem->GetVtkID();
+ const vtkIdType vtkId = elem->GetVtkID();
SMDSAbs_ElementType aType = elem->GetType();
if ( aType == SMDSAbs_Node )
{
idCellsOldToNew.resize( oldCellSize, oldCellSize );
for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); ++iNew )
{
- if ( idCellsNewToOld[ iNew ] >= (int) idCellsOldToNew.size() )
+ if ( idCellsNewToOld[ iNew ] >= (smIdType) idCellsOldToNew.size() )
idCellsOldToNew.resize( ( 1 + idCellsNewToOld[ iNew ]) * 1.5, oldCellSize );
idCellsOldToNew[ idCellsNewToOld[ iNew ]] = iNew;
}
*/
//================================================================================
-smIdType SMDS_MeshElement::GetShapeID() const
+int SMDS_MeshElement::GetShapeID() const
{
return myHolder->GetShapeID( this );
}
*/
//================================================================================
-int SMDS_MeshElement::GetVtkID() const
+vtkIdType SMDS_MeshElement::GetVtkID() const
{
return myHolder->GetVtkID( this );
}
*/
//================================================================================
-void SMDS_MeshElement::setVtkID( const int vtkID )
+void SMDS_MeshElement::setVtkID( const vtkIdType vtkID )
{
myHolder->SetVTKID( this, vtkID );
}
virtual int GetNodeIndex( const SMDS_MeshNode* node ) const;
- virtual smIdType GetID() const;
- virtual int GetVtkID() const;
- virtual smIdType getshapeId() const { return GetShapeID(); }
- virtual smIdType GetShapeID() const;
+ virtual smIdType GetID() const;
+ virtual vtkIdType GetVtkID() const;
+ virtual smIdType getshapeId() const { return GetShapeID(); }
+ virtual smIdType GetShapeID() const;
// mark this element; to be used in algos
virtual void setIsMarked( bool is ) const;
SMDS_MeshElement();
- void setVtkID(const int vtkID );
+ void setVtkID(const vtkIdType vtkID );
virtual void setShapeID( const int shapeID ) const;
SMDS_UnstructuredGrid* getGrid() const;
// methods to count NOT POLY elements
inline void remove(const SMDS_MeshElement* el);
inline void add (const SMDS_MeshElement* el);
- inline smIdType index(SMDSAbs_ElementType type, smIdType nbNodes) const;
+ inline smIdType index(SMDSAbs_ElementType type, int nbNodes) const;
// methods to remove elements of ANY kind
inline void RemoveEdge(const SMDS_MeshElement* el);
inline void RemoveFace(const SMDS_MeshElement* el);
}
inline smIdType // index
-SMDS_MeshInfo::index(SMDSAbs_ElementType type, smIdType nbNodes) const
+SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const
{ return nbNodes + myShift[ type ]; }
inline void // remove
{
for (int i = 0; i < ncells; i++)
{
- int vtkId = cells[i];
+ vtkIdType vtkId = cells[i];
smIdType smdsId = myMesh->FromVtkToSmds( vtkId );
const SMDS_MeshElement* elem = myMesh->FindElement( smdsId );
if ( elem->GetType() == type )
const SMDS_MeshElement* next()
{
- int vtkId = myCellList[ myIter++ ];
+ vtkIdType vtkId = myCellList[ myIter++ ];
smIdType smdsId = myMesh->FromVtkToSmds( vtkId );
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
if (!elem)
return this->Points;
}
-int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *pts)
+vtkIdType SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *pts)
{
if ( !this->Links ) // don't create Links until they are needed
{
return vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts);
// --- type = VTK_POLYHEDRON
- int cellid = this->InsertNextCell(type, npts, pts);
+ vtkIdType cellid = this->InsertNextCell(type, npts, pts);
std::set<vtkIdType> setOfNodes;
setOfNodes.clear();
// IDs of VTK nodes always correspond to SMDS IDs but there can be "holes" in SMDS numeration.
// We compact only if there were holes
- int oldNodeSize = this->GetNumberOfPoints();
+ vtkIdType oldNodeSize = this->GetNumberOfPoints();
bool updateNodes = ( oldNodeSize > newNodeSize );
if ( true /*updateNodes*/ )
{
newPoints->SetDataType( VTK_DOUBLE );
newPoints->SetNumberOfPoints( FromIdType<int>(newNodeSize) );
- int i = 0, alreadyCopied = 0;
+ int vtkIdType = 0, alreadyCopied = 0;
while ( i < oldNodeSize )
{
// skip a hole if any
while ( i < oldNodeSize && idNodesOldToNew[i] < 0 )
++i;
- int startBloc = i;
+ vtkIdType startBloc = i;
// look for a block end
while ( i < oldNodeSize && idNodesOldToNew[i] >= 0 )
++i;
- int endBloc = i;
+ vtkIdType endBloc = i;
copyNodes(newPoints, idNodesOldToNew, alreadyCopied, startBloc, endBloc);
}
this->SetPoints(newPoints);
// Compact cells if VTK IDs do not correspond to SMDS IDs or nodes compacted
- int oldCellSize = this->Types->GetNumberOfTuples();
- bool updateCells = ( updateNodes || newCellSize != oldCellSize );
- for ( int newID = 0, nbIDs = idCellsNewToOld.size(); newID < nbIDs && !updateCells; ++newID )
+ vtkIdType oldCellSize = this->Types->GetNumberOfTuples();
+ bool updateCells = ( updateNodes || newCellSize != oldCellSize );
+ for ( vtkIdType newID = 0, nbIDs = idCellsNewToOld.size(); newID < nbIDs && !updateCells; ++newID )
updateCells = ( idCellsNewToOld[ newID ] != newID );
if ( false /*!updateCells*/ ) // no holes in elements
return;
}
- if ((int) idNodesOldToNew.size() < oldNodeSize )
+ if ((vtkIdType) idNodesOldToNew.size() < oldNodeSize )
{
idNodesOldToNew.reserve( oldNodeSize );
- for ( int i = idNodesOldToNew.size(); i < oldNodeSize; ++i )
+ for ( vvtkIdType i = idNodesOldToNew.size(); i < oldNodeSize; ++i )
idNodesOldToNew.push_back( i );
}
// --- create new compacted Connectivity, Locations and Types
- int newConnectivitySize = this->Connectivity->GetNumberOfConnectivityEntries();
+ vvtkIdType newConnectivitySize = this->Connectivity->GetNumberOfConnectivityEntries();
if ( newCellSize != oldCellSize )
- for ( int i = 0; i < oldCellSize - 1; ++i )
+ for ( vvtkIdType i = 0; i < oldCellSize - 1; ++i )
if ( this->Types->GetValue( i ) == VTK_EMPTY_CELL )
newConnectivitySize -= this->Connectivity->GetCellSize( i );
vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New();
newTypes->Initialize();
- newTypes->SetNumberOfValues(FromIdType<int>(newCellSize));
+ newTypes->SetNumberOfValues(FromIdType<vtkIdType>(newCellSize));
vtkIdTypeArray *newLocations = vtkIdTypeArray::New();
newLocations->Initialize();
- newLocations->SetNumberOfValues(FromIdType<int>(newCellSize));
+ newLocations->SetNumberOfValues(FromIdType<vtkIdType>(newCellSize));
std::vector< vtkIdType > pointsCell(1024); // --- points id to fill a new cell
{
vtkDoubleArray* newDiameters = vtkDoubleArray::New();
newDiameters->SetNumberOfComponents(1);
- for ( int newCellID = 0; newCellID < newCellSize; newCellID++ )
+ for ( vvtkIdType newCellID = 0; newCellID < newCellSize; newCellID++ )
{
if ( newTypes->GetValue( newCellID ) == VTK_POLY_VERTEX )
{
- int oldCellID = idCellsNewToOld[ newCellID ];
+ vvtkIdType oldCellID = idCellsNewToOld[ newCellID ];
newDiameters->InsertValue( newCellID, diameters->GetValue( oldCellID ));
}
vtkDataSet::CellData->SetScalars( newDiameters );
vtkIdTypeArray *newFaces = vtkIdTypeArray::New();
newFaces->Initialize();
newFaces->Allocate(this->Faces->GetSize());
- for ( int newCellID = 0; newCellID < newCellSize; newCellID++ )
+ for ( vvtkIdType newCellID = 0; newCellID < newCellSize; newCellID++ )
{
if ( newTypes->GetValue( newCellID ) == VTK_POLYHEDRON )
{
- int oldCellId = idCellsNewToOld[ newCellID ];
+ smIdType oldCellId = idCellsNewToOld[ newCellID ];
newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 );
- int oldFaceLoc = this->FaceLocations->GetValue( oldCellId );
- int nCellFaces = this->Faces->GetValue( oldFaceLoc++ );
+ smIdType oldFaceLoc = this->FaceLocations->GetValue( oldCellId );
+ smIdType nCellFaces = this->Faces->GetValue( oldFaceLoc++ );
newFaces->InsertNextValue( nCellFaces );
for ( int n = 0; n < nCellFaces; n++ )
{
newFaces->InsertNextValue( nptsInFace );
for ( int k = 0; k < nptsInFace; k++ )
{
- int oldpt = this->Faces->GetValue( oldFaceLoc++ );
+ vtkIdType oldpt = this->Faces->GetValue( oldFaceLoc++ );
newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]);
}
}
void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints,
std::vector<smIdType>& /*idNodesOldToNew*/,
- int& alreadyCopied,
- int start,
- int end)
+ vvtkIdType& alreadyCopied,
+ vvtkIdType start,
+ vvtkIdType end)
{
void *target = newPoints->GetVoidPointer(3 * alreadyCopied);
void *source = this->Points->GetVoidPointer(3 * start);
- int nbPoints = end - start;
+ vvtkIdType nbPoints = end - start;
if (nbPoints > 0)
{
memcpy(target, source, 3 * sizeof(double) * nbPoints);
{
for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); iNew++ )
{
- int iOld = idCellsNewToOld[ iNew ];
+ vvtkIdType iOld = idCellsNewToOld[ iNew ];
newTypes->SetValue( iNew, this->Types->GetValue( iOld ));
vtkIdType oldLoc = ((vtkIdTypeArray *)(this->Connectivity->GetOffsetsArray()))->GetValue( iOld );
pointsCell.resize( nbpts );
for ( int l = 0; l < nbpts; l++ )
{
- int oldval = oldPtsCell[l];
+ vvtkIdType oldval = oldPtsCell[l];
pointsCell[l] = idNodesOldToNew[oldval];
}
- /*int newcnt = */newConnectivity->InsertNextCell( nbpts, pointsCell.data() );
- int newLoc = newConnectivity->GetInsertLocation( nbpts );
+ /*vvtkIdType newcnt = */newConnectivity->InsertNextCell( nbpts, pointsCell.data() );
+ vvtkIdType newLoc = newConnectivity->GetInsertLocation( nbpts );
newLocations->SetValue( iNew, newLoc );
}
}
-int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId)
+int SMDS_UnstructuredGrid::CellIdToDownId(vtkIdType vtkCellId)
{
- if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size()))
+ if ((vtkCellId < 0) || (vtkCellId >= (vvtkIdType)_cellIdToDownId.size()))
{
return -1;
}
return _cellIdToDownId[vtkCellId];
}
-void SMDS_UnstructuredGrid::setCellIdToDownId(int vtkCellId, int downId)
+void SMDS_UnstructuredGrid::setCellIdToDownId(vvtkIdType vtkCellId, int downId)
{
// ASSERT((vtkCellId >= 0) && (vtkCellId < _cellIdToDownId.size()));
_cellIdToDownId[vtkCellId] = downId;
virtual vtkMTimeType GetMTime();
virtual vtkPoints *GetPoints();
- int InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
+ vtkIdType InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
int CellIdToDownId(int vtkCellId);
void setCellIdToDownId(int vtkCellId, int downId);
#define SMDS_VolumeTool_HeaderFile
#include "SMESH_SMDS.hxx"
-#include <smIdType.hxx>
class SMDS_MeshElement;
class SMDS_MeshNode;
bool SMESHDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem,
const SMDS_MeshNode * nodes[],
- const smIdType nbnodes)
+ const int nbnodes)
{
- if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, FromIdType<int>(nbnodes) ))
+ if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes ))
return false;
std::vector<smIdType> IDs( nbnodes );
* @param localClonedNodeIds map old node id to new node id.
* @return ok if success.
*/
-bool SMESHDS_Mesh::ModifyCellNodes(int vtkVolId, std::map<int,int> localClonedNodeIds)
+bool SMESHDS_Mesh::ModifyCellNodes(vtkIdType vtkVolId, std::map<int,int> localClonedNodeIds)
{
myGrid->ModifyCellNodes(vtkVolId, localClonedNodeIds);
return true;
bool ChangeElementNodes(const SMDS_MeshElement * elem,
const SMDS_MeshNode * nodes[],
- const smIdType nbnodes);
+ const int nbnodes);
bool ChangePolygonNodes(const SMDS_MeshElement * elem,
std::vector<const SMDS_MeshNode*> nodes);
bool ChangePolyhedronNodes(const SMDS_MeshElement * elem,
const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities);
- bool ModifyCellNodes(int smdsVolId, std::map<int,int> localClonedNodeIds);
- void Renumber (const bool isNodes, const int startID=1, const int deltaID=1);
+ bool ModifyCellNodes(vtkIdType smdsVolId, std::map<int,int> localClonedNodeIds);
+ void Renumber (const bool isNodes, const smIdType startID=1, const smIdType deltaID=1);
void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Shell & S);
void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Solid & S);
AddNode( static_cast< const SMDS_MeshNode* >( elem ));
return;
}
- smIdType oldShapeId = elem->GetShapeID();
+ int oldShapeId = elem->GetShapeID();
if ( oldShapeId > 0 )
{
if (oldShapeId != myIndex)
//purpose :
//=======================================================================
-int SMESHDS_SubMesh::NbElements() const
+smIdType SMESHDS_SubMesh::NbElements() const
{
if ( !IsComplexSubmesh() )
return myNbElements;
- int nbElems = 0;
+ smIdType nbElems = 0;
TSubMeshSet::const_iterator it = mySubMeshes.begin();
for ( ; it != mySubMeshes.end(); it++ )
nbElems += (*it)->NbElements();
//purpose :
//=======================================================================
-int SMESHDS_SubMesh::NbNodes() const
+smIdType SMESHDS_SubMesh::NbNodes() const
{
if ( !IsComplexSubmesh() )
return myNbNodes;
- int nbElems = 0;
+ smIdType nbElems = 0;
TSubMeshSet::const_iterator it = mySubMeshes.begin();
for ( ; it != mySubMeshes.end(); it++ )
nbElems += (*it)->NbNodes();
SMESHDS_SubMeshIteratorPtr GetSubMeshIterator() const;
// for both types
- virtual int NbElements() const;
- virtual int NbNodes() const;
+ virtual smIdType NbElements() const;
+ virtual smIdType NbNodes() const;
virtual SMDS_ElemIteratorPtr GetElements() const;
virtual SMDS_NodeIteratorPtr GetNodes() const;
virtual bool Contains(const SMDS_MeshElement * ME) const; // check if elem or node is in
private:
int myIndex;
- int myNbElements;
- int myNbNodes;
+ smIdType myNbElements;
+ smIdType myNbNodes;
const SMDS_MeshElement* my1stElemNode[2]; // elem and node with least ID, to optimize iteration
const SMESHDS_Mesh * myParent;
TSubMeshSet mySubMeshes;