Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GEOMGenUtils.cxx
index 52049930119cde5a5b2d086c20359b389a25c746..2537452c659e9214694ab256cd31c9c8e78a553b 100644 (file)
@@ -92,4 +92,18 @@ namespace SMESH {
     }
     return GEOM::GEOM_Object::_nil();
   }
+
+  GEOM::GEOM_Object_ptr GetSubShape (GEOM::GEOM_Object_ptr theMainShape,
+                                     long                  theID)
+  {
+    GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
+    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+    if (!aStudy || geomGen->_is_nil())
+      return GEOM::GEOM_Object::_nil();
+    GEOM::GEOM_IShapesOperations_var aShapesOp = geomGen->GetIShapesOperations(aStudy->StudyId());
+    if (aShapesOp->_is_nil())
+      return GEOM::GEOM_Object::_nil();
+    GEOM::GEOM_Object_var subShape = aShapesOp->GetSubShape (theMainShape,theID);
+    return subShape._retn();
+  }
 }