1 // File: SketchPlugin_Point.h
2 // Created: 07 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchPlugin_Point_HeaderFile
6 #define SketchPlugin_Point_HeaderFile
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_Feature.h"
13 /**\class SketchPlugin_Point
15 * \brief Feature for creation of a new point.
17 class SketchPlugin_Point: public SketchPlugin_Feature
20 /// Point feature kind
21 inline static const std::string& ID()
23 static const std::string MY_POINT_ID("SketchPoint");
26 /// Coordinates of the point
27 inline static const std::string& COORD_ID()
29 static const std::string MY_COORD_ID("PointCoordindates");
32 /// Returns the kind of a feature
33 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
34 {static std::string MY_KIND = SketchPlugin_Point::ID(); return MY_KIND;}
36 /// Creates a new part document if needed
37 SKETCHPLUGIN_EXPORT virtual void execute();
39 /// Request for initialization of data model of the feature: adding all attributes
40 SKETCHPLUGIN_EXPORT virtual void initAttributes();
42 /// Returns the AIS preview
43 virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
44 boost::shared_ptr<GeomAPI_AISObject> thePrevious)
45 {return simpleAISObject(firstResult(), thePrevious);}
48 /// \param theDeltaX the delta for X coordinate is moved
49 /// \param theDeltaY the delta for Y coordinate is moved
50 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
52 /// Return the distance between the feature and the point
53 /// \param thePoint the point
54 virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
56 /// Use plugin manager for features creation