using namespace std;
-SMDS_MeshElement::SMDS_MeshElement(int ID):myID(ID)
+SMDS_MeshElement::SMDS_MeshElement(int ID):myID(ID), myMeshId(-1), myShapeId(-1), myIdInShape(-1)
+{
+}
+
+SMDS_MeshElement::SMDS_MeshElement(int id, ShortType meshId, ShortType shapeId):
+ myID(id), myMeshId(meshId), myShapeId(shapeId), myIdInShape(-1)
{
}
const SMDS_MeshNode* SMDS_MeshElement::GetNode(const int ind) const
{
- SMDS_ElemIteratorPtr it = nodesIterator();
- int i = 0, index = WrappedIndex( ind );
- while ( index != i++ )
- it->next();
- if ( it->more() )
- return static_cast<const SMDS_MeshNode*> (it->next());
+ if ( ind >= 0 ) {
+ SMDS_ElemIteratorPtr it = nodesIterator();
+ for ( int i = 0; i < ind; ++i )
+ it->next();
+ if ( it->more() )
+ return static_cast<const SMDS_MeshNode*> (it->next());
+ }
return 0;
}