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