SHAPER  9.12.0
SketchPlugin_Constraint.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef SketchPlugin_Constraint_H_
21 #define SketchPlugin_Constraint_H_
22 
23 #include <SketchPlugin_Feature.h>
24 
25 #include <string>
26 
28 const int CONSTRAINT_ATTR_SIZE = 4;
29 
35 {
36  public:
38  inline static const std::string& VALUE()
39  {
40  static const std::string MY_CONSTRAINT_VALUE("ConstraintValue");
41  return MY_CONSTRAINT_VALUE;
42  }
44  inline static const std::string& FLYOUT_VALUE_PNT()
45  {
46  static const std::string MY_FLYOUT_VALUE_PNT("ConstraintFlyoutValuePnt");
47  return MY_FLYOUT_VALUE_PNT;
48  }
50  inline static const std::string& ENTITY_A()
51  {
52  static const std::string MY_ENTITY_A("ConstraintEntityA");
53  return MY_ENTITY_A;
54  }
56  inline static const std::string& ENTITY_B()
57  {
58  static const std::string MY_ENTITY_B("ConstraintEntityB");
59  return MY_ENTITY_B;
60  }
62  inline static const std::string& ENTITY_C()
63  {
64  static const std::string MY_ENTITY_C("ConstraintEntityC");
65  return MY_ENTITY_C;
66  }
68  inline static const std::string& ENTITY_D()
69  {
70  static const std::string MY_ENTITY_D("ConstraintEntityD");
71  return MY_ENTITY_D;
72  }
73 
75  inline static const std::string& ATTRIBUTE(const int theNumber)
76  {
77  switch (theNumber) {
78  case 0:
79  return ENTITY_A();
80  case 1:
81  return ENTITY_B();
82  case 2:
83  return ENTITY_C();
84  case 3:
85  return ENTITY_D();
86  default:
87  break;
88  }
89  static const std::string EMPTY_STRING("");
90  return EMPTY_STRING;
91  }
92 
93  protected:
96 };
97 
98 typedef std::shared_ptr<SketchPlugin_Constraint> ConstraintPtr;
99 
100 #endif
Abstract interface to the SketchPlugin_ConstraintBase For more info see: SketchPlugin_ConstraintBase....
Definition: SketchPlugin_Constraint.h:35
SketchPlugin_Constraint()
Use plugin manager for features creation.
Definition: SketchPlugin_Constraint.cpp:22
static const std::string & FLYOUT_VALUE_PNT()
The 2D value parameter for the constraint.
Definition: SketchPlugin_Constraint.h:44
static const std::string & ENTITY_A()
First entity for the constraint.
Definition: SketchPlugin_Constraint.h:50
static const std::string & ENTITY_D()
Fourth entity for the constraint.
Definition: SketchPlugin_Constraint.h:68
static const std::string & VALUE()
The value parameter for the constraint.
Definition: SketchPlugin_Constraint.h:38
static const std::string & ENTITY_B()
Second entity for the constraint.
Definition: SketchPlugin_Constraint.h:56
static const std::string & ENTITY_C()
Third entity for the constraint.
Definition: SketchPlugin_Constraint.h:62
static const std::string & ATTRIBUTE(const int theNumber)
List of constraint attributes.
Definition: SketchPlugin_Constraint.h:75
Feature for creation of the new feature in PartSet.
Definition: SketchPlugin_Feature.h:40