Salome HOME
Make python feature don't crash on documentToAdd call.
[modules/shaper.git] / src / ModelAPI / ModelAPI_Tools.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_Tools.cpp
4 // Created:     06 Aug 2014
5 // Author:      Vitaly Smetannikov
6
7 #include "ModelAPI_Tools.h"
8 #include <ModelAPI_ResultBody.h>
9 #include <ModelAPI_ResultConstruction.h>
10 #include <ModelAPI_ResultGroup.h>
11
12 namespace ModelAPI_Tools {
13
14   std::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
15   {
16 /*
17     ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
18     if (aBody)
19       return aBody->shape();
20
21     ResultConstructionPtr aConstruct = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(
22       theResult);
23     if (aConstruct)
24       return aConstruct->shape();
25
26     ResultGroupPtr aGroup = std::dynamic_pointer_cast<ModelAPI_ResultGroup>(theResult);
27     if (aGroup)
28       return aGroup->shape();
29     return std::shared_ptr<GeomAPI_Shape>();
30     */
31     return theResult->shape();
32   }
33 }