itom 2.2.1
K:/git-itom/sources/itom/common/interval.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2016, Institut fuer Technische Optik (ITO),
00005     Universitaet Stuttgart, Germany
00006 
00007     This file is part of itom and its software development toolkit (SDK).
00008 
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013    
00014     In addition, as a special exception, the Institut fuer Technische
00015     Optik (ITO) gives you certain additional rights.
00016     These rights are described in the ITO LGPL Exception version 1.0,
00017     which can be found in the file LGPL_EXCEPTION.txt in this package.
00018 
00019     itom is distributed in the hope that it will be useful, but
00020     WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00022     General Public Licence for more details.
00023 
00024     You should have received a copy of the GNU Library General Public License
00025     along with itom. If not, see <http://www.gnu.org/licenses/>.
00026 *********************************************************************** */
00027 
00028 #ifndef INTERVAL_H
00029 #define INTERVAL_H
00030 
00031 #ifdef __APPLE__
00032 extern "C++" {
00033 #endif
00034 
00035 /* includes */
00036 #include "commonGlobal.h"
00037 
00038 namespace ito
00039 {
00040 
00041 //----------------------------------------------------------------------------------------------------------------------------------
00049 class ITOMCOMMON_EXPORT AutoInterval
00050 {       
00051     private:
00052         float m_min; 
00053         float m_max; 
00054         bool m_auto; 
00056     public:
00057         AutoInterval(); 
00058 
00060 
00065         AutoInterval(float min, float max, bool autoInterval = false);
00066 
00067         virtual ~AutoInterval(); 
00068 
00070         inline float minimum() const { return m_min; }
00071 
00073         inline float maximum() const { return m_max; }
00074 
00076         inline float & rmin() { return m_min; }
00077 
00079         inline float & rmax() { return m_max; }
00080 
00082         inline bool isAuto() const { return m_auto; }
00083 
00085         inline bool &rauto() { return m_auto; }
00086 
00088 
00092         void setRange(float min, float max);
00093 
00095 
00098         void setMinimum(float min);
00099 
00101 
00104         void setMaximum(float max);
00105 
00107 
00110         void setAuto(bool autoInterval);
00111 
00113 
00117         bool operator==( const AutoInterval & ) const;
00118 
00120 
00124         bool operator!=( const AutoInterval & ) const;
00125 };
00126 
00127 
00128 } //end namespace ito
00129 
00130 #ifdef __APPLE__
00131 }
00132 #endif
00133 
00134 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends