From 14e1c70aaa0300fdb3c780e2e8dce0e4ba305072 Mon Sep 17 00:00:00 2001 From: spo Date: Wed, 8 Jun 2016 13:30:58 +0300 Subject: [PATCH] Sketch Point, Line, Circl & Arc have a base class SketchEntity --- src/SketchAPI/SketchAPI_Line.cpp | 10 +++++----- src/SketchAPI/SketchAPI_Line.h | 5 ++--- src/SketchAPI/SketchAPI_Sketch.cpp | 1 + src/SketchAPI/SketchAPI_Sketch.h | 10 ++++++++++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/SketchAPI/SketchAPI_Line.cpp b/src/SketchAPI/SketchAPI_Line.cpp index f36c91c88..d6be6744d 100644 --- a/src/SketchAPI/SketchAPI_Line.cpp +++ b/src/SketchAPI/SketchAPI_Line.cpp @@ -14,7 +14,7 @@ //-------------------------------------------------------------------------------------- SketchAPI_Line::SketchAPI_Line( const std::shared_ptr & theFeature) -: ModelHighAPI_Interface(theFeature) +: SketchAPI_SketchEntity(theFeature) { initialize(); } @@ -22,7 +22,7 @@ SketchAPI_Line::SketchAPI_Line( SketchAPI_Line::SketchAPI_Line( const std::shared_ptr & theFeature, double theX1, double theY1, double theX2, double theY2) -: ModelHighAPI_Interface(theFeature) +: SketchAPI_SketchEntity(theFeature) { if (initialize()) { setByCoordinates(theX1, theY1, theX2, theY2); @@ -33,7 +33,7 @@ SketchAPI_Line::SketchAPI_Line( const std::shared_ptr & theFeature, const std::shared_ptr & theStartPoint, const std::shared_ptr & theEndPoint) -: ModelHighAPI_Interface(theFeature) +: SketchAPI_SketchEntity(theFeature) { if (initialize()) { setByPoints(theStartPoint, theEndPoint); @@ -43,7 +43,7 @@ SketchAPI_Line::SketchAPI_Line( SketchAPI_Line::SketchAPI_Line( const std::shared_ptr & theFeature, const ModelHighAPI_Selection & theExternal ) -: ModelHighAPI_Interface(theFeature) +: SketchAPI_SketchEntity(theFeature) { if (initialize()) { setByExternal(theExternal); @@ -53,7 +53,7 @@ SketchAPI_Line::SketchAPI_Line( SketchAPI_Line::SketchAPI_Line( const std::shared_ptr & theFeature, const std::string & theExternalName ) -: ModelHighAPI_Interface(theFeature) +: SketchAPI_SketchEntity(theFeature) { if (initialize()) { setByExternalName(theExternalName); diff --git a/src/SketchAPI/SketchAPI_Line.h b/src/SketchAPI/SketchAPI_Line.h index 5796c66be..bdedb921b 100644 --- a/src/SketchAPI/SketchAPI_Line.h +++ b/src/SketchAPI/SketchAPI_Line.h @@ -14,8 +14,7 @@ #include -#include -#include +#include //-------------------------------------------------------------------------------------- class ModelHighAPI_Selection; //-------------------------------------------------------------------------------------- @@ -23,7 +22,7 @@ class ModelHighAPI_Selection; * \ingroup CPPHighAPI * \brief Interface for Line feature */ -class SketchAPI_Line : public ModelHighAPI_Interface +class SketchAPI_Line : public SketchAPI_SketchEntity { public: /// Constructor without values diff --git a/src/SketchAPI/SketchAPI_Sketch.cpp b/src/SketchAPI/SketchAPI_Sketch.cpp index 93d70ed93..e16966eca 100644 --- a/src/SketchAPI/SketchAPI_Sketch.cpp +++ b/src/SketchAPI/SketchAPI_Sketch.cpp @@ -107,4 +107,5 @@ std::shared_ptr SketchAPI_Sketch::addLine(const std::string & th std::shared_ptr aFeature = compositeFeature()->addFeature(SketchPlugin_Line::ID()); return LinePtr(new SketchAPI_Line(aFeature, theExternalName)); } + //-------------------------------------------------------------------------------------- diff --git a/src/SketchAPI/SketchAPI_Sketch.h b/src/SketchAPI/SketchAPI_Sketch.h index a85e8ef0d..cc8e3f64e 100644 --- a/src/SketchAPI/SketchAPI_Sketch.h +++ b/src/SketchAPI/SketchAPI_Sketch.h @@ -60,6 +60,8 @@ public: SKETCHAPI_EXPORT void setExternal(const ModelHighAPI_Selection & theExternal); + // TODO(spo): addPoint + /// Add line SKETCHAPI_EXPORT std::shared_ptr addLine( @@ -76,6 +78,14 @@ public: SKETCHAPI_EXPORT std::shared_ptr addLine(const std::string & theExternalName); + // TODO(spo): addCircle + // TODO(spo): addArc + + // TODO(spo): set* (constraints) + + // TODO(spo): setValue + // TODO(spo): setText + protected: std::shared_ptr compositeFeature() const; -- 2.39.2