1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_Tools.cpp
4 // Created: 06 Aug 2014
5 // Author: Vitaly Smetannikov
7 #include "ModelAPI_Tools.h"
8 #include <ModelAPI_ResultBody.h>
9 #include <ModelAPI_ResultConstruction.h>
10 #include <ModelAPI_ResultGroup.h>
12 namespace ModelAPI_Tools {
14 std::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
17 ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
19 return aBody->shape();
21 ResultConstructionPtr aConstruct = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(
24 return aConstruct->shape();
26 ResultGroupPtr aGroup = std::dynamic_pointer_cast<ModelAPI_ResultGroup>(theResult);
28 return aGroup->shape();
29 return std::shared_ptr<GeomAPI_Shape>();
31 return theResult->shape();