]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_Point.h
Salome HOME
Initial version of redesign of working with results
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Point.h
1 // File:    SketchPlugin_Point.h
2 // Created: 07 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_Point_HeaderFile
6 #define SketchPlugin_Point_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_Feature.h"
11 #include <list>
12
13 /// Point feature kind
14 const std::string SKETCH_POINT_KIND("SketchPoint");
15
16 /// Coordinates of the point
17 const std::string POINT_ATTR_COORD("PointCoordindates");
18
19 /**\class SketchPlugin_Point
20  * \ingroup DataModel
21  * \brief Feature for creation of a new point.
22  */
23 class SketchPlugin_Point: public SketchPlugin_Feature
24 {
25 public:
26   /// Returns the kind of a feature
27   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
28   {static std::string MY_KIND = SKETCH_POINT_KIND; return MY_KIND;}
29
30   /// Creates a new part document if needed
31   SKETCHPLUGIN_EXPORT virtual void execute(boost::shared_ptr<ModelAPI_Result>& theResult);
32
33   /// Request for initialization of data model of the feature: adding all attributes
34   SKETCHPLUGIN_EXPORT virtual void initAttributes();
35
36   /// Returns the AIS preview
37   SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
38                                 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
39
40   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
41   /// \param theFeature sub-feature
42   SKETCHPLUGIN_EXPORT virtual const void addSub(
43     const FeaturePtr& theFeature) {};
44
45   /// Moves the feature
46   /// \param theDeltaX the delta for X coordinate is moved
47   /// \param theDeltaY the delta for Y coordinate is moved
48   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
49
50   /// Return the distance between the feature and the point
51   /// \param thePoint the point
52   virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
53
54   /// Use plugin manager for features creation
55   SketchPlugin_Point();
56 };
57
58 #endif