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