Salome HOME
#29335 [CEA 29224] Cannot graphicaly select geometry to create groups: implement...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GEOMGenUtils.cxx
index 57fce1eea0c252d7f8f55c4000144c7fe18bcf12..e865168d182cc61b47ae9eae61143d2fb596f313 100644 (file)
@@ -276,12 +276,15 @@ namespace SMESH
   //================================================================================
 
   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;