Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_ParameterWrapper.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    PlaneGCSSolver_ParameterWrapper.h
4 // Created: 14 Dec 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef PlaneGCSSolver_ParameterWrapper_H_
8 #define PlaneGCSSolver_ParameterWrapper_H_
9
10 #include <PlaneGCSSolver_Defs.h>
11 #include <SketchSolver_IParameterWrapper.h>
12
13 /**
14  *  Wrapper providing operations with parameters in PlaneGCS.
15  */
16 class PlaneGCSSolver_ParameterWrapper : public SketchSolver_IParameterWrapper
17 {
18 public:
19   PlaneGCSSolver_ParameterWrapper(double *const theParam);
20   virtual ~PlaneGCSSolver_ParameterWrapper();
21
22   /// \brief Return ID of current parameter
23   virtual ParameterID id() const
24   { return myID; }
25
26   double* parameter() const
27   { return myValue; }
28
29   /// \brief Change group for the parameter
30   virtual void setGroup(const GroupID& theGroup)
31   { myGroup = theGroup; }
32
33   /// \brief Return identifier of the group the parameter belongs to
34   virtual GroupID group() const
35   { return myGroup; }
36
37   /// \brief Change value of parameter
38   virtual void setValue(double theValue);
39   /// \brief Return value of parameter
40   virtual double value() const;
41
42   /// \brief Compare current parameter with other
43   virtual bool isEqual(const ParameterWrapperPtr& theOther);
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 ParameterWrapperPtr& theOther);
48
49   /// \brief Shows the parameter is added to full list of parameters
50   bool isProcessed() const
51   { return myProcessing; }
52   /// \brief Set the flag that parameter is under processing
53   void setProcessed(bool isProc)
54   { myProcessing = isProc; }
55
56 protected:
57   ParameterID myID;
58   GroupID     myGroup;
59   double*     myValue;
60   bool        myProcessing; ///< identify that the parameter is already in the list of parameters
61 };
62
63 #endif