1 // Copyright (C) 2017-2023 CEA, EDF
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 #ifndef SketchPlugin_EllipticArc_H_
21 #define SketchPlugin_EllipticArc_H_
23 #include <SketchPlugin.h>
24 #include <SketchPlugin_SketchEntity.h>
26 /**\class SketchPlugin_EllipticArc
28 * \brief Feature for creation of the new elliptic arc in Sketch.
30 class SketchPlugin_EllipticArc: public SketchPlugin_SketchEntity
33 /// Ellipse feature kind
34 inline static const std::string& ID()
36 static const std::string ID("SketchEllipticArc");
40 /// 2D point - center of the ellipse
41 inline static const std::string& CENTER_ID()
43 static const std::string ID("ellipse_center");
47 /// 2D point - start point of elliptic arc
48 inline static const std::string& START_POINT_ID()
50 static const std::string ID("start_point");
53 /// 2D point - end point of elliptic arc
54 inline static const std::string& END_POINT_ID()
56 static const std::string ID("end_point");
60 /// 2D point - focus of the ellipse
61 inline static const std::string& FIRST_FOCUS_ID()
63 static const std::string ID("ellipse_first_focus");
66 /// 2D point - second focus of the ellipse
67 inline static const std::string& SECOND_FOCUS_ID()
69 static const std::string ID("ellipse_second_focus");
73 /// 2D point - start point of major axis
74 inline static const std::string& MAJOR_AXIS_START_ID()
76 static const std::string ID("ellipse_major_axis_start_point");
79 /// 2D point - end point of major axis
80 inline static const std::string& MAJOR_AXIS_END_ID()
82 static const std::string ID("ellipse_major_axis_end_point");
86 /// 2D point - start point of minor axis
87 inline static const std::string& MINOR_AXIS_START_ID()
89 static const std::string ID("ellipse_minor_axis_start_point");
92 /// 2D point - end point of minor axis
93 inline static const std::string& MINOR_AXIS_END_ID()
95 static const std::string ID("ellipse_minor_axis_end_point");
99 /// Major radius of the ellipse
100 inline static const std::string& MAJOR_RADIUS_ID()
102 static const std::string ID("ellipse_major_radius");
106 /// Minor radius of the ellipse
107 inline static const std::string& MINOR_RADIUS_ID()
109 static const std::string ID("ellipse_minor_radius");
113 /// Flag the arc is reversed
114 inline static const std::string& REVERSED_ID()
116 static const std::string ID("reversed");
120 /// Returns the kind of a feature
121 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
123 static std::string MY_KIND = SketchPlugin_EllipticArc::ID();
127 /// Returns true is sketch element is under the rigid constraint
128 SKETCHPLUGIN_EXPORT virtual bool isFixed();
130 /// Called on change of any argument-attribute of this object
131 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
133 /// Creates a new part document if needed
134 SKETCHPLUGIN_EXPORT virtual void execute();
136 /// Use plugin manager for features creation
137 SketchPlugin_EllipticArc();
140 /// \brief Initializes attributes of derived class.
141 virtual void initDerivedClassAttributes();
144 bool fillCharacteristicPoints();
146 void createEllipticArc(SketchPlugin_Sketch* theSketch);