Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/smesh.git] / src / SMDS / SMDS_MeshElement.cxx
index 83f073fdbcc1c2c529c43fe5f0c469dc18ec722f..fa15e0e5f81f50cade022508aadd078d44ce6c79 100644 (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;
+}