#include <Range.h>
Public Member Functions | |
Range () | |
Constructor. | |
Range (const Range &) | |
Copy constructor. | |
Range (float low, float high) | |
Constructor. | |
virtual float | low (void) const |
returns lower limit. | |
virtual float | high (void) const |
returns higher limit. | |
virtual float | center (void) const |
returns center. | |
virtual float | width (void) const |
returns width. | |
virtual float | low (float lowIn) |
sets lower limit. | |
virtual float | high (float highIn) |
sets higher limit. | |
virtual Range & | set (float low, float high) |
sets range. | |
virtual Range & | setByCenter (float center, float width) |
sets range by center and width. | |
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 different. | |
bool | operator & (const Range &) const |
returns true if two are overlaped each other. | |
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 | within (const Range &) const |
returns true if given Range is within(included in) a range. | |
virtual int | dump (void) const |
displays debug information. | |
Private Attributes | |
float | _low |
Lower limit. | |
float | _high |
Higher limit. |
Definition at line 19 of file Range.h.
Range::Range | ( | ) |
Range::Range | ( | const Range & | ) |
Range::Range | ( | float | low, | |
float | high | |||
) |
float Range::center | ( | void | ) | const [inline, virtual] |
int Range::dump | ( | void | ) | const [virtual] |
float Range::high | ( | float | highIn | ) | [inline, virtual] |
float Range::high | ( | void | ) | const [inline, virtual] |
returns higher limit.
Definition at line 116 of file Range.h.
References _high.
Referenced by operator &(), operator=(), operator==(), Range(), and within().
00116 { 00117 return _high; 00118 }
float Range::low | ( | float | lowIn | ) | [inline, virtual] |
float Range::low | ( | void | ) | const [inline, virtual] |
returns lower limit.
Definition at line 103 of file Range.h.
References _low.
Referenced by operator &(), operator=(), operator==(), Range(), and within().
00103 { 00104 return _low; 00105 }
returns true if two are overlaped each other.
Definition at line 212 of file Range.h.
References high(), low(), and within().
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 }
Range & Range::set | ( | float | low, | |
float | high | |||
) | [inline, virtual] |
Range & Range::setByCenter | ( | float | center, | |
float | width | |||
) | [inline, virtual] |
float Range::width | ( | void | ) | const [inline, virtual] |
bool Range::within | ( | const float | value | ) | const [inline] |
returns true if given value is within a range.
Definition at line 171 of file Range.h.
Referenced by operator &(), and within().
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 }
bool Range::within2 | ( | const float | value | ) | const [inline] |
returns true if given value is within a range.
Definition at line 188 of file Range.h.
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 }
float Range::_high [private] |
Higher limit.
Definition at line 87 of file Range.h.
Referenced by center(), dump(), high(), low(), operator=(), operator==(), Range(), set(), setByCenter(), width(), within(), and within2().
float Range::_low [private] |
Lower limit.
Definition at line 85 of file Range.h.
Referenced by center(), dump(), high(), low(), operator=(), operator==(), Range(), set(), setByCenter(), width(), within(), and within2().