Salome HOME
Compilation error on Mageia 5
[modules/smesh.git] / src / SMESH / SMESH_subMesh.cxx
index 5bb65b5b325498ddaaa33977bcf70b8c317a530b..57a401df93e39f33c1a86c14bea38a286afd5db8 100644 (file)
@@ -457,14 +457,17 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn()
 
 namespace
 {
-  int dependsOnMapKey( const SMESH_subMesh* sm )
+  int dependsOnMapKey( TopAbs_ShapeEnum type, int shapeID )
   {
-    int type = sm->GetSubShape().ShapeType();
-    int ordType = 9 - type;               // 2 = Vertex, 8 = CompSolid
-    int cle = sm->GetId();
+    int ordType = 9 - int(type);               // 2 = Vertex, 8 = CompSolid
+    int     cle = shapeID;
     cle += 10000000 * ordType;    // sort map by ordType then index
     return cle;
   }
+  int dependsOnMapKey( const SMESH_subMesh* sm )
+  {
+    return dependsOnMapKey( sm->GetSubShape().ShapeType(), sm->GetId() );
+  }
 }
 
 //=============================================================================
@@ -503,6 +506,17 @@ bool SMESH_subMesh::DependsOn( const SMESH_subMesh* other ) const
   return other ? _mapDepend.count( dependsOnMapKey( other )) : false;
 }
 
+//================================================================================
+/*!
+ * \brief Return \c true if \a this sub-mesh depends on a \a shape
+ */
+//================================================================================
+
+bool SMESH_subMesh::DependsOn( const int shapeID ) const
+{
+  return DependsOn( _father->GetSubMeshContaining( shapeID ));
+}
+
 //=============================================================================
 /*!
  * Return a shape of \a this sub-mesh