Salome HOME
Dimensions move using ModelAPI_ObjectMovedMessage mechanism. Move by deltas is obsole...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Ellipse.h
1 // Copyright (C) 2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 // File:        SketchPlugin_Ellipse.h
22 // Created:     26 April 2017
23 // Author:      Artem ZHIDKOV
24
25 #ifndef SketchPlugin_Ellipse_H_
26 #define SketchPlugin_Ellipse_H_
27
28 #include <SketchPlugin.h>
29 #include <SketchPlugin_SketchEntity.h>
30
31 /**\class SketchPlugin_Ellipse
32  * \ingroup Plugins
33  * \brief Feature for creation of the new ellipse in Sketch.
34  */
35 class SketchPlugin_Ellipse: public SketchPlugin_SketchEntity
36 {
37  public:
38   /// Ellipse feature kind
39   inline static const std::string& ID()
40   {
41     static const std::string ID("SketchEllipse");
42     return ID;
43   }
44
45   /// 2D point - center of the ellipse
46   inline static const std::string& CENTER_ID()
47   {
48     static const std::string ID("ellipse_center");
49     return ID;
50   }
51
52   /// 2D point - focus of the ellipse
53   inline static const std::string& FOCUS_ID()
54   {
55     static const std::string ID("ellipse_focus");
56     return ID;
57   }
58
59   /// Major radius of the ellipse
60   inline static const std::string& MAJOR_RADIUS_ID()
61   {
62     static const std::string ID("ellipse_major_radius");
63     return ID;
64   }
65
66   /// Minor radius of the ellipse
67   inline static const std::string& MINOR_RADIUS_ID()
68   {
69     static const std::string ID("ellipse_minor_radius");
70     return ID;
71   }
72
73   /// Returns the kind of a feature
74   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
75   {
76     static std::string MY_KIND = SketchPlugin_Ellipse::ID();
77     return MY_KIND;
78   }
79
80   /// Returns true is sketch element is under the rigid constraint
81   SKETCHPLUGIN_EXPORT virtual bool isFixed();
82
83   /// Called on change of any argument-attribute of this object
84   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
85
86   /// Creates a new part document if needed
87   SKETCHPLUGIN_EXPORT virtual void execute();
88
89   /// Use plugin manager for features creation
90   SketchPlugin_Ellipse();
91
92 protected:
93   /// \brief Initializes attributes of derived class.
94   virtual void initDerivedClassAttributes();
95 };
96
97 #endif