X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_MacroCircle.h;h=4e1bfeb22e049df6f5d63c5efa375095abccd5ab;hb=b5893b0a30fac08134c24de4565cb513a43affa6;hp=05a2d301be328860fe5d3f17d16c87d1a08b38ca;hpb=7ce002afbdd690bc3b278a15fe88439af53ac9e7;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_MacroCircle.h b/src/SketchPlugin/SketchPlugin_MacroCircle.h index 05a2d301b..4e1bfeb22 100644 --- a/src/SketchPlugin/SketchPlugin_MacroCircle.h +++ b/src/SketchPlugin/SketchPlugin_MacroCircle.h @@ -7,21 +7,24 @@ #ifndef SketchPlugin_MacroCircle_H_ #define SketchPlugin_MacroCircle_H_ +#include + #include "SketchPlugin.h" -#include "SketchPlugin_Sketch.h" #include "SketchPlugin_SketchEntity.h" #include -#include -#include + +class GeomAPI_Circ2d; +class GeomAPI_Pnt2d; /**\class SketchPlugin_MacroCircle * \ingroup Plugins * \brief Feature for creation of the new circle in Sketch. */ class SketchPlugin_MacroCircle: public SketchPlugin_SketchEntity, - public GeomAPI_IPresentable + public GeomAPI_IPresentable, + public ModelAPI_IReentrant { public: /// Circle feature kind @@ -37,6 +40,12 @@ class SketchPlugin_MacroCircle: public SketchPlugin_SketchEntity, return ID; } + inline static const std::string& EDIT_CIRCLE_TYPE() + { + static const std::string ID("edit_circle_type"); + return ID; + } + /// Creation method by center and passed point. inline static const std::string& CIRCLE_TYPE_BY_CENTER_AND_PASSED_POINTS() { @@ -159,18 +168,27 @@ class SketchPlugin_MacroCircle: public SketchPlugin_SketchEntity, SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;}; + /// Apply information of the message to current object. It fills reference object, + /// tangent type and tangent point refence in case of tangent arc + virtual std::string processEvent(const std::shared_ptr& theMessage); + /// Use plugin manager for features creation SketchPlugin_MacroCircle(); private: - void createCircleByCenterAndPassed(); - void createCircleByThreePoints(); + void fillByCenterAndPassed(); + void fillByThreePoints(); + /// set fields if only two of three points is initialized + void fillByTwoPassedPoints(); + + void constraintsForCircleByCenterAndPassed(FeaturePtr theCircleFeature); + void constraintsForCircleByThreePoints(FeaturePtr theCircleFeature); - FeaturePtr createCircleFeature(const std::shared_ptr& theCircle); + FeaturePtr createCircleFeature(); private: std::shared_ptr myCenter; - double myRadius; + double myRadius; }; #endif