1 // Copyright (C) 2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 // File: SketchPlugin_Ellipse.h
22 // Created: 26 April 2017
23 // Author: Artem ZHIDKOV
25 #ifndef SketchPlugin_Ellipse_H_
26 #define SketchPlugin_Ellipse_H_
28 #include <SketchPlugin.h>
29 #include <SketchPlugin_SketchEntity.h>
31 /**\class SketchPlugin_Ellipse
33 * \brief Feature for creation of the new ellipse in Sketch.
35 class SketchPlugin_Ellipse: public SketchPlugin_SketchEntity
38 /// Ellipse feature kind
39 inline static const std::string& ID()
41 static const std::string ID("SketchEllipse");
45 /// 2D point - center of the ellipse
46 inline static const std::string& CENTER_ID()
48 static const std::string ID("ellipse_center");
52 /// 2D point - focus of the ellipse
53 inline static const std::string& FOCUS_ID()
55 static const std::string ID("ellipse_focus");
59 /// Major radius of the ellipse
60 inline static const std::string& MAJOR_RADIUS_ID()
62 static const std::string ID("ellipse_major_radius");
66 /// Minor radius of the ellipse
67 inline static const std::string& MINOR_RADIUS_ID()
69 static const std::string ID("ellipse_minor_radius");
73 /// Returns the kind of a feature
74 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
76 static std::string MY_KIND = SketchPlugin_Ellipse::ID();
80 /// Returns true is sketch element is under the rigid constraint
81 SKETCHPLUGIN_EXPORT virtual bool isFixed();
83 /// Called on change of any argument-attribute of this object
84 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
86 /// Creates a new part document if needed
87 SKETCHPLUGIN_EXPORT virtual void execute();
89 /// Use plugin manager for features creation
90 SketchPlugin_Ellipse();
93 /// \brief Initializes attributes of derived class.
94 virtual void initDerivedClassAttributes();