1 // Copyright (C) 2017-2019 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: SketchPlugin_Ellipse.h
21 // Created: 26 April 2017
22 // Author: Artem ZHIDKOV
24 #ifndef SketchPlugin_Ellipse_H_
25 #define SketchPlugin_Ellipse_H_
27 #include <SketchPlugin.h>
28 #include <SketchPlugin_SketchEntity.h>
30 /**\class SketchPlugin_Ellipse
32 * \brief Feature for creation of the new ellipse in Sketch.
34 class SketchPlugin_Ellipse: public SketchPlugin_SketchEntity
37 /// Ellipse feature kind
38 inline static const std::string& ID()
40 static const std::string ID("SketchEllipse");
44 /// 2D point - center of the ellipse
45 inline static const std::string& CENTER_ID()
47 static const std::string ID("ellipse_center");
51 /// 2D point - focus of the ellipse
52 inline static const std::string& FOCUS_ID()
54 static const std::string ID("ellipse_focus");
58 /// Major radius of the ellipse
59 inline static const std::string& MAJOR_RADIUS_ID()
61 static const std::string ID("ellipse_major_radius");
65 /// Minor radius of the ellipse
66 inline static const std::string& MINOR_RADIUS_ID()
68 static const std::string ID("ellipse_minor_radius");
72 /// Returns the kind of a feature
73 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
75 static std::string MY_KIND = SketchPlugin_Ellipse::ID();
79 /// Returns true is sketch element is under the rigid constraint
80 SKETCHPLUGIN_EXPORT virtual bool isFixed();
82 /// Called on change of any argument-attribute of this object
83 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
85 /// Creates a new part document if needed
86 SKETCHPLUGIN_EXPORT virtual void execute();
88 /// Use plugin manager for features creation
89 SketchPlugin_Ellipse();
92 /// \brief Initializes attributes of derived class.
93 virtual void initDerivedClassAttributes();