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