20 #ifndef SketchPlugin_MacroEllipticArc_H_
21 #define SketchPlugin_MacroEllipticArc_H_
23 #include <ModelAPI_IReentrant.h>
24 #include <SketchPlugin.h>
25 #include <SketchPlugin_SketchEntity.h>
26 #include <GeomAPI_IPresentable.h>
41 inline static const std::string&
ID()
43 static const std::string
ID(
"SketchMacroEllipticArc");
50 static const std::string
ID(
"center");
57 static const std::string
ID(
"center_ref");
64 static const std::string
ID(
"major_axis_point");
71 static const std::string
ID(
"major_axis_point_ref");
78 static const std::string
ID(
"start_point");
85 static const std::string
ID(
"start_point_ref");
92 static const std::string
ID(
"end_point");
99 static const std::string
ID(
"end_point_ref");
106 static const std::string
ID(
"major_radius");
113 static const std::string
ID(
"minor_radius");
120 static const std::string
ID(
"reversed");
125 SKETCHPLUGIN_EXPORT
virtual const std::string&
getKind()
135 SKETCHPLUGIN_EXPORT
virtual void attributeChanged(
const std::string& theID);
138 virtual AISObjectPtr
getAISObject(AISObjectPtr thePrevious);
141 SKETCHPLUGIN_EXPORT
virtual void execute();
145 SKETCHPLUGIN_EXPORT
virtual bool isMacro()
const
153 virtual std::string
processEvent(
const std::shared_ptr<Events_Message>& theMessage);
159 std::shared_ptr<GeomAPI_Shape> getArcShape();
161 FeaturePtr createEllipticArcFeature();
162 void constraintsForEllipticArc(FeaturePtr theEllipticArc);
165 std::shared_ptr<GeomAPI_Pnt2d> myCenter;
166 std::shared_ptr<GeomAPI_Pnt2d> myMajorAxis;
167 std::shared_ptr<GeomAPI_Pnt2d> myStartPnt;
168 std::shared_ptr<GeomAPI_Pnt2d> myEndPnt;
169 double myMajorRadius;
170 double myMinorRadius;
A class which defines an interface of object which is able to create its own presentation.
Definition: GeomAPI_IPresentable.h:29
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
Interface to the topological shape object.
Definition: GeomAPI_Shape.h:43
Interface of a class which can process specific messages.
Definition: ModelAPI_IReentrant.h:35
Feature for creation of the new elliptic arc in Sketch.
Definition: SketchPlugin_MacroEllipticArc.h:38
static const std::string & ID()
Elliptic arc feature kind.
Definition: SketchPlugin_MacroEllipticArc.h:41
virtual SKETCHPLUGIN_EXPORT void execute()
Creates a new part document if needed.
Definition: SketchPlugin_MacroEllipticArc.cpp:84
static const std::string & MINOR_RADIUS_ID()
Minor radius of the ellipse.
Definition: SketchPlugin_MacroEllipticArc.h:111
SketchPlugin_MacroEllipticArc()
Use plugin manager for features creation.
Definition: SketchPlugin_MacroEllipticArc.cpp:50
static const std::string & CENTER_ID()
Attribute for the central point selected during elliptic arc creation.
Definition: SketchPlugin_MacroEllipticArc.h:48
virtual std::string processEvent(const std::shared_ptr< Events_Message > &theMessage)
Apply information of the message to current object.
Definition: SketchPlugin_MacroEllipticArc.cpp:186
static const std::string & START_POINT_ID()
Attribute for the start point of the elliptic arc selected during creation.
Definition: SketchPlugin_MacroEllipticArc.h:76
static const std::string & START_POINT_REF_ID()
Reference for the start point selection.
Definition: SketchPlugin_MacroEllipticArc.h:83
static const std::string & CENTER_REF_ID()
Reference to the first selected point (center of ellipse).
Definition: SketchPlugin_MacroEllipticArc.h:55
virtual SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object.
Definition: SketchPlugin_MacroEllipticArc.cpp:97
static const std::string & MAJOR_AXIS_POINT_ID()
Attribute for the point on major semi-axis selected during elliptic arc creation.
Definition: SketchPlugin_MacroEllipticArc.h:62
static const std::string & MAJOR_AXIS_POINT_REF_ID()
Reference to the second selected point (major semi-axis of the ellipse).
Definition: SketchPlugin_MacroEllipticArc.h:69
virtual SKETCHPLUGIN_EXPORT bool isPreviewNeeded() const
Returns true if preview update during the edition needed.
Definition: SketchPlugin_MacroEllipticArc.h:148
virtual SKETCHPLUGIN_EXPORT bool isMacro() const
Reimplemented from ModelAPI_Feature::isMacro().
Definition: SketchPlugin_MacroEllipticArc.h:145
virtual SKETCHPLUGIN_EXPORT void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: SketchPlugin_MacroEllipticArc.cpp:58
static const std::string & END_POINT_REF_ID()
Reference for the end point selection.
Definition: SketchPlugin_MacroEllipticArc.h:97
static const std::string & REVERSED_ID()
Flag the arc is reversed.
Definition: SketchPlugin_MacroEllipticArc.h:118
static const std::string & MAJOR_RADIUS_ID()
Major radius of the ellipse.
Definition: SketchPlugin_MacroEllipticArc.h:104
static const std::string & END_POINT_ID()
Attribute for the end point of the elliptic arc selected during creation.
Definition: SketchPlugin_MacroEllipticArc.h:90
virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
Returns the AIS preview.
Definition: SketchPlugin_MacroEllipticArc.cpp:335
virtual SKETCHPLUGIN_EXPORT const std::string & getKind()
Returns the kind of a feature.
Definition: SketchPlugin_MacroEllipticArc.h:125
Sketch Entity for creation of the new feature in PartSet.
Definition: SketchPlugin_SketchEntity.h:45