Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Line.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchPlugin_Line.h
4 // Created:     24 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef SketchPlugin_Line_H_
8 #define SketchPlugin_Line_H_
9
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_SketchEntity.h>
12 #include <SketchPlugin_Sketch.h>
13 #include <list>
14
15 /**\class SketchPlugin_Line
16  * \ingroup Plugins
17  * \brief Feature for creation of the new part in PartSet.
18  */
19 class SketchPlugin_Line : public SketchPlugin_SketchEntity
20 {
21  public:
22   /// Arc feature kind
23   inline static const std::string& ID()
24   {
25     static const std::string SKETCH_LINE_ID("SketchLine");
26     return SKETCH_LINE_ID;
27   }
28   /// Start 2D point of the line
29   inline static const std::string& START_ID()
30   {
31     static const std::string MY_START_ID("StartPoint");
32     return MY_START_ID;
33   }
34   /// End 2D point of the line
35   inline static const std::string& END_ID()
36   {
37     static const std::string MY_END_ID("EndPoint");
38     return MY_END_ID;
39   }
40
41   /// Returns the kind of a feature
42   SKETCHPLUGIN_EXPORT virtual const std::string& getKind();
43
44   /// Returns true is sketch element is under the rigid constraint
45   SKETCHPLUGIN_EXPORT virtual bool isFixed();
46
47   /// Creates a new part document if needed
48   SKETCHPLUGIN_EXPORT virtual void execute();
49
50   /// Request for initialization of data model of the feature: adding all attributes
51   SKETCHPLUGIN_EXPORT virtual void initAttributes();
52
53   /// Moves the feature
54   /// \param theDeltaX the delta for X coordinate is moved
55   /// \param theDeltaY the delta for Y coordinate is moved
56   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
57
58   /// Return the distance between the feature and the point
59   /// \param thePoint the point
60   virtual double distanceToPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
61
62   /// Called on change of any argument-attribute of this object
63   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
64
65   /// Use plugin manager for features creation
66   SketchPlugin_Line();
67 };
68
69 #endif