1 // File: ModelAPI_Tools.cpp
2 // Created: 06 Aug 2014
3 // Author: Vitaly Smetannikov
5 #include "ModelAPI_Tools.h"
6 #include <ModelAPI_ResultBody.h>
7 #include <ModelAPI_ResultConstruction.h>
8 #include <ModelAPI_ResultGroup.h>
10 namespace ModelAPI_Tools {
12 std::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
15 ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
17 return aBody->shape();
19 ResultConstructionPtr aConstruct = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(
22 return aConstruct->shape();
24 ResultGroupPtr aGroup = std::dynamic_pointer_cast<ModelAPI_ResultGroup>(theResult);
26 return aGroup->shape();
27 return std::shared_ptr<GeomAPI_Shape>();
29 return theResult->shape();