]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_Tools.cpp
Salome HOME
1c49c67799d045d685966049f14e095b5bdc1f65
[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
10 namespace ModelAPI_Tools {
11
12 boost::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
13 {
14   ResultBodyPtr aBody = boost::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
15   if (aBody) return aBody->shape();
16   ResultConstructionPtr aConstruct = boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theResult);
17   if (aConstruct) return aConstruct->shape();
18   return boost::shared_ptr<GeomAPI_Shape>();
19 }
20
21 }