OpenCurves  0.9
plotfunctionresult.h
1 //
2 // author Kazys Stepanas
3 //
4 // Copyright (c) CSIRO 2015
5 //
6 #ifndef PLOTFUNCTIONRESULT_H_
7 #define PLOTFUNCTIONRESULT_H_
8 
9 #include "plotsconfig.h"
10 
28 {
29  double displayValue;
30  double logicalValue;
31 
34  inline PlotFunctionResult(double value = 0) : displayValue(value), logicalValue(value) {}
35 
39  inline PlotFunctionResult(double display, double logical) : displayValue(display), logicalValue(logical) {}
40 
44  {
45  *this = other;
46  }
47 
50  inline PlotFunctionResult &operator=(double value)
51  {
52  displayValue = logicalValue = value;
53  return *this;
54  }
55 
59  {
60  displayValue = other.displayValue;
61  logicalValue = other.logicalValue;
62  return *this;
63  }
64 };
65 
66 #endif // PLOTFUNCTIONRESULT_H_
double logicalValue
Value referenced in further evaluations of the function.
Definition: plotfunctionresult.h:30
PlotFunctionResult(double value=0)
Constructor - both display and logical values are set to value.
Definition: plotfunctionresult.h:34
PlotFunctionResult(const PlotFunctionResult &other)
Copy constructor.
Definition: plotfunctionresult.h:43
double displayValue
Value to display.
Definition: plotfunctionresult.h:29
PlotFunctionResult(double display, double logical)
Constructor accepting distinct display and logical values.
Definition: plotfunctionresult.h:39
PlotFunctionResult & operator=(double value)
Assignment - both display and logical values are set to value.
Definition: plotfunctionresult.h:50
Result value from a PlotFunction.
Definition: plotfunctionresult.h:27
PlotFunctionResult & operator=(const PlotFunctionResult &other)
Assignment - copy.
Definition: plotfunctionresult.h:58