itom  4.1.0
interval.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef INTERVAL_H
29 #define INTERVAL_H
30 
31 #ifdef __APPLE__
32 extern "C++" {
33 #endif
34 
35 /* includes */
36 #include "commonGlobal.h"
37 
38 namespace ito
39 {
40 
41 //----------------------------------------------------------------------------------------------------------------------------------
49 class ITOMCOMMON_EXPORT AutoInterval
50 {
51  private:
52  double m_min;
53  double m_max;
54  bool m_auto;
56  public:
57  AutoInterval();
58 
60 
65  AutoInterval(double min, double max, bool autoInterval = false);
66 
67  virtual ~AutoInterval();
68 
70  inline double minimum() const { return m_min; }
71 
73  inline double maximum() const { return m_max; }
74 
76  inline double & rmin() { return m_min; }
77 
79  inline double & rmax() { return m_max; }
80 
82  inline bool isAuto() const { return m_auto; }
83 
85  inline bool &rauto() { return m_auto; }
86 
88 
92  void setRange(double min, double max);
93 
95 
98  void setMinimum(double min);
99 
101 
104  void setMaximum(double max);
105 
107 
110  void setAuto(bool autoInterval);
111 
113 
117  bool operator==( const AutoInterval & ) const;
118 
120 
124  bool operator!=( const AutoInterval & ) const;
125 };
126 
127 
128 } //end namespace ito
129 
130 #ifdef __APPLE__
131 }
132 #endif
133 
134 #endif
double maximum() const
return the maximum value of the interval (included)
Definition: interval.h:73
double & rmax()
return a reference to the maximum value of the interval. Assigning a float to this reference will cha...
Definition: interval.h:79
Definition: apiFunctionsGraph.cpp:39
bool isAuto() const
return the state of the auto-flag as boolean variable
Definition: interval.h:82
bool m_auto
Definition: interval.h:54
bool & rauto()
return the reference to the auto-flag. Assigning a boolean to this reference will change the auto-fla...
Definition: interval.h:85
bool operator==(const ByteArray &a1, const char *a2)
comparison operator that returns true if the content of a1 is equal to the given zero-terminated stri...
Definition: byteArray.h:185
double minimum() const
return the minimum value of the interval (included)
Definition: interval.h:70
double m_min
Definition: interval.h:52
double & rmin()
return a reference to the minimum value of the interval. Assigning a float to this reference will cha...
Definition: interval.h:76
bool operator!=(const ByteArray &a1, const char *a2)
comparison operator that returns true if the content of a1 is not equal to the given zero-terminated ...
Definition: byteArray.h:197
double m_max
Definition: interval.h:53
class for a interval type containing a min-max-range and an auto-flag.
Definition: interval.h:49