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>
10 namespace ModelAPI_Tools {
12 boost::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
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>();