Salome HOME
4520bf3a585e0c31a6cb0fad0e618715f519b76d
[modules/shaper.git] / src / SketchSolver / SketchSolver_Constraint.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_Constraint.h
4 // Created: 27 May 2014
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_Constraint_H_
8 #define SketchSolver_Constraint_H_
9
10 #include "SketchSolver.h"
11
12 #include <SketchPlugin_Constraint.h>
13
14 #include <string>
15 #include <vector>
16
17 /** \class   SketchSolver_Constraint
18  *  \ingroup DataModel
19  *  \brief   Obtain information about SketchPlugin's constraint
20  */
21 class SketchSolver_Constraint
22 {
23  public:
24   SketchSolver_Constraint();
25   SketchSolver_Constraint(std::shared_ptr<SketchPlugin_Constraint> theConstraint);
26
27   /** \brief Compute constraint type according to SolveSpace identifiers
28    *         and verify that constraint parameters are correct
29    *  \param[in]  theConstraint constraint which type should be determined
30    *  \return identifier of constraint type or SLVS_C_UNKNOWN if the type is wrong
31    */
32   const int& getType(std::shared_ptr<SketchPlugin_Constraint> theConstraint);
33   /// \brief Returns the type of myConstraint member
34   inline const int& getType() const
35   {
36     return myType;
37   }
38
39   /// \brief Returns list of attributes names in the correct order required by SolveSpace
40   inline const std::vector<std::string>& getAttributes() const
41   {
42     return myAttributesList;
43   }
44
45  private:
46   std::shared_ptr<SketchPlugin_Constraint> myConstraint;
47   int myType;
48   std::vector<std::string> myAttributesList;
49 };
50
51 #endif