Last change
on this file since 3465 was
3465,
checked in by ldelgass, 11 years ago
|
Rename R2 library to nv::graphics and nv::util.
|
-
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 GRID_H |
---|
3 | #define GRID_H |
---|
4 | |
---|
5 | #include <util/Fonts.h> |
---|
6 | |
---|
7 | #include "Axis.h" |
---|
8 | #include "AxisRange.h" |
---|
9 | |
---|
10 | class RGBA |
---|
11 | { |
---|
12 | public: |
---|
13 | RGBA(float r, float g, float b, float a) : |
---|
14 | red(r), |
---|
15 | green(g), |
---|
16 | blue(b), |
---|
17 | alpha(a) |
---|
18 | {} |
---|
19 | |
---|
20 | void set(float r, float g, float b, float a) |
---|
21 | { |
---|
22 | red = r; |
---|
23 | green = g; |
---|
24 | blue = b; |
---|
25 | alpha = a; |
---|
26 | } |
---|
27 | |
---|
28 | float red, green, blue, alpha; |
---|
29 | }; |
---|
30 | |
---|
31 | class Grid |
---|
32 | { |
---|
33 | public: |
---|
34 | Grid(); |
---|
35 | virtual ~Grid(); |
---|
36 | |
---|
37 | bool isVisible() const |
---|
38 | { |
---|
39 | return _visible; |
---|
40 | } |
---|
41 | |
---|
42 | void setVisible(bool visible) |
---|
43 | { |
---|
44 | _visible = visible; |
---|
45 | } |
---|
46 | |
---|
47 | void setAxisColor(float r, float g, float b, float a) |
---|
48 | { |
---|
49 | _axisColor.set(r, g, b, a); |
---|
50 | } |
---|
51 | |
---|
52 | void setLineColor(float r, float g, float b, float a) |
---|
53 | { |
---|
54 | _majorColor.set(r, g, b, a); |
---|
55 | _minorColor = _majorColor; |
---|
56 | } |
---|
57 | |
---|
58 | void render(); |
---|
59 | |
---|
60 | void setFont(nv::util::Fonts *font); |
---|
61 | |
---|
62 | Axis xAxis; |
---|
63 | Axis yAxis; |
---|
64 | Axis zAxis; |
---|
65 | |
---|
66 | private: |
---|
67 | RGBA _axisColor, _majorColor, _minorColor; |
---|
68 | nv::util::Fonts *_font; |
---|
69 | bool _visible; |
---|
70 | }; |
---|
71 | |
---|
72 | |
---|
73 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.