Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / ModelAPI / ModelAPI_Tools.cpp
index 52b88b5b05aa4200a5d298039ed8bf6bbf34503a..27a5fdde28540730509b7955d790908bbdfc4342 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        ModelAPI_Tools.cpp
 // Created:     06 Aug 2014
 // Author:      Vitaly Smetannikov
@@ -5,19 +7,27 @@
 #include "ModelAPI_Tools.h"
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_ResultGroup.h>
 
 namespace ModelAPI_Tools {
 
-boost::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
-{
-  ResultBodyPtr aBody = boost::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
-  if (aBody)
-    return aBody->shape();
-  ResultConstructionPtr aConstruct = boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(
+  std::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
+  {
+/*
+    ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
+    if (aBody)
+      return aBody->shape();
+
+    ResultConstructionPtr aConstruct = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(
       theResult);
-  if (aConstruct)
-    return aConstruct->shape();
-  return boost::shared_ptr<GeomAPI_Shape>();
-}
+    if (aConstruct)
+      return aConstruct->shape();
 
+    ResultGroupPtr aGroup = std::dynamic_pointer_cast<ModelAPI_ResultGroup>(theResult);
+    if (aGroup)
+      return aGroup->shape();
+    return std::shared_ptr<GeomAPI_Shape>();
+    */
+    return theResult->shape();
+  }
 }