}
break;
case TopAbs_COMPSOLID: insertDependence( _subShape, TopAbs_SOLID ); break;
- case TopAbs_SOLID: insertDependence( _subShape, TopAbs_FACE ); break;
+ case TopAbs_SOLID: insertDependence( _subShape, TopAbs_FACE );
+ { /*internal EDGE*/ insertDependence( _subShape, TopAbs_EDGE, TopAbs_WIRE ); break; }
case TopAbs_SHELL: insertDependence( _subShape, TopAbs_FACE ); break;
case TopAbs_FACE: insertDependence( _subShape, TopAbs_EDGE ); break;
case TopAbs_WIRE: insertDependence( _subShape, TopAbs_EDGE ); break;
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() );
+ }
}
//=============================================================================
//=============================================================================
void SMESH_subMesh::insertDependence(const TopoDS_Shape aShape,
- TopAbs_ShapeEnum aSubType)
+ TopAbs_ShapeEnum aSubType,
+ TopAbs_ShapeEnum avoidType)
{
- TopExp_Explorer sub( aShape, aSubType );
+ TopExp_Explorer sub( aShape, aSubType, avoidType );
for ( ; sub.More(); sub.Next() )
{
SMESH_subMesh *aSubMesh = _father->GetSubMesh( sub.Current() );
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