1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketchSolver_IParameterWrapper.h
5 // Author: Artem ZHIDKOV
7 #ifndef SketchSolver_IParameterWrapper_H_
8 #define SketchSolver_IParameterWrapper_H_
10 #include <SketchSolver.h>
15 * Wrapper providing operations with parameters regardless the solver.
17 class SketchSolver_IParameterWrapper
20 virtual ~SketchSolver_IParameterWrapper() {}
22 /// \brief Return ID of current parameter
23 virtual ParameterID id() const = 0;
25 /// \brief Change group for the parameter
26 virtual void setGroup(const GroupID& theGroup) = 0;
27 /// \brief Return identifier of the group the parameter belongs to
28 virtual GroupID group() const = 0;
30 /// \brief Change value of parameter
31 virtual void setValue(double theValue) = 0;
32 /// \brief Return value of parameter
33 virtual double value() const = 0;
35 /// \brief Set or unset flag the parameter is given by expression
36 void setIsParametric(bool isParametric)
37 { myIsParametric = isParametric; }
38 /// \brief Show the parameter is an expression
39 bool isParametric() const
40 { return myIsParametric; }
42 /// \brief Compare current parameter with other
43 virtual bool isEqual(const std::shared_ptr<SketchSolver_IParameterWrapper>& theOther) = 0;
45 /// \brief Update value of parameter by the given one
46 /// \return \c true if the value of parameter is changed
47 virtual bool update(const std::shared_ptr<SketchSolver_IParameterWrapper>& theOther) = 0;
50 bool myIsParametric; ///< indicate the parameter is given by parametric expression
53 typedef std::shared_ptr<SketchSolver_IParameterWrapper> ParameterWrapperPtr;