Salome HOME
Issue #2109 trim - wrong result due to constarints
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Circle.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchPlugin_Circle.h
4 // Created:     26 May 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef SketchPlugin_Circle_H_
8 #define SketchPlugin_Circle_H_
9
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_SketchEntity.h>
12 #include <SketchPlugin_Sketch.h>
13
14 /**\class SketchPlugin_Circle
15  * \ingroup Plugins
16  * \brief Feature for creation of the new circle in Sketch.
17  */
18 class SketchPlugin_Circle: public SketchPlugin_SketchEntity
19 {
20  public:
21   /// Circle feature kind
22   inline static const std::string& ID()
23   {
24     static const std::string ID("SketchCircle");
25     return ID;
26   }
27
28   /// 2D point - center of the circle
29   inline static const std::string& CENTER_ID()
30   {
31     static const std::string ID("circle_center");
32     return ID;
33   }
34
35   /// Radius of the circle
36   inline static const std::string& RADIUS_ID()
37   {
38     static const std::string ID("circle_radius");
39     return ID;
40   }
41
42   /// Returns the kind of a feature
43   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
44   {
45     static std::string MY_KIND = SketchPlugin_Circle::ID();
46     return MY_KIND;
47   }
48
49   /// Returns true is sketch element is under the rigid constraint
50   SKETCHPLUGIN_EXPORT virtual bool isFixed();
51
52   /// Called on change of any argument-attribute of this object
53   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
54
55   /// Creates a new part document if needed
56   SKETCHPLUGIN_EXPORT virtual void execute();
57
58   /// Moves the feature
59   /// \param theDeltaX the delta for X coordinate is moved
60   /// \param theDeltaY the delta for Y coordinate is moved
61   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
62
63   /// Use plugin manager for features creation
64   SketchPlugin_Circle();
65
66 protected:
67   /// \brief Initializes attributes of derived class.
68   virtual void initDerivedClassAttributes();
69 };
70
71 #endif