Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Tools.cpp
index 2f356e16b756122862c8d44a581ea064a4da07d3..9f845f57fc0d2ff8b160fb1174206ca0bf5662c0 100644 (file)
 
 namespace SketcherPrs_Tools {
 
-
-std::shared_ptr<GeomAPI_Edge> getLine(SketchPlugin_Constraint* theFeature,
-                                      const std::string& theAttrName)
+ObjectPtr getResult(SketchPlugin_Constraint* theFeature, const std::string& theAttrName)
 {
   std::shared_ptr<ModelAPI_Data> aData = theFeature->data();
   std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
     std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(theAttrName));
 
-  ObjectPtr aObject = anAttr->object();
-  ResultConstructionPtr aRes = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aObject);
+  return anAttr->object();
+}
+
+
+std::shared_ptr<GeomAPI_Shape> getShape(ObjectPtr theObject)
+{
+  ResultConstructionPtr aRes = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theObject);
   if (aRes.get() != NULL) {
-    std::shared_ptr<GeomAPI_Shape> aShape = aRes->shape();
-    if (aShape.get() != NULL) {   
-      return std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aShape));
-    }
+    return aRes->shape();
   }
-  return std::shared_ptr<GeomAPI_Edge>();
+  return std::shared_ptr<GeomAPI_Shape>();
 }