add GetNodeIndex()

This commit is contained in:
eap 2006-05-03 15:06:18 +00:00
parent 53781e4054
commit 69ddeca946
2 changed files with 24 additions and 0 deletions

View File

@ -218,3 +218,20 @@ bool SMDS_MeshElement::IsMediumNode(const SMDS_MeshNode* node) const
{
return false;
}
//================================================================================
/*!
* \brief Check if a node belongs to the element
* \param node - the node to check
* \retval int - node index within the element, -1 if not found
*/
//================================================================================
int SMDS_MeshElement::GetNodeIndex( const SMDS_MeshNode* node ) const
{
SMDS_ElemIteratorPtr nIt = nodesIterator();
for ( int i = 0; nIt->more(); ++i )
if ( nIt->next() == node )
return i;
return -1;
}

View File

@ -108,6 +108,13 @@ public:
return ind;
}
/*!
* \brief Check if a node belongs to the element
* \param node - the node to check
* \retval int - node index within the element, -1 if not found
*/
int GetNodeIndex( const SMDS_MeshNode* node ) const;
protected:
SMDS_MeshElement(int ID=-1);
virtual void Print(std::ostream & OS) const;