]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_Ellipse.h
Salome HOME
Task 2.1. Creation of ellipses and arcs of ellipse.
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Ellipse.h
1 // Copyright (C) 2017-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchPlugin_Ellipse.h
4 // Created:     26 April 2017
5 // Author:      Artem ZHIDKOV
6
7 #ifndef SketchPlugin_Ellipse_H_
8 #define SketchPlugin_Ellipse_H_
9
10 #include <SketchPlugin.h>
11 #include <SketchPlugin_SketchEntity.h>
12
13 /**\class SketchPlugin_Ellipse
14  * \ingroup Plugins
15  * \brief Feature for creation of the new ellipse in Sketch.
16  */
17 class SketchPlugin_Ellipse: public SketchPlugin_SketchEntity
18 {
19  public:
20   /// Ellipse feature kind
21   inline static const std::string& ID()
22   {
23     static const std::string ID("SketchEllipse");
24     return ID;
25   }
26
27   /// 2D point - center of the ellipse
28   inline static const std::string& CENTER_ID()
29   {
30     static const std::string ID("ellipse_center");
31     return ID;
32   }
33
34   /// 2D point - focus of the ellipse
35   inline static const std::string& FOCUS_ID()
36   {
37     static const std::string ID("ellipse_focus");
38     return ID;
39   }
40
41   /// Major radius of the ellipse
42   inline static const std::string& MAJOR_RADIUS_ID()
43   {
44     static const std::string ID("ellipse_major_radius");
45     return ID;
46   }
47
48   /// Minor radius of the ellipse
49   inline static const std::string& MINOR_RADIUS_ID()
50   {
51     static const std::string ID("ellipse_minor_radius");
52     return ID;
53   }
54
55   /// Returns the kind of a feature
56   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
57   {
58     static std::string MY_KIND = SketchPlugin_Ellipse::ID();
59     return MY_KIND;
60   }
61
62   /// Returns true is sketch element is under the rigid constraint
63   SKETCHPLUGIN_EXPORT virtual bool isFixed();
64
65   /// Called on change of any argument-attribute of this object
66   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
67
68   /// Creates a new part document if needed
69   SKETCHPLUGIN_EXPORT virtual void execute();
70
71   /// Moves the feature
72   /// \param theDeltaX the delta for X coordinate is moved
73   /// \param theDeltaY the delta for Y coordinate is moved
74   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
75
76   /// Use plugin manager for features creation
77   SketchPlugin_Ellipse();
78
79 protected:
80   /// \brief Initializes attributes of derived class.
81   virtual void initDerivedClassAttributes();
82 };
83
84 #endif