Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintParallel.h
1 // File:    SketchPlugin_ConstraintParallel.h
2 // Created: 26 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_ConstraintParallel_H_
6 #define SketchPlugin_ConstraintParallel_H_
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_ConstraintBase.h"
11
12 #define PARALLEL_COLOR "#ffff00"
13
14 /** \class SketchPlugin_ConstraintParallel
15  *  \ingroup DataModel
16  *  \brief Feature for creation of a new constraint parallelism of two lines
17  *
18  *  These constraint has two attributes:
19  *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
20  */
21 class SketchPlugin_ConstraintParallel : public SketchPlugin_ConstraintBase
22 {
23  public:
24   /// Parallel constraint kind
25   inline static const std::string& ID()
26   {
27     static const std::string MY_CONSTRAINT_PARALLEL_ID("SketchConstraintParallel");
28     return MY_CONSTRAINT_PARALLEL_ID;
29   }
30   /// \brief Returns the kind of a feature
31   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
32   {
33     static std::string MY_KIND = SketchPlugin_ConstraintParallel::ID();
34     return MY_KIND;
35   }
36
37   /// \brief Creates a new part document if needed
38   SKETCHPLUGIN_EXPORT virtual void execute();
39
40   /// \brief Request for initialization of data model of the feature: adding all attributes
41   SKETCHPLUGIN_EXPORT virtual void initAttributes();
42
43   /// Returns the AIS preview
44   SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
45
46   /// Moves the feature
47   /// \param theDeltaX the delta for X coordinate is moved
48   /// \param theDeltaY the delta for Y coordinate is moved
49   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
50
51   /// \brief Use plugin manager for features creation
52   SketchPlugin_ConstraintParallel();
53 };
54
55 #endif