]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for projection dump.
authordbv <dbv@opencascade.com>
Mon, 16 Jan 2017 14:06:26 +0000 (17:06 +0300)
committerdbv <dbv@opencascade.com>
Wed, 18 Jan 2017 13:55:59 +0000 (16:55 +0300)
src/SketchAPI/SketchAPI_Projection.cpp
src/SketchAPI/SketchAPI_Projection.h

index 1291a8099710b26801dada088347409c04281963..d67149d0282a9b9dbb21254092169e4cf08b331d 100644 (file)
@@ -7,7 +7,14 @@
 
 //--------------------------------------------------------------------------------------
 #include "SketchAPI_Projection.h"
-//--------------------------------------------------------------------------------------
+
+#include <SketchPlugin_Line.h>
+#include <SketchPlugin_Circle.h>
+
+#include <SketchAPI_Line.h>
+#include <SketchAPI_Circle.h>
+#include <SketchAPI_Arc.h>
+
 #include <ModelHighAPI_Dumper.h>
 #include <ModelHighAPI_Selection.h>
 #include <ModelHighAPI_Tools.h>
@@ -60,12 +67,19 @@ void SketchAPI_Projection::setByExternalName(const std::string& theExternalName)
 }
 
 //--------------------------------------------------------------------------------------
-std::shared_ptr<ModelHighAPI_Interface> SketchAPI_Projection::createdFeature() const
+std::shared_ptr<SketchAPI_SketchEntity> SketchAPI_Projection::createdFeature() const
 {
   AttributeRefAttrPtr aProjectedRefAttr = projectedFeature();
   FeaturePtr aProjectedFeature = ModelAPI_Feature::feature(aProjectedRefAttr->object());
 
-  return std::shared_ptr<ModelHighAPI_Interface>(new ModelHighAPI_Interface(aProjectedFeature));
+  std::shared_ptr<SketchAPI_SketchEntity> anEntity;
+  aProjectedFeature->getKind() == SketchPlugin_Line::ID() ?
+    anEntity.reset(new SketchAPI_Line(aProjectedFeature)) :
+    aProjectedFeature->getKind() == SketchPlugin_Circle::ID() ?
+      anEntity.reset(new SketchAPI_Circle(aProjectedFeature)) :
+      anEntity.reset(new SketchAPI_Arc(aProjectedFeature));
+
+  return anEntity;
 }
 
 //--------------------------------------------------------------------------------------
index b8c3ff3977ef1849134f4387bc76d3c8ee6898d1..e3870de4eb87a3a83d49a36b66a784438ab0f7e3 100644 (file)
@@ -58,7 +58,7 @@ public:
 
   /// Returns created feature
   SKETCHAPI_EXPORT
-  std::shared_ptr<ModelHighAPI_Interface> createdFeature() const;
+  std::shared_ptr<SketchAPI_SketchEntity> createdFeature() const;
 
   /// Dump wrapped feature
   SKETCHAPI_EXPORT