1 // File: SketchPlugin_Arc.h
2 // Created: 26 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchPlugin_Arc_HeaderFile
6 #define SketchPlugin_Arc_HeaderFile
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Feature.h>
10 #include <SketchPlugin_Sketch.h>
13 const std::string SKETCH_ARC_KIND("SketchArc");
15 /// Central 2D point of the circle which contains the arc
16 const std::string ARC_ATTR_CENTER("ArcCenter");
17 /// Start 2D point of the arc
18 const std::string ARC_ATTR_START("ArcStartPoint");
19 /// End 2D point of the arc
20 const std::string ARC_ATTR_END("ArcEndPoint");
22 /**\class SketchPlugin_Arc
24 * \brief Feature for creation of the new arc of circle in PartSet.
26 class SketchPlugin_Arc: public SketchPlugin_Feature
29 /// Returns the kind of a feature
30 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
31 {static std::string MY_KIND = SKETCH_ARC_KIND; return MY_KIND;}
33 /// Creates an arc-shape
34 SKETCHPLUGIN_EXPORT virtual void execute();
36 /// Request for initialization of data model of the feature: adding all attributes
37 SKETCHPLUGIN_EXPORT virtual void initAttributes();
39 /// Returns the AIS preview
40 virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
41 boost::shared_ptr<GeomAPI_AISObject> thePrevious)
42 {return simpleAISObject(firstResult(), thePrevious);}
45 /// \param theDeltaX the delta for X coordinate is moved
46 /// \param theDeltaY the delta for Y coordinate is moved
47 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
49 /// Return the distance between the feature and the point
50 /// \param thePoint the point
51 virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
53 /// Use plugin manager for features creation