source: trunk/packages/vizservers/nanovis/Grid.h @ 2800

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

Add emacs mode magic line in preparation for indentation cleanup

  • Property svn:eol-style set to native
File size: 1020 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#ifndef _GRID_H_
3#define _GRID_H_
4
5#include <R2/R2Fonts.h>
6#include "Axis.h"
7#include "AxisRange.h"
8
9class RGBA {
10public:
11    float red, green, blue, alpha;
12    RGBA(float r, float g, float b, float a) :
13        red(r), green(g), blue(b), alpha(a)
14    { /*empty*/ }
15    void SetColor(float r, float g, float b, float a) {
16        red   = r;
17        green = g;
18        blue  = b;
19        alpha = a;
20    }
21};
22
23class Grid {
24    RGBA _axisColor, _majorColor, _minorColor;
25    R2Fonts* _font;
26    bool _visible;
27
28public :
29    Axis xAxis;
30    Axis yAxis;
31    Axis zAxis;
32
33    Grid();
34    bool isVisible() const {
35        return _visible;
36    }
37    void setVisible(bool visible) {
38        _visible = visible;
39    }
40    void setAxisColor(float r, float g, float b, float a) {
41        _axisColor.SetColor(r, g, b, a);
42    }
43    void setLineColor(float r, float g, float b, float a) {
44        _majorColor.SetColor(r, g, b, a);
45        _minorColor = _majorColor;
46    }
47    void render();
48    void setFont(R2Fonts* font);
49};
50
51
52#endif
Note: See TracBrowser for help on using the repository browser.