1 // Copyright (C) 2017-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_Ellipse.h
4 // Created: 26 April 2017
5 // Author: Artem ZHIDKOV
7 #ifndef SketchPlugin_Ellipse_H_
8 #define SketchPlugin_Ellipse_H_
10 #include <SketchPlugin.h>
11 #include <SketchPlugin_SketchEntity.h>
13 /**\class SketchPlugin_Ellipse
15 * \brief Feature for creation of the new ellipse in Sketch.
17 class SketchPlugin_Ellipse: public SketchPlugin_SketchEntity
20 /// Ellipse feature kind
21 inline static const std::string& ID()
23 static const std::string ID("SketchEllipse");
27 /// 2D point - center of the ellipse
28 inline static const std::string& CENTER_ID()
30 static const std::string ID("ellipse_center");
34 /// 2D point - focus of the ellipse
35 inline static const std::string& FOCUS_ID()
37 static const std::string ID("ellipse_focus");
41 /// Major radius of the ellipse
42 inline static const std::string& MAJOR_RADIUS_ID()
44 static const std::string ID("ellipse_major_radius");
48 /// Minor radius of the ellipse
49 inline static const std::string& MINOR_RADIUS_ID()
51 static const std::string ID("ellipse_minor_radius");
55 /// Returns the kind of a feature
56 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
58 static std::string MY_KIND = SketchPlugin_Ellipse::ID();
62 /// Returns true is sketch element is under the rigid constraint
63 SKETCHPLUGIN_EXPORT virtual bool isFixed();
65 /// Called on change of any argument-attribute of this object
66 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
68 /// Creates a new part document if needed
69 SKETCHPLUGIN_EXPORT virtual void execute();
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);
76 /// Use plugin manager for features creation
77 SketchPlugin_Ellipse();
80 /// \brief Initializes attributes of derived class.
81 virtual void initDerivedClassAttributes();