SHAPER  9.12.0
PlaneGCSSolver_ScalarWrapper.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 PlaneGCSSolver_ScalarWrapper_H_
21 #define PlaneGCSSolver_ScalarWrapper_H_
22 
23 #include <PlaneGCSSolver_Defs.h>
24 #include <PlaneGCSSolver_EntityWrapper.h>
25 
30 {
31 public:
32  PlaneGCSSolver_ScalarWrapper(double *const theParam);
33 
35  double* scalar() const
36  { return myValue; }
37 
39  virtual void setValue(double theValue);
41  virtual double value() const;
42 
44  virtual SketchSolver_EntityType type() const
45  { return ENTITY_SCALAR; }
46 
47 protected:
50  virtual bool update(std::shared_ptr<ModelAPI_Attribute> theAttribute);
51 
52 protected:
53  double* myValue;
54 };
55 
56 typedef std::shared_ptr<PlaneGCSSolver_ScalarWrapper> ScalarWrapperPtr;
57 
58 #endif
Wrapper providing operations with entities regardless the solver.
Definition: PlaneGCSSolver_EntityWrapper.h:37
Wrapper providing operations with PlaneGCS scalars.
Definition: PlaneGCSSolver_ScalarWrapper.h:30
virtual double value() const
Return value of parameter.
Definition: PlaneGCSSolver_ScalarWrapper.cpp:36
virtual SketchSolver_EntityType type() const
Return type of current entity.
Definition: PlaneGCSSolver_ScalarWrapper.h:44
virtual bool update(std::shared_ptr< ModelAPI_Attribute > theAttribute)
Update entity by the values of theAttribute.
Definition: PlaneGCSSolver_ScalarWrapper.cpp:41
virtual void setValue(double theValue)
Change value of parameter.
Definition: PlaneGCSSolver_ScalarWrapper.cpp:31
double * myValue
pointer to value provided by the storage
Definition: PlaneGCSSolver_ScalarWrapper.h:53
double * scalar() const
Return PlaneGCS parameter.
Definition: PlaneGCSSolver_ScalarWrapper.h:35