OpenSceneGraph 3.6.5
ColorRange
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 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 OSGSIM_COLORRANGE
15#define OSGSIM_COLORRANGE 1
16
17#include <osgSim/Export>
18
20#include <vector>
21
22namespace osgSim
23{
32{
33public:
34
39 ColorRange(float min, float max);
40
46 ColorRange(float min, float max, const std::vector<osg::Vec4>& colors);
47
49 void setColors(const std::vector<osg::Vec4>& colors);
50
52 const std::vector<osg::Vec4>& getColors() const { return _colors; }
53
55 osg::Vec4 getColor(float scalar) const;
56
57private:
58
59 // Default assignment and copy construction are OK.
60
61 std::vector<osg::Vec4> _colors;
62};
63
64}
65
66#endif
Vec4f Vec4
Definition Vec4:21
The osgSim library is a NodeKit that extends the core scene graph to support nodes and drawables that...
Definition BlinkSequence:27
ColorRange(float min, float max, const std::vector< osg::Vec4 > &colors)
Constructor for a ColorRange.
const std::vector< osg::Vec4 > & getColors() const
Get the range of colors.
Definition ColorRange:52
ColorRange(float min, float max)
Constructor for a ColorRange with a default list of colors set to Red-Yellow-Green-Blue-Cyan.
osg::Vec4 getColor(float scalar) const
Get the color for a given scalar value.
void setColors(const std::vector< osg::Vec4 > &colors)
Set the range of colors.
ScalarsToColors(float scalarMin, float scalarMax)
#define OSGSIM_EXPORT
Definition Export:38

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.