1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_Point.h
4 // Created: 07 May 2014
5 // Author: Artem ZHIDKOV
7 #ifndef SketchPlugin_Point_H_
8 #define SketchPlugin_Point_H_
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_Sketch.h>
12 #include "SketchPlugin_Feature.h"
15 /**\class SketchPlugin_Point
17 * \brief Feature for creation of a new point.
19 class SketchPlugin_Point : public SketchPlugin_Feature
22 /// Point feature kind
23 inline static const std::string& ID()
25 static const std::string MY_POINT_ID("SketchPoint");
28 /// Coordinates of the point
29 inline static const std::string& COORD_ID()
31 static const std::string MY_COORD_ID("PointCoordindates");
34 /// Returns the kind of a feature
35 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
37 static std::string MY_KIND = SketchPlugin_Point::ID();
41 /// Returns true is sketch element is under the rigid constraint
42 SKETCHPLUGIN_EXPORT virtual bool isFixed();
44 /// Creates a new part document if needed
45 SKETCHPLUGIN_EXPORT virtual void execute();
47 /// Request for initialization of data model of the feature: adding all attributes
48 SKETCHPLUGIN_EXPORT virtual void initAttributes();
50 /// Returns the AIS preview
51 virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
53 return simpleAISObject(firstResult(), thePrevious);
57 /// \param theDeltaX the delta for X coordinate is moved
58 /// \param theDeltaY the delta for Y coordinate is moved
59 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
61 /// Return the distance between the feature and the point
62 /// \param thePoint the point
63 virtual double distanceToPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
65 /// Use plugin manager for features creation