openscenegraph
ColorPalette
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGUI_COLORPALETTE
15#define OSGUI_COLORPALETTE
16
17#include <osg/Object>
18#include <osg/Vec4>
19#include <osgUI/Export>
20
21namespace osgUI
22{
23
24class OSGUI_EXPORT ColorPalette : public osg::Object
25{
26public:
27 ColorPalette();
28 ColorPalette(const ColorPalette& cp, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
29 META_Object(osgUI, ColorPalette);
30
31
32 typedef std::vector<osg::Vec4f> Colors;
33
34 void setColors(const Colors& colors) { _colors = colors; }
35 Colors& getColors() { return _colors; }
36 const Colors& getColors() const { return _colors; }
37
38 typedef std::vector<std::string> Names;
39
40 void setNames(const Names& names) { _names = names; }
41 Names& getNames() { return _names; }
42 const Names& getNames() const { return _names; }
43
44
45protected:
46
47 virtual ~ColorPalette() {}
48
49 Colors _colors;
50 Names _names;
51
52};
53
54}
55
56#endif