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