source: trunk/packages/vizservers/nanovis/AxisRange.h @ 2844

Last change on this file since 2844 was 2844, checked in by ldelgass, 12 years ago

Cleanups, no functional changes

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#ifndef AXIS_RANGE_H
3#define AXIS_RANGE_H
4
5#include <string.h>
6
7class AxisRange
8{
9public:
10    AxisRange() :
11        _min(0.0),
12        _max(1.0),
13        _units(NULL)
14    {
15    }
16
17    ~AxisRange()
18    {
19        if (_units != NULL) {
20            delete [] _units;
21        }
22    }
23
24    void SetRange(double min, double max)
25    {
26        _min = min;
27        _max = max;
28    }
29
30    double min() const
31    {
32        return _min;
33    }
34
35    void min(double min)
36    {
37        _min = min;
38    }
39
40    double max() const
41    {
42        return _max;
43    }
44
45    void max(double max)
46    {
47        _max = max;
48    }
49
50    const char *units() const
51    {
52        return _units;
53    }
54
55    void units(const char *units)
56    {
57        if (_units != NULL) {
58            delete [] _units;
59        }
60        if (units == NULL) {
61            _units = NULL;
62        } else {
63            _units = new char[strlen(units) + 1];
64            strcpy(_units, units);
65        }
66    }
67
68private:
69    double _min, _max;
70    char *_units;
71};
72
73#endif
Note: See TracBrowser for help on using the repository browser.