X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_MacroCircle.h;h=4e1bfeb22e049df6f5d63c5efa375095abccd5ab;hb=b5893b0a30fac08134c24de4565cb513a43affa6;hp=974a0eeb6c529dde433e03d7e9ef50901f76c964;hpb=17d8a9be9ff8975e7551160a82116a65e1203128;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_MacroCircle.h b/src/SketchPlugin/SketchPlugin_MacroCircle.h index 974a0eeb6..4e1bfeb22 100644 --- a/src/SketchPlugin/SketchPlugin_MacroCircle.h +++ b/src/SketchPlugin/SketchPlugin_MacroCircle.h @@ -7,6 +7,8 @@ #ifndef SketchPlugin_MacroCircle_H_ #define SketchPlugin_MacroCircle_H_ +#include + #include "SketchPlugin.h" #include "SketchPlugin_SketchEntity.h" @@ -21,7 +23,8 @@ class GeomAPI_Pnt2d; * \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