From ea88ab037c92a455f6a8dee8ccde46f7fad77e8f Mon Sep 17 00:00:00 2001 From: dbv Date: Mon, 16 Jan 2017 17:06:26 +0300 Subject: [PATCH] Fix for projection dump. --- src/SketchAPI/SketchAPI_Projection.cpp | 20 +++++++++++++++++--- src/SketchAPI/SketchAPI_Projection.h | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/SketchAPI/SketchAPI_Projection.cpp b/src/SketchAPI/SketchAPI_Projection.cpp index 1291a8099..d67149d02 100644 --- a/src/SketchAPI/SketchAPI_Projection.cpp +++ b/src/SketchAPI/SketchAPI_Projection.cpp @@ -7,7 +7,14 @@ //-------------------------------------------------------------------------------------- #include "SketchAPI_Projection.h" -//-------------------------------------------------------------------------------------- + +#include +#include + +#include +#include +#include + #include #include #include @@ -60,12 +67,19 @@ void SketchAPI_Projection::setByExternalName(const std::string& theExternalName) } //-------------------------------------------------------------------------------------- -std::shared_ptr SketchAPI_Projection::createdFeature() const +std::shared_ptr SketchAPI_Projection::createdFeature() const { AttributeRefAttrPtr aProjectedRefAttr = projectedFeature(); FeaturePtr aProjectedFeature = ModelAPI_Feature::feature(aProjectedRefAttr->object()); - return std::shared_ptr(new ModelHighAPI_Interface(aProjectedFeature)); + std::shared_ptr 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; } //-------------------------------------------------------------------------------------- diff --git a/src/SketchAPI/SketchAPI_Projection.h b/src/SketchAPI/SketchAPI_Projection.h index b8c3ff397..e3870de4e 100644 --- a/src/SketchAPI/SketchAPI_Projection.h +++ b/src/SketchAPI/SketchAPI_Projection.h @@ -58,7 +58,7 @@ public: /// Returns created feature SKETCHAPI_EXPORT - std::shared_ptr createdFeature() const; + std::shared_ptr createdFeature() const; /// Dump wrapped feature SKETCHAPI_EXPORT -- 2.39.2