Salome HOME
bugfix for libSketchSolver.so: removing unresolved symbols from the SketchPlugin
[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     switch (theNumber) {
62       case 0: return ENTITY_A();
63       case 1: return ENTITY_B();
64       case 2: return ENTITY_C();
65       case 3: return ENTITY_D();
66       default: break;
67     }
68     static const std::string EMPTY_STRING("");
69     return EMPTY_STRING;
70   }
71
72 protected:
73   /// \brief Use plugin manager for features creation
74   SketchPlugin_Constraint() {}
75 };
76
77 #endif