1 // Copyright (C) 2014-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 #ifndef SketchPlugin_Arc_H_
22 #define SketchPlugin_Arc_H_
24 #include "SketchPlugin.h"
26 #include "SketchPlugin_SketchEntity.h"
30 /**\class SketchPlugin_Arc
32 * \brief Feature for creation of the new arc of circle in PartSet.
33 * The visualization of this object is separated in two parts. The first one is an AIS object
34 * calculated when there is non-initialized attributes of the arc. The second is a result and
35 * it is calculated if all attributes are initialized.
37 class SketchPlugin_Arc: public SketchPlugin_SketchEntity
41 inline static const std::string& ID()
43 static const std::string ID("SketchArc");
47 /// Central 2D point of the circle which contains the arc
48 inline static const std::string& CENTER_ID()
50 static const std::string ID = "center_point";
54 /// Start 2D point of the arc
55 inline static const std::string& START_ID()
57 static const std::string ID = "start_point";
61 /// End 2D point of the arc
62 inline static const std::string& END_ID()
64 static const std::string ID = "end_point";
69 static const std::string& RADIUS_ID()
71 static const std::string ID("radius");
76 static const std::string& ANGLE_ID()
78 static const std::string ID("angle");
83 inline static const std::string& REVERSED_ID()
85 static const std::string ID("reversed");
89 /// Returns the kind of a feature
90 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
92 static std::string MY_KIND = SketchPlugin_Arc::ID();
96 /// Returns true is sketch element is under the rigid constraint
97 SKETCHPLUGIN_EXPORT virtual bool isFixed();
99 /// Called on change of any argument-attribute of this object
100 /// \param theID identifier of changed attribute
101 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
103 /// Creates an arc-shape
104 SKETCHPLUGIN_EXPORT virtual void execute();
106 /// Moves the feature
107 /// \param theDeltaX the delta for X coordinate is moved
108 /// \param theDeltaY the delta for Y coordinate is moved
109 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
111 /// Updates the "reversed" flag
112 /// \param isReversed whether the arc will be reversed
113 void setReversed(bool isReversed);
115 /// Returns \c true is the arc is reversed
118 /// Use plugin manager for features creation
122 /// \brief Initializes attributes of derived class.
123 virtual void initDerivedClassAttributes();
126 /// to define in which direction draw arc
127 double myParamBefore;