Salome HOME
Fix incorrect DoF after dump-import loop (issue #1767)
[modules/shaper.git] / src / SketchSolver / SketchSolver_IParameterWrapper.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_IParameterWrapper.h
4 // Created: 1 Dec 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_IParameterWrapper_H_
8 #define SketchSolver_IParameterWrapper_H_
9
10 #include <SketchSolver.h>
11
12 #include <memory>
13
14 /**
15  *  Wrapper providing operations with parameters regardless the solver.
16  */
17 class SketchSolver_IParameterWrapper
18 {
19 public:
20   virtual ~SketchSolver_IParameterWrapper() {}
21
22   /// \brief Return ID of current parameter
23   virtual ParameterID id() const = 0;
24
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;
29
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;
34
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; }
41
42   /// \brief Compare current parameter with other
43   virtual bool isEqual(const std::shared_ptr<SketchSolver_IParameterWrapper>& theOther) = 0;
44
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;
48
49 protected:
50   bool myIsParametric; ///< indicate the parameter is given by parametric expression
51 };
52
53 typedef std::shared_ptr<SketchSolver_IParameterWrapper> ParameterWrapperPtr;
54
55 #endif