#include <Range.h>
Public Member Functions | |
virtual float | center (void) const |
returns center. | |
virtual float | center (void) const |
returns center. | |
virtual int | dump (void) const |
displays debug information. | |
virtual int | dump (void) const |
displays debug information. | |
virtual float | high (float highIn) |
sets higher limit. | |
virtual float | high (void) const |
returns higher limit. | |
virtual float | high (float highIn) |
sets higher limit. | |
virtual float | high (void) const |
returns higher limit. | |
virtual float | low (float lowIn) |
sets lower limit. | |
virtual float | low (void) const |
returns lower limit. | |
virtual float | low (float lowIn) |
sets lower limit. | |
virtual float | low (void) const |
returns lower limit. | |
bool | operator & (const Range &) const |
returns true if two are overlaped each other. | |
bool | operator & (const Range &) const |
returns true if two are overlaped each other. | |
bool | operator!= (const Range &) const |
returns true if range is different. | |
bool | operator!= (const Range &) const |
returns true if range is different. | |
Range & | operator= (const Range &) |
Copy operator. | |
Range & | operator= (const Range &) |
Copy operator. | |
bool | operator== (const Range &) const |
returns true if range is the same. | |
bool | operator== (const Range &) const |
returns true if range is the same. | |
Range (float low, float high) | |
Constructor. | |
Range (const Range &) | |
Copy constructor. | |
Range () | |
Constructor. | |
Range (float low, float high) | |
Constructor. | |
Range (const Range &) | |
Copy constructor. | |
Range () | |
Constructor. | |
virtual Range & | set (float low, float high) |
sets range. | |
virtual Range & | set (float low, float high) |
sets range. | |
virtual Range & | setByCenter (float center, float width) |
sets range by center and width. | |
virtual Range & | setByCenter (float center, float width) |
sets range by center and width. | |
virtual float | width (void) const |
returns width. | |
virtual float | width (void) const |
returns width. | |
bool | within (const Range &) const |
returns true if given Range is within(included in) a range. | |
bool | within (const float value) const |
returns true if given value is within a range. | |
bool | within (const Range &) const |
returns true if given Range is within(included in) a range. | |
bool | within (const float value) const |
returns true if given value is within a range. | |
bool | within2 (const float value) const |
returns true if given value is within a range. | |
bool | within2 (const float value) const |
returns true if given value is within a range. | |
Private Attributes | |
float | _high |
Higher limit. | |
float | _low |
Lower limit. |
|
Constructor.
|
|
Copy constructor.
|
|
Constructor.
00026 { 00027 if (iHigh > iLow) { 00028 _low = iLow; 00029 _high = iHigh; 00030 } 00031 else { 00032 _low = iHigh; 00033 _high = iLow; 00034 } 00035 }
|
|
Constructor.
|
|
Copy constructor.
|
|
Constructor.
|
|
returns center.
|
|
returns center.
00129 { 00130 return (_low + _high) / 2.; 00131 }
|
|
displays debug information.
|
|
displays debug information.
00045 { 00046 std::cout << _low << "~" << _high; 00047 return 0; 00048 }
|
|
sets higher limit.
|
|
returns higher limit.
|
|
sets higher limit.
00122 { 00123 if (i < _low) i = _low; 00124 return _high = i; 00125 }
|
|
returns higher limit.
00116 {
00117 return _high;
00118 }
|
|
sets lower limit.
|
|
returns lower limit.
|
|
sets lower limit.
00109 { 00110 if (i > _high) i = _high; 00111 return _low = i; 00112 }
|
|
returns lower limit.
00103 {
00104 return _low;
00105 }
|
|
returns true if two are overlaped each other.
|
|
returns true if two are overlaped each other.
00212 { 00213 if (within(a.low())) return true; 00214 if (within(a.high())) return true; 00215 if (a.within(low())) return true; 00216 if (a.within(high())) return true; 00217 return false; 00218 }
|
|
returns true if range is different.
|
|
returns true if range is different.
00205 { 00206 if ((* this) == a) return false; 00207 return true; 00208 }
|
|
Copy operator.
|
|
Copy operator.
|
|
returns true if range is the same.
|
|
returns true if range is the same.
00038 { 00039 if (_low != a.low()) return false; 00040 if (_high != a.high()) return false; 00041 return true; 00042 }
|
|
sets range.
|
|
sets range.
00141 { 00142 if (iHigh > iLow) { 00143 _low = iLow; 00144 _high = iHigh; 00145 } 00146 else { 00147 _low = iHigh; 00148 _high = iLow; 00149 } 00150 return * this; 00151 }
|
|
sets range by center and width.
|
|
sets range by center and width.
|
|
returns width.
|
|
returns width.
00135 { 00136 return (_high - _low); 00137 }
|
|
returns true if given Range is within(included in) a range.
|
|
returns true if given value is within a range.
|
|
returns true if given Range is within(included in) a range.
|
|
returns true if given value is within a range.
00171 { 00172 if (_low == -999. && _high == -999.) { 00173 return false; 00174 } 00175 if (_low == -999.) { 00176 if (f <= _high) return true; 00177 return false; 00178 } 00179 if (_high == -999.) { 00180 if (f >= _low) return true; 00181 } 00182 if (f >= _low && f <= _high) return true; 00183 return false; 00184 }
|
|
returns true if given value is within a range.
|
|
returns true if given value is within a range.
00188 { 00189 if (_low == -999. && _high == -999.) { 00190 return true; 00191 } 00192 if (_low == -999.) { 00193 if (f <= _high) return true; 00194 return false; 00195 } 00196 if (_high == -999.) { 00197 if (f >= _low) return true; 00198 } 00199 if (f >= _low && f <= _high) return true; 00200 return false; 00201 }
|
|
Higher limit.
|
|
Lower limit.
|