SHAPER  9.12.0
SketchPlugin_Arc.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef SketchPlugin_Arc_H_
21 #define SketchPlugin_Arc_H_
22 
23 #include "SketchPlugin.h"
24 
25 #include "SketchPlugin_SketchEntity.h"
26 
27 
28 
37 {
38  public:
40  inline static const std::string& ID()
41  {
42  static const std::string ID("SketchArc");
43  return ID;
44  }
45 
47  inline static const std::string& CENTER_ID()
48  {
49  static const std::string ID = "center_point";
50  return ID;
51  }
52 
54  inline static const std::string& START_ID()
55  {
56  static const std::string ID = "start_point";
57  return ID;
58  }
59 
61  inline static const std::string& END_ID()
62  {
63  static const std::string ID = "end_point";
64  return ID;
65  }
66 
68  static const std::string& RADIUS_ID()
69  {
70  static const std::string ID("radius");
71  return ID;
72  }
73 
75  static const std::string& ANGLE_ID()
76  {
77  static const std::string ID("angle");
78  return ID;
79  }
80 
82  inline static const std::string& REVERSED_ID()
83  {
84  static const std::string ID("reversed");
85  return ID;
86  }
87 
89  SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
90  {
91  static std::string MY_KIND = SketchPlugin_Arc::ID();
92  return MY_KIND;
93  }
94 
96  SKETCHPLUGIN_EXPORT virtual bool isFixed();
97 
100  SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
101 
103  SKETCHPLUGIN_EXPORT virtual void execute();
104 
107  void setReversed(bool isReversed);
108 
110  bool isReversed();
111 
114 
115 protected:
117  virtual void initDerivedClassAttributes();
118 
119 private:
121  double myParamBefore;
122 };
123 
124 #endif
Feature for creation of the new arc of circle in PartSet.
Definition: SketchPlugin_Arc.h:37
static const std::string & RADIUS_ID()
Arc radius.
Definition: SketchPlugin_Arc.h:68
virtual void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object.
Definition: SketchPlugin_Arc.cpp:163
static const std::string & END_ID()
End 2D point of the arc.
Definition: SketchPlugin_Arc.h:61
virtual bool isFixed()
Returns true is sketch element is under the rigid constraint.
Definition: SketchPlugin_Arc.cpp:158
virtual void execute()
Creates an arc-shape.
Definition: SketchPlugin_Arc.cpp:87
static const std::string & REVERSED_ID()
Reversed flag.
Definition: SketchPlugin_Arc.h:82
static const std::string & ANGLE_ID()
Arc angle.
Definition: SketchPlugin_Arc.h:75
static const std::string & CENTER_ID()
Central 2D point of the circle which contains the arc.
Definition: SketchPlugin_Arc.h:47
static const std::string & START_ID()
Start 2D point of the arc.
Definition: SketchPlugin_Arc.h:54
virtual void initDerivedClassAttributes()
Initializes attributes of derived class.
Definition: SketchPlugin_Arc.cpp:66
static const std::string & ID()
Arc feature kind.
Definition: SketchPlugin_Arc.h:40
virtual const std::string & getKind()
Returns the kind of a feature.
Definition: SketchPlugin_Arc.h:89
void setReversed(bool isReversed)
Updates the "reversed" flag.
Definition: SketchPlugin_Arc.cpp:289
bool isReversed()
Returns true is the arc is reversed.
Definition: SketchPlugin_Arc.cpp:294
SketchPlugin_Arc()
Use plugin manager for features creation.
Definition: SketchPlugin_Arc.cpp:60
Sketch Entity for creation of the new feature in PartSet.
Definition: SketchPlugin_SketchEntity.h:45