source: branches/1.2/packages/vizservers/nanovis/Grid.h @ 3589

Last change on this file since 3589 was 3502, checked in by ldelgass, 11 years ago

Add basic VTK structured points reader to nanovis, update copyright dates.

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 *
5 */
6#ifndef GRID_H
7#define GRID_H
8
9#include <util/Fonts.h>
10
11#include "Axis.h"
12#include "AxisRange.h"
13
14class RGBA
15{
16public:
17    RGBA(float r, float g, float b, float a) :
18        red(r),
19        green(g),
20        blue(b),
21        alpha(a)
22    {}
23
24    void set(float r, float g, float b, float a)
25    {
26        red   = r;
27        green = g;
28        blue  = b;
29        alpha = a;
30    }
31
32    float red, green, blue, alpha;
33};
34
35class Grid
36{
37public:
38    Grid();
39    virtual ~Grid();
40
41    bool isVisible() const
42    {
43        return _visible;
44    }
45
46    void setVisible(bool visible)
47    {
48        _visible = visible;
49    }
50
51    void setAxisColor(float r, float g, float b, float a)
52    {
53        _axisColor.set(r, g, b, a);
54    }
55
56    void setLineColor(float r, float g, float b, float a)
57    {
58        _majorColor.set(r, g, b, a);
59        _minorColor = _majorColor;
60    }
61
62    void render();
63
64    void setFont(nv::util::Fonts *font);
65
66    Axis xAxis;
67    Axis yAxis;
68    Axis zAxis;
69
70private:
71    RGBA _axisColor, _majorColor, _minorColor;
72    nv::util::Fonts *_font;
73    bool _visible;
74};
75
76
77#endif
Note: See TracBrowser for help on using the repository browser.