From a68d1c0471e2eed5cfbff9d8e28d5fdfc9ffce8f Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 10 Apr 2007 14:08:35 +0000 Subject: [PATCH] PAL13330( When mesh generation does not success, trace where ) + GEOM::GEOM_Object_ptr GetSubShape (GEOM::GEOM_Object_ptr theMainShape, + long theID) --- src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx | 14 ++++++++++++++ src/SMESHGUI/SMESHGUI_GEOMGenUtils.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx index 520499301..2537452c6 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.cxx @@ -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(); + } } diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h index 76ff62407..cb42cc48b 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h @@ -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 -- 2.39.2