Salome HOME
PAL13330( When mesh generation does not success, trace where )
authoreap <eap@opencascade.com>
Tue, 10 Apr 2007 14:08:35 +0000 (14:08 +0000)
committereap <eap@opencascade.com>
Tue, 10 Apr 2007 14:08:35 +0000 (14:08 +0000)
+  GEOM::GEOM_Object_ptr GetSubShape (GEOM::GEOM_Object_ptr theMainShape,
+                                     long                  theID)

src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx
src/SMESHGUI/SMESHGUI_GEOMGenUtils.h

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();
+  }
 }
index 76ff62407abcc4cb036e2d6fa547fc58760a9891..cb42cc48ba62ef8af9caad1cb7e34c2005d7f9f9 100644 (file)
@@ -34,6 +34,9 @@ namespace SMESH
   GEOM::GEOM_Object_var GetShapeOnMeshOrSubMesh (_PTR(SObject) theSObject);
 
   GEOM::GEOM_Object_ptr GetGeom (_PTR(SObject) theSO);
+
+  GEOM::GEOM_Object_ptr GetSubShape (GEOM::GEOM_Object_ptr theMainShape,
+                                     long                  theID);
 }
 
 #endif