]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_Tools.cpp
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
1 // File:        ModuleBase_Tools.cpp
2 // Created:     11 July 2014
3 // Author:      Vitaly Smetannikov
4
5 #include "ModuleBase_Tools.h"
6 #include <ModelAPI_ResultBody.h>
7 #include <ModelAPI_ResultConstruction.h>
8
9 namespace ModuleBase_Tools
10 {
11
12 //******************************************************************
13 boost::shared_ptr<GeomAPI_Shape> shape(ResultPtr theResult)
14 {
15   ResultBodyPtr aBody = boost::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
16   if (aBody) return aBody->shape();
17   ResultConstructionPtr aConstruct = boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theResult);
18   if (aConstruct) return aConstruct->shape();
19   return boost::shared_ptr<GeomAPI_Shape>();
20 }
21
22 }