source:
trunk/packages/vizservers/nanovis/AxisRange.h
@
1300
Last change on this file since 1300 was 1176, checked in by gah, 16 years ago | |
---|---|
File size: 833 bytes |
Rev | Line | |
---|---|---|
[929] | 1 | #ifndef _AXIS_RANGE_H |
2 | #define _AXIS_RANGE_H | |
3 | ||
[1161] | 4 | #include <string.h> |
5 | ||
[929] | 6 | class AxisRange { |
[1111] | 7 | double min_, max_; |
[1161] | 8 | char *units_; |
[929] | 9 | public: |
[1176] | 10 | AxisRange(void) { |
11 | min(0.0); | |
12 | max(1.0); | |
[1175] | 13 | units_ = NULL; |
[932] | 14 | } |
[1161] | 15 | ~AxisRange(void) { |
16 | if (units_ != NULL) { | |
17 | delete [] units_; | |
18 | } | |
19 | } | |
[932] | 20 | void SetRange(double min, double max) { |
[1111] | 21 | min_ = min, max_ = max; |
[932] | 22 | } |
[1111] | 23 | double min(void) { |
24 | return min_; | |
[932] | 25 | } |
[1111] | 26 | void min(double min) { |
27 | min_ = min; | |
[932] | 28 | } |
[1111] | 29 | double max(void) { |
30 | return max_; | |
31 | } | |
32 | void max(double max) { | |
33 | max_ = max; | |
34 | } | |
[1161] | 35 | const char *units(void) { |
36 | return units_; | |
37 | } | |
38 | void units(const char *units) { | |
39 | if (units_ != NULL) { | |
40 | delete [] units_; | |
41 | } | |
[1176] | 42 | if (units == NULL) { |
43 | units_ = NULL; | |
44 | } else { | |
[1175] | 45 | units_ = new char [strlen(units) + 1]; |
46 | strcpy(units_, units); | |
47 | } | |
[1161] | 48 | } |
[929] | 49 | }; |
[932] | 50 | |
[929] | 51 | #endif /*_AXIS_RANGE_H*/ |
Note: See TracBrowser
for help on using the repository browser.