14 #ifndef OSGSIM_SCALARBAR
15 #define OSGSIM_SCALARBAR 1
17 #include <osgSim/Export>
18 #include <osgSim/ColorRange>
61 virtual std::string printScalar(
float scalar);
78 _fontFile(
"fonts/arial.ttf"),
79 _fontResolution(40,40),
81 _color(1.0f,1.0f,1.0f,1.0f)
92 _position(0.0f,0.0f,0.0f),
95 _orientation(HORIZONTAL),
120 const std::string& title,
122 float aspectRatio=0.25,
125 _numColors(numColors),
126 _numLabels(numLabels),
129 _position(0.0f,0.0f,0.0f),
131 _aspectRatio(aspectRatio),
132 _orientation(orientation),
140 _numColors(rhs._numColors),
141 _numLabels(rhs._numLabels),
144 _position(rhs._position),
146 _aspectRatio(rhs._aspectRatio),
147 _orientation(rhs._orientation),
149 _textProperties(rhs._textProperties)
157 void setNumColors(
int numColors);
160 int getNumColors()
const;
165 void setNumLabels(
int numLabels);
168 int getNumLabels()
const;
177 void setTitle(
const std::string& title);
180 const std::string& getTitle()
const;
190 void setWidth(
float width);
197 void setAspectRatio(
float aspectRatio);
200 float getAspectRatio()
const;
214 void setScalarPrinter(ScalarPrinter* sp);
217 const ScalarPrinter* getScalarPrinter()
const;
220 void setTextProperties(
const TextProperties& tp);
223 const TextProperties& getTextProperties()
const;
242 void createDrawables();
TextProperties _textProperties
ScalarBar(int numColors, int numLabels, ScalarsToColors *stc, const std::string &title, Orientation orientation=HORIZONTAL, float aspectRatio=0.25, ScalarPrinter *sp=new ScalarPrinter)
#define META_Node(library, name)
std::pair< int, int > _fontResolution
GLint GLenum GLsizei width
osg::ref_ptr< ScalarPrinter > _sp
const osg::Vec3 & getPosition() const
ScalarBar(const ScalarBar &rhs, const osg::CopyOp &co)
a horizontally ascending scalar bar (x-axis)
osg::ref_ptr< ScalarsToColors > _stc