X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FSMESH%2FSMESH_subMesh.cxx;h=57a401df93e39f33c1a86c14bea38a286afd5db8;hb=25b7d7ffe76e153c93cb67055192b11b16c3d0e2;hp=5bb65b5b325498ddaaa33977bcf70b8c317a530b;hpb=831ca6c828271732e46fba73b196d423482535ae;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 5bb65b5b3..57a401df9 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -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