1 // Copyright (C) 2014-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_Arc_H_
21 #define SketchPlugin_Arc_H_
23 #include "SketchPlugin.h"
25 #include "SketchPlugin_SketchEntity.h"
29 /**\class SketchPlugin_Arc
31 * \brief Feature for creation of the new arc of circle in PartSet.
32 * The visualization of this object is separated in two parts. The first one is an AIS object
33 * calculated when there is non-initialized attributes of the arc. The second is a result and
34 * it is calculated if all attributes are initialized.
36 class SketchPlugin_Arc: public SketchPlugin_SketchEntity
40 inline static const std::string& ID()
42 static const std::string ID("SketchArc");
46 /// Central 2D point of the circle which contains the arc
47 inline static const std::string& CENTER_ID()
49 static const std::string ID = "center_point";
53 /// Start 2D point of the arc
54 inline static const std::string& START_ID()
56 static const std::string ID = "start_point";
60 /// End 2D point of the arc
61 inline static const std::string& END_ID()
63 static const std::string ID = "end_point";
68 static const std::string& RADIUS_ID()
70 static const std::string ID("radius");
75 static const std::string& ANGLE_ID()
77 static const std::string ID("angle");
82 inline static const std::string& REVERSED_ID()
84 static const std::string ID("reversed");
88 /// Returns the kind of a feature
89 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
91 static std::string MY_KIND = SketchPlugin_Arc::ID();
95 /// Returns true is sketch element is under the rigid constraint
96 SKETCHPLUGIN_EXPORT virtual bool isFixed();
98 /// Called on change of any argument-attribute of this object
99 /// \param theID identifier of changed attribute
100 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
102 /// Creates an arc-shape
103 SKETCHPLUGIN_EXPORT virtual void execute();
105 /// Updates the "reversed" flag
106 /// \param isReversed whether the arc will be reversed
107 void setReversed(bool isReversed);
109 /// Returns \c true is the arc is reversed
112 /// Use plugin manager for features creation
116 /// \brief Initializes attributes of derived class.
117 virtual void initDerivedClassAttributes();
120 /// to define in which direction draw arc
121 double myParamBefore;