1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SolveSpaceSolver_ConstraintWrapper.h
5 // Author: Artem ZHIDKOV
7 #ifndef SolveSpaceSolver_ConstraintWrapper_H_
8 #define SolveSpaceSolver_ConstraintWrapper_H_
10 #include <SketchSolver_IConstraintWrapper.h>
11 #include <SolveSpaceSolver_Solver.h>
15 * Wrapper providing operations with SovleSpace constraints.
17 class SolveSpaceSolver_ConstraintWrapper : public SketchSolver_IConstraintWrapper
20 SolveSpaceSolver_ConstraintWrapper(const ConstraintPtr& theOriginal,
21 const Slvs_Constraint& theConstraint);
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; }
30 /// \brief Return ID of current entity
31 virtual ConstraintID id() const;
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; }
39 /// \brief Return type of current entity
40 virtual SketchSolver_ConstraintType type() const;
42 /// \brief Assign numeric parameter of constraint
43 virtual void setValue(const double& theValue);
45 /// \brief Verify the feature is used in the constraint
46 virtual bool isUsed(FeaturePtr theFeature) const;
47 /// \brief Verify the attribute is used in the constraint
48 virtual bool isUsed(AttributePtr theAttribute) const;
50 /// \brief Compare current constraint with other
51 virtual bool isEqual(const ConstraintWrapperPtr& theOther);
53 /// \brief Update values of parameters of this constraint by the parameters of given one
54 /// \return \c true if some parameters change their values
55 virtual bool update(const std::shared_ptr<SketchSolver_IConstraintWrapper>& theOther);
58 Slvs_Constraint mySlvsConstraint;