X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_Mesh.cxx;h=6381e547e626174de6c68a803cc0fee451c26efe;hb=22f20048e0fb430a15d242af597ec57a904fbb19;hp=0058da87809121f013470ed8cc9ec0f88e86e49c;hpb=c38c10811a065cf5b13e8807ed71864d92ca7d80;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index 0058da878..6381e547e 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -2179,3 +2179,25 @@ void SMDS_Mesh::Renumber (const bool isNodes, const int startID, const int del ID += deltaID; } } + +//======================================================================= +//function : GetElementType +//purpose : Return type of element or node with id +//======================================================================= + +SMDSAbs_ElementType SMDS_Mesh::GetElementType( const int id, const bool iselem ) const +{ + SMDS_MeshElement* elem = 0; + if( iselem ) + elem = myElementIDFactory->MeshElement( id ); + else + elem = myNodeIDFactory->MeshElement( id ); + + if( !elem ) + { + //throw SALOME_Exception(LOCALIZED ("this element isn't exist")); + return SMDSAbs_All; + } + else + return elem->GetType(); +} \ No newline at end of file