From 226a930e71fe9cbdae89e4f6935f6cb13b12cdbf Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 16 Jun 2016 14:37:06 +0300 Subject: [PATCH] addIntersectionPoint for SketchAPI_Sketch --- src/SketchAPI/SketchAPI_IntersectionPoint.cpp | 2 +- src/SketchAPI/SketchAPI_IntersectionPoint.h | 2 +- src/SketchAPI/SketchAPI_Sketch.cpp | 15 +++++++++++++++ src/SketchAPI/SketchAPI_Sketch.h | 8 ++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/SketchAPI/SketchAPI_IntersectionPoint.cpp b/src/SketchAPI/SketchAPI_IntersectionPoint.cpp index e2e8f88c7..75ddb603c 100644 --- a/src/SketchAPI/SketchAPI_IntersectionPoint.cpp +++ b/src/SketchAPI/SketchAPI_IntersectionPoint.cpp @@ -2,7 +2,7 @@ // Purpose: // // History: -// 15/06/16 - Sergey POKHODENKO - Creation of the file +// 16/06/16 - Sergey POKHODENKO - Creation of the file //-------------------------------------------------------------------------------------- #include "SketchAPI_IntersectionPoint.h" diff --git a/src/SketchAPI/SketchAPI_IntersectionPoint.h b/src/SketchAPI/SketchAPI_IntersectionPoint.h index bf5ce37e2..7f0bdfbd8 100644 --- a/src/SketchAPI/SketchAPI_IntersectionPoint.h +++ b/src/SketchAPI/SketchAPI_IntersectionPoint.h @@ -2,7 +2,7 @@ // Purpose: // // History: -// 15/06/16 - Sergey POKHODENKO - Creation of the file +// 16/06/16 - Sergey POKHODENKO - Creation of the file #ifndef SRC_SKETCHAPI_SKETCHAPI_INTERSECTIONPOINT_H_ #define SRC_SKETCHAPI_SKETCHAPI_INTERSECTIONPOINT_H_ diff --git a/src/SketchAPI/SketchAPI_Sketch.cpp b/src/SketchAPI/SketchAPI_Sketch.cpp index 5f51c2592..4accfa347 100644 --- a/src/SketchAPI/SketchAPI_Sketch.cpp +++ b/src/SketchAPI/SketchAPI_Sketch.cpp @@ -33,6 +33,7 @@ //-------------------------------------------------------------------------------------- #include "SketchAPI_Arc.h" #include "SketchAPI_Circle.h" +#include "SketchAPI_IntersectionPoint.h" #include "SketchAPI_Line.h" #include "SketchAPI_Mirror.h" #include "SketchAPI_Point.h" @@ -175,6 +176,20 @@ std::shared_ptr SketchAPI_Sketch::addPoint(const std::string & return PointPtr(new SketchAPI_Point(aFeature, theExternalName)); } +//-------------------------------------------------------------------------------------- +std::shared_ptr SketchAPI_Sketch::addIntersectionPoint( + const ModelHighAPI_Selection & theExternal) +{ + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID()); + return IntersectionPointPtr(new SketchAPI_IntersectionPoint(aFeature, theExternal)); +} +std::shared_ptr SketchAPI_Sketch::addIntersectionPoint( + const std::string & theExternalName) +{ + std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_IntersectionPoint::ID()); + return IntersectionPointPtr(new SketchAPI_IntersectionPoint(aFeature, theExternalName)); +} + //-------------------------------------------------------------------------------------- std::shared_ptr SketchAPI_Sketch::addLine(double theX1, double theY1, double theX2, double theY2) { diff --git a/src/SketchAPI/SketchAPI_Sketch.h b/src/SketchAPI/SketchAPI_Sketch.h index 3e77725be..2f7694921 100644 --- a/src/SketchAPI/SketchAPI_Sketch.h +++ b/src/SketchAPI/SketchAPI_Sketch.h @@ -26,6 +26,7 @@ class ModelHighAPI_RefAttr; class ModelHighAPI_Selection; class SketchAPI_Arc; class SketchAPI_Circle; +class SketchAPI_IntersectionPoint; class SketchAPI_Line; class SketchAPI_Mirror; class SketchAPI_Point; @@ -89,6 +90,13 @@ public: SKETCHAPI_EXPORT std::shared_ptr addPoint(const std::string & theExternalName); + /// Add intersection point + SKETCHAPI_EXPORT + std::shared_ptr addIntersectionPoint(const ModelHighAPI_Selection & theExternal); + /// Add point + SKETCHAPI_EXPORT + std::shared_ptr addIntersectionPoint(const std::string & theExternalName); + /// Add line SKETCHAPI_EXPORT std::shared_ptr addLine( -- 2.39.2