1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PlaneGCSSolver_ConstraintWrapper.h
4 // Created: 14 Dec 2015
5 // Author: Artem ZHIDKOV
7 #ifndef PlaneGCSSolver_ConstraintWrapper_H_
8 #define PlaneGCSSolver_ConstraintWrapper_H_
10 #include <PlaneGCSSolver_Defs.h>
11 #include <PlaneGCSSolver_Solver.h>
12 #include <SketchSolver_IConstraintWrapper.h>
16 * Wrapper providing operations with SovleSpace constraints.
18 class PlaneGCSSolver_ConstraintWrapper : public SketchSolver_IConstraintWrapper
21 PlaneGCSSolver_ConstraintWrapper(const ConstraintPtr& theOriginal,
22 const GCSConstraintPtr& theConstraint,
23 const SketchSolver_ConstraintType& theType);
24 PlaneGCSSolver_ConstraintWrapper(const ConstraintPtr& theOriginal,
25 const std::list<GCSConstraintPtr>& theConstraints,
26 const SketchSolver_ConstraintType& theType);
28 /// \brief Return list of constraints
29 const std::list<GCSConstraintPtr>& constraints() const
30 { return myGCSConstraints; }
31 /// \brief Change list of constraints
32 void setConstraints(const std::list<GCSConstraintPtr>& theConstraints)
33 { myGCSConstraints = theConstraints; }
35 /// \brief Return ID of current entity
36 virtual ConstraintID id() const
38 /// \brief Change constraint ID
39 void setId( const ConstraintID& theID);
41 /// \brief Change group for the constraint
42 virtual void setGroup(const GroupID& theGroup);
43 /// \brief Return identifier of the group the constraint belongs to
44 virtual GroupID group() const
47 /// \brief Return type of current entity
48 virtual SketchSolver_ConstraintType type() const
51 /// \brief Assign numeric parameter of constraint
52 virtual void setValue(const double& theValue);
54 /// \brief Change parameter representing the value of constraint
55 void setValueParameter(const ParameterWrapperPtr& theValue);
56 /// \brief Return parametric representation of constraint value
57 const ParameterWrapperPtr& valueParameter() const
58 { return myValueParam; }
60 /// \brief Verify the feature is used in the constraint
61 virtual bool isUsed(FeaturePtr theFeature) const;
62 /// \brief Verify the attribute is used in the constraint
63 virtual bool isUsed(AttributePtr theAttribute) const;
65 /// \brief Compare current constraint with other
66 virtual bool isEqual(const ConstraintWrapperPtr& theOther);
68 /// \brief Update values of parameters of this constraint by the parameters of given one
69 /// \return \c true if some parameters change their values
70 virtual bool update(const std::shared_ptr<SketchSolver_IConstraintWrapper>& theOther);
75 SketchSolver_ConstraintType myType;
76 ParameterWrapperPtr myValueParam;
77 std::list<GCSConstraintPtr> myGCSConstraints;