20 #ifndef SketchPlugin_MacroEllipse_H_
21 #define SketchPlugin_MacroEllipse_H_
23 #include <ModelAPI_IReentrant.h>
24 #include <SketchPlugin.h>
25 #include <SketchPlugin_SketchEntity.h>
26 #include <GeomAPI_IPresentable.h>
40 inline static const std::string&
ID()
42 static const std::string
ID(
"SketchMacroEllipse");
46 static const std::string& ELLIPSE_TYPE()
48 static const std::string
ID(
"ellipse_type");
52 static const std::string& ELLIPSE_TYPE_BY_CENTER_AXIS_POINT()
54 static const std::string
ID(
"by_center_axis_point");
57 static const std::string& ELLIPSE_TYPE_BY_AXIS_AND_POINT()
59 static const std::string
ID(
"by_major_axis_and_point");
63 static const std::string& EDIT_ELLIPSE_TYPE()
65 static const std::string
ID(
"edit_ellipse_type");
72 static const std::string
ID(
"first_point");
79 static const std::string
ID(
"first_point_ref");
86 static const std::string
ID(
"second_point");
93 static const std::string
ID(
"second_point_ref");
100 static const std::string
ID(
"passed_point");
107 static const std::string
ID(
"passed_point_ref");
114 static const std::string
ID(
"first_point_1");
121 static const std::string
ID(
"first_point_ref_1");
128 static const std::string
ID(
"second_point_1");
135 static const std::string
ID(
"second_point_ref_1");
142 static const std::string
ID(
"passed_point_1");
149 static const std::string
ID(
"passed_point_ref_1");
156 static const std::string
ID(
"major_radius");
163 static const std::string
ID(
"minor_radius");
168 SKETCHPLUGIN_EXPORT
virtual const std::string&
getKind()
178 SKETCHPLUGIN_EXPORT
virtual void attributeChanged(
const std::string& theID);
181 virtual AISObjectPtr
getAISObject(AISObjectPtr thePrevious);
184 SKETCHPLUGIN_EXPORT
virtual void execute();
188 SKETCHPLUGIN_EXPORT
virtual bool isMacro()
const
196 virtual std::string
processEvent(
const std::shared_ptr<Events_Message>& theMessage);
202 void constraintsForEllipseByCenterAxisAndPassed(FeaturePtr theEllipseFeature);
203 void constraintsForEllipseByMajoxAxisAndPassed(FeaturePtr theEllipseFeature);
205 FeaturePtr createEllipseFeature();
208 std::shared_ptr<GeomAPI_Pnt2d> myCenter;
209 std::shared_ptr<GeomAPI_Pnt2d> myFocus;
210 double myMajorRadius;
211 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 of a class which can process specific messages.
Definition: ModelAPI_IReentrant.h:35
Feature for creation of the new ellipse in Sketch.
Definition: SketchPlugin_MacroEllipse.h:37
static const std::string & MAJOR_RADIUS_ID()
Major radius of the ellipse.
Definition: SketchPlugin_MacroEllipse.h:154
static const std::string & PASSED_POINT_REF_ID()
Reference for passed point selection.
Definition: SketchPlugin_MacroEllipse.h:105
virtual std::string processEvent(const std::shared_ptr< Events_Message > &theMessage)
Apply information of the message to current object.
Definition: SketchPlugin_MacroEllipse.cpp:208
static const std::string & MAJOR_AXIS_POINT_ID()
Attribute for the second point selected during ellipse creation.
Definition: SketchPlugin_MacroEllipse.h:84
static const std::string & MINOR_RADIUS_ID()
Minor radius of the ellipse.
Definition: SketchPlugin_MacroEllipse.h:161
virtual SKETCHPLUGIN_EXPORT void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: SketchPlugin_MacroEllipse.cpp:56
static const std::string & ID()
Ellipse feature kind.
Definition: SketchPlugin_MacroEllipse.h:40
static const std::string & CENTER_POINT_ID()
Attribute for the first point selected during ellipse creation.
Definition: SketchPlugin_MacroEllipse.h:70
virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
Returns the AIS preview.
Definition: SketchPlugin_MacroEllipse.cpp:356
static const std::string & MAJOR_AXIS_START_REF_ID()
Reference to the first selected point.
Definition: SketchPlugin_MacroEllipse.h:119
static const std::string & MAJOR_AXIS_START_ID()
Attribute for the first point selected during ellipse creation.
Definition: SketchPlugin_MacroEllipse.h:112
static const std::string & PASSED_POINT_ID()
Attribute for the third point selected during ellipse creation.
Definition: SketchPlugin_MacroEllipse.h:98
virtual SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object.
Definition: SketchPlugin_MacroEllipse.cpp:113
virtual SKETCHPLUGIN_EXPORT const std::string & getKind()
Returns the kind of a feature.
Definition: SketchPlugin_MacroEllipse.h:168
static const std::string & PASSED_POINT_1_REF_ID()
Reference for passed point selection.
Definition: SketchPlugin_MacroEllipse.h:147
virtual SKETCHPLUGIN_EXPORT bool isPreviewNeeded() const
Returns true if preview update during the edition needed.
Definition: SketchPlugin_MacroEllipse.h:191
static const std::string & MAJOR_AXIS_END_REF_ID()
Reference to the second selected point.
Definition: SketchPlugin_MacroEllipse.h:133
static const std::string & MAJOR_AXIS_END_ID()
Attribute for the second point selected during ellipse creation.
Definition: SketchPlugin_MacroEllipse.h:126
SketchPlugin_MacroEllipse()
Use plugin manager for features creation.
Definition: SketchPlugin_MacroEllipse.cpp:49
static const std::string & CENTER_POINT_REF_ID()
Reference to the first selected point.
Definition: SketchPlugin_MacroEllipse.h:77
virtual SKETCHPLUGIN_EXPORT bool isMacro() const
Reimplemented from ModelAPI_Feature::isMacro().
Definition: SketchPlugin_MacroEllipse.h:188
static const std::string & PASSED_POINT_1_ID()
Attribute for the third point selected during ellipse creation.
Definition: SketchPlugin_MacroEllipse.h:140
virtual SKETCHPLUGIN_EXPORT void execute()
Creates a new part document if needed.
Definition: SketchPlugin_MacroEllipse.cpp:92
static const std::string & MAJOR_AXIS_POINT_REF_ID()
Reference to the second selected point.
Definition: SketchPlugin_MacroEllipse.h:91
Sketch Entity for creation of the new feature in PartSet.
Definition: SketchPlugin_SketchEntity.h:45