//================================================================================
bool ContainsSubShape( GEOM::GEOM_Object_ptr mainGeom,
- GEOM::GEOM_Object_ptr subGeom )
+ GEOM::GEOM_Object_ptr subGeom, bool allowMainShape )
{
if ( CORBA::is_nil( mainGeom ) ||
CORBA::is_nil( subGeom ))
return false;
+ if (allowMainShape && mainGeom->IsSame(subGeom))
+ return true;
+
GEOM::GEOM_Gen_var geomGen = mainGeom->GetGen();
if ( geomGen->_is_nil() ) return false;
QString& subGeom, QString& meshGeom);
SMESHGUI_EXPORT bool ContainsSubShape( GEOM::GEOM_Object_ptr mainShape,
- GEOM::GEOM_Object_ptr subShape );
+ GEOM::GEOM_Object_ptr subShape,
+ bool allowMainShape = true );
}
#endif // SMESHGUI_GEOMGENUTILS_H
GEOM::GEOM_Object_var subGeom =
GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject());
- if ( SMESH::ContainsSubShape( mainGeom, subGeom ))
+ if ( SMESH::ContainsSubShape( mainGeom, subGeom, false ))
return true;
}