Salome HOME
rename SMDS_MeshNode::NbInverseNodes() to SMDS_MeshNode::NbInverseElements()
[modules/smesh.git] / src / SMDS / SMDS_MeshNode.cxx
index e4b551912c197cbfe9f2997fe52e65307809a1a3..587aee90a86284144296f898755b476f326607d5 100644 (file)
@@ -240,6 +240,24 @@ bool SMDS_MeshNode::emptyInverseElements()
   return myInverseElements.IsEmpty() != Standard_False;
 }
 
+//================================================================================
+/*!
+ * \brief Count inverse elements of given type
+ */
+//================================================================================
+
+int SMDS_MeshNode::NbInverseElements(SMDSAbs_ElementType type) const
+{
+  if ( type == SMDSAbs_All )
+    return myInverseElements.Extent();
+  int nb = 0;
+  NCollection_List<const SMDS_MeshElement*>::Iterator it( myInverseElements );
+  for ( ; it.More(); it.Next() )
+    if ( it.Value()->GetType() == type )
+      nb++;
+  return nb;
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 /// To be used with STL set
 ///////////////////////////////////////////////////////////////////////////////