Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchSolver / SolveSpaceSolver / SolveSpaceSolver_ParameterWrapper.h
1 // Copyright (C) 2014-2023  CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef SolveSpaceSolver_ParameterWrapper_H_
21 #define SolveSpaceSolver_ParameterWrapper_H_
22
23 #include <SketchSolver_IParameterWrapper.h>
24 #include <SolveSpaceSolver_Solver.h>
25
26 /**
27  *  Wrapper providing operations with parameters in SolveSpace.
28  */
29 class SolveSpaceSolver_ParameterWrapper : public SketchSolver_IParameterWrapper
30 {
31 public:
32   SolveSpaceSolver_ParameterWrapper(const Slvs_Param& theParam);
33
34   /// \brief Return SolveSpace parameter
35   const Slvs_Param& parameter() const
36   { return myParameter; }
37   /// \brief Return SolveSpace parameter to change
38   Slvs_Param& changeParameter()
39   { return myParameter; }
40
41   /// \brief Return ID of current parameter
42   virtual ParameterID id() const;
43
44   /// \brief Change group for the parameter
45   virtual void setGroup(const GroupID& theGroup)
46   { myParameter.group = (Slvs_hGroup)theGroup; }
47
48   /// \brief Return identifier of the group the parameter belongs to
49   virtual GroupID group() const
50   { return (GroupID)myParameter.group; }
51
52   /// \brief Change value of parameter
53   virtual void setValue(double theValue);
54   /// \brief Return value of parameter
55   virtual double value() const;
56
57   /// \brief Compare current parameter with other
58   virtual bool isEqual(const ParameterWrapperPtr& theOther);
59
60   /// \brief Update value of parameter by the given one
61   /// \return \c true if the value of parameter is changed
62   virtual bool update(const std::shared_ptr<SketchSolver_IParameterWrapper>& theOther);
63
64 private:
65   Slvs_Param myParameter;
66 };
67
68 #endif