1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_Arc.h
4 // Created: 26 May 2014
5 // Author: Artem ZHIDKOV
7 #ifndef SketchPlugin_Arc_H_
8 #define SketchPlugin_Arc_H_
10 #include "SketchPlugin.h"
12 #include "SketchPlugin_SketchEntity.h"
16 /**\class SketchPlugin_Arc
18 * \brief Feature for creation of the new arc of circle in PartSet.
19 * The visualization of this object is separated in two parts. The first one is an AIS object
20 * calculated when there is non-initialized attributes of the arc. The second is a result and
21 * it is calculated if all attributes are initialized.
23 class SketchPlugin_Arc: public SketchPlugin_SketchEntity
27 inline static const std::string& ID()
29 static const std::string ID("SketchArc");
33 /// Central 2D point of the circle which contains the arc
34 inline static const std::string& CENTER_ID()
36 static const std::string ID = "center_point";
40 /// Start 2D point of the arc
41 inline static const std::string& START_ID()
43 static const std::string ID = "start_point";
47 /// End 2D point of the arc
48 inline static const std::string& END_ID()
50 static const std::string ID = "end_point";
55 static const std::string& RADIUS_ID()
57 static const std::string ID("radius");
62 static const std::string& ANGLE_ID()
64 static const std::string ID("angle");
69 inline static const std::string& REVERSED_ID()
71 static const std::string ID("reversed");
75 /// Returns the kind of a feature
76 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
78 static std::string MY_KIND = SketchPlugin_Arc::ID();
82 /// Returns true is sketch element is under the rigid constraint
83 SKETCHPLUGIN_EXPORT virtual bool isFixed();
85 /// Called on change of any argument-attribute of this object
86 /// \param theID identifier of changed attribute
87 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
89 /// Creates an arc-shape
90 SKETCHPLUGIN_EXPORT virtual void execute();
93 /// \param theDeltaX the delta for X coordinate is moved
94 /// \param theDeltaY the delta for Y coordinate is moved
95 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
97 /// Updates the "reversed" flag
98 /// \param isReversed whether the arc will be reversed
99 void setReversed(bool isReversed);
101 /// Returns \c true is the arc is reversed
104 /// Use plugin manager for features creation
108 /// \brief Initializes attributes of derived class.
109 virtual void initDerivedClassAttributes();
112 /// to define in which direction draw arc
113 double myParamBefore;