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

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

Const correctness fixes, pass vector/matrix objects by reference, various
formatting and style cleanups, don't spam syslog and uncomment openlog() call.
Still needs to be compiled with -DWANT_TRACE to get tracing, but now trace
output will be output to file in /tmp.

  • Property svn:eol-style set to native
File size: 879 bytes
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    double min_, max_;
9    char *units_;
10public:
11    AxisRange(void) {
12        min(0.0);
13        max(1.0);
14        units_ = NULL;
15    }
16    ~AxisRange(void) {
17        if (units_ != NULL) {
18            delete [] units_;
19        }
20    }
21    void SetRange(double min, double max) {
22        min_ = min, max_ = max;
23    }
24    double min(void) {
25        return min_;
26    }
27    void min(double min) {
28        min_ = min;
29    }
30    double max(void) {
31        return max_;
32    }
33    void max(double max) {
34        max_ = max;
35    }
36    const char *units(void) {
37        return units_;
38    }
39    void units(const char *units) {
40        if (units_ != NULL) {
41            delete [] units_;
42        }
43        if (units == NULL) {
44            units_ = NULL;
45        } else {
46            units_ = new char [strlen(units) + 1];
47            strcpy(units_, units);
48        }
49    }
50};
51
52#endif
Note: See TracBrowser for help on using the repository browser.