Salome HOME
Radius dimension does not change the circle (issue #1399)
[modules/shaper.git] / src / SketchSolver / SolveSpaceSolver / SolveSpaceSolver_ConstraintWrapper.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SolveSpaceSolver_ConstraintWrapper.h
4 // Created: 2 Dec 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SolveSpaceSolver_ConstraintWrapper_H_
8 #define SolveSpaceSolver_ConstraintWrapper_H_
9
10 #include <SketchSolver_IConstraintWrapper.h>
11 #include <SolveSpaceSolver_Solver.h>
12
13
14 /**
15  *  Wrapper providing operations with SovleSpace constraints.
16  */
17 class SolveSpaceSolver_ConstraintWrapper : public SketchSolver_IConstraintWrapper
18 {
19 public:
20   SolveSpaceSolver_ConstraintWrapper(const ConstraintPtr&   theOriginal,
21                                      const Slvs_Constraint& theConstraint);
22
23   /// \brief Return SolveSpace constraint
24   const Slvs_Constraint& constraint() const
25   { return mySlvsConstraint; }
26   /// \brief Return SolveSpace constraint to change
27   Slvs_Constraint& changeConstraint()
28   { return mySlvsConstraint; }
29
30   /// \brief Return ID of current entity
31   virtual ConstraintID id() const;
32
33   /// \brief Change group for the constraint
34   virtual void setGroup(const GroupID& theGroup);
35   /// \brief Return identifier of the group the constraint belongs to
36   virtual GroupID group() const
37   { return (GroupID)mySlvsConstraint.group; }
38
39   /// \brief Return type of current entity
40   virtual SketchSolver_ConstraintType type() const;
41
42   /// \brief Verify the feature is used in the constraint
43   virtual bool isUsed(FeaturePtr theFeature) const;
44   /// \brief Verify the attribute is used in the constraint
45   virtual bool isUsed(AttributePtr theAttribute) const;
46
47   /// \brief Compare current constraint with other
48   virtual bool isEqual(const ConstraintWrapperPtr& theOther);
49
50   /// \brief Update values of parameters of this constraint by the parameters of given one
51   /// \return \c true if some parameters change their values
52   virtual bool update(const std::shared_ptr<SketchSolver_IConstraintWrapper>& theOther);
53
54 private:
55   Slvs_Constraint mySlvsConstraint;
56 };
57
58 #endif