Salome HOME
c621c58f562539c7bf06f93233ec821e3ea4330d
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Constraint.h
1 // File:    SketchPlugin_Constraint.h
2 // Created: 08 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_Constraint_H_
6 #define SketchPlugin_Constraint_H_
7
8 #include <SketchPlugin_Feature.h>
9
10 #include <string>
11
12 /// Size of the list of constraint attributes
13 const unsigned int CONSTRAINT_ATTR_SIZE = 4;
14
15 /** \class SketchPlugin_Constraint
16  *  \brief Abstract interface to the SketchPlugin_ConstraintBase
17  *         For more info see: SketchPlugin_ConstraintBase.h
18  */
19 class SketchPlugin_Constraint : public SketchPlugin_Feature
20 {
21  public:
22   /// The value parameter for the constraint
23   inline static const std::string& VALUE()
24   {
25     static const std::string MY_CONSTRAINT_VALUE("ConstraintValue");
26     return MY_CONSTRAINT_VALUE;
27   }
28   /// The 2D value parameter for the constraint
29   inline static const std::string& FLYOUT_VALUE_PNT()
30   {
31     static const std::string MY_FLYOUT_VALUE_PNT("ConstraintFlyoutValuePnt");
32     return MY_FLYOUT_VALUE_PNT;
33   }
34   /// First entity for the constraint
35   inline static const std::string& ENTITY_A()
36   {
37     static const std::string MY_ENTITY_A("ConstraintEntityA");
38     return MY_ENTITY_A;
39   }
40   /// Second entity for the constraint
41   inline static const std::string& ENTITY_B()
42   {
43     static const std::string MY_ENTITY_B("ConstraintEntityB");
44     return MY_ENTITY_B;
45   }
46   /// Third entity for the constraint
47   inline static const std::string& ENTITY_C()
48   {
49     static const std::string MY_ENTITY_C("ConstraintEntityC");
50     return MY_ENTITY_C;
51   }
52   /// Fourth entity for the constraint
53   inline static const std::string& ENTITY_D()
54   {
55     static const std::string MY_ENTITY_D("ConstraintEntityD");
56     return MY_ENTITY_D;
57   }
58
59   /// List of constraint attributes
60   inline static const std::string& ATTRIBUTE(const int theNumber)
61   {
62     switch (theNumber) {
63       case 0:
64         return ENTITY_A();
65       case 1:
66         return ENTITY_B();
67       case 2:
68         return ENTITY_C();
69       case 3:
70         return ENTITY_D();
71       default:
72         break;
73     }
74     static const std::string EMPTY_STRING("");
75     return EMPTY_STRING;
76   }
77
78  protected:
79   /// \brief Use plugin manager for features creation
80   SketchPlugin_Constraint()
81   {
82   }
83 };
84
85 #endif