14#ifndef OSGSIM_SCALARBAR
15#define OSGSIM_SCALARBAR 1
81 _color(1.0f,1.0f,1.0f,1.0f)
120 const std::string& title,
122 float aspectRatio=0.25,
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f Vec3
Definition Vec3:21
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
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
A Geode is a "geometry node", that is, a leaf node on the scene graph that can have "renderable thing...
Definition Geode:29
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
ColorRange is a ScalarsToColors object to define a color spectrum for a scalar range.
Definition ColorRange:32
ScalarBar()
Default constructor.
Definition ScalarBar:87
ScalarBar(int numColors, int numLabels, ScalarsToColors *stc, const std::string &title, Orientation orientation=HORIZONTAL, float aspectRatio=0.25, ScalarPrinter *sp=new ScalarPrinter)
Construct a ScalarBar with the supplied parameters.
Definition ScalarBar:119
int getNumLabels() const
Get the number of labels displayed along the ScalarBar.
float _width
Definition ScalarBar:236
TextProperties _textProperties
Definition ScalarBar:240
const ScalarPrinter * getScalarPrinter() const
Get the ScalarPrinter object.
void setAspectRatio(float aspectRatio)
Set the aspect ration (y/x) for the displayed bar.
float getAspectRatio() const
Get the aspect ration (y/x) for the displayed bar.
const TextProperties & getTextProperties() const
Get the TextProperties for the labels & title.
ScalarBar::Orientation getOrientation() const
Get the orientation of the ScalarBar.
void setTextProperties(const TextProperties &tp)
Set the TextProperties for the labels & title.
int getNumColors() const
Get the number of distinct colours on the ScalarBar.
float _aspectRatio
Definition ScalarBar:237
float getWidth() const
Get the width of the scalar bar.
Definition ScalarBar:193
META_Node(osgSim, ScalarBar)
void setTitle(const std::string &title)
Set the title for the ScalarBar, set "" for no title.
int _numColors
Definition ScalarBar:231
osg::ref_ptr< ScalarPrinter > _sp
Definition ScalarBar:239
std::string _title
Definition ScalarBar:234
Orientation
ScalarBar orientation specification.
Definition ScalarBar:49
@ VERTICAL
a vertically ascending scalar bar (y-axis)
Definition ScalarBar:51
@ HORIZONTAL
a horizontally ascending scalar bar (x-axis)
Definition ScalarBar:50
const std::string & getTitle() const
Get the title for the ScalarBar.
void setOrientation(ScalarBar::Orientation orientation)
Set the orientation of the ScalarBar.
const ScalarsToColors * getScalarsToColors() const
Get the ScalarsToColors mapping object from the ScalarBar.
const osg::Vec3 & getPosition() const
Get the position of scalar bar.
Definition ScalarBar:187
void setScalarPrinter(ScalarPrinter *sp)
Set a ScalarPrinter object for the ScalarBar.
osg::Vec3 _position
Definition ScalarBar:235
void setWidth(float width)
Set the width of the scalar bar.
void setScalarsToColors(ScalarsToColors *stc)
Set the ScalarsToColors mapping object for the ScalarBar.
int _numLabels
Definition ScalarBar:232
void setNumColors(int numColors)
Set the number of distinct colours on the ScalarBar.
void setNumLabels(int numLabels)
Set the number of labels to display along the ScalarBar.
ScalarBar(const ScalarBar &rhs, const osg::CopyOp &co)
Copy constructor.
Definition ScalarBar:139
void setPosition(const osg::Vec3 &pos)
Set the position of scalar bar's lower left corner.
void update()
force update the drawables used to render the scalar bar.
Definition ScalarBar:226
osg::ref_ptr< ScalarsToColors > _stc
Definition ScalarBar:233
Orientation _orientation
Definition ScalarBar:238
Users may provide their own ScalarPrinter by deriving from this base class and overriding the printSc...
Definition ScalarBar:60
virtual std::string printScalar(float scalar)
TextProperties allows users to specify a number of properties for the text used to display the labels...
Definition ScalarBar:71
osg::Vec4 _color
Definition ScalarBar:75
std::string _fontFile
Definition ScalarBar:72
std::pair< int, int > _fontResolution
Definition ScalarBar:73
TextProperties()
Definition ScalarBar:77
float _characterSize
Definition ScalarBar:74
ScalarsToColors defines the interface to map a scalar value to a color, and provides a default implem...
Definition ScalarsToColors:31
#define OSGSIM_EXPORT
Definition Export:38