Commit ca8843a6 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX] colormapper now shows colorbar labels directly when enabling the colorbar.

parent 66c92475
......@@ -224,6 +224,7 @@ void WMColormapper::moduleMain()
matrix->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
// this geode contains the labels
m_needScaleUpdate = true;
osg::ref_ptr< osg::Geode > labels = new osg::Geode();
labels->addDrawable( nameLabel );
m_scaleLabels = new osg::Geode();
......@@ -344,10 +345,12 @@ void WMColormapper::updateColorbarName( osg::Drawable* label )
void WMColormapper::updateColorbarScale( osg::Node* scaleLabels )
{
if( m_colorBarLabels->changed( true ) || ( m_windowLevelEnabled != m_lastDataSet->getTexture()->windowEnabled()->get() ) ||
( m_windowLevel != m_lastDataSet->getTexture()->window()->get() )
if( m_needScaleUpdate || m_colorBarLabels->changed( true ) ||
( m_windowLevelEnabled != m_lastDataSet->getTexture()->windowEnabled()->get() ) ||
( m_windowLevel != m_lastDataSet->getTexture()->window()->get() )
)
{
m_needScaleUpdate = false;
m_windowLevelEnabled = m_lastDataSet->getTexture()->windowEnabled()->get();
m_windowLevel = m_lastDataSet->getTexture()->window()->get();
......
......@@ -191,6 +191,11 @@ private:
* Window level.
*/
WIntervalDouble m_windowLevel;
/**
* If true, the labels get re-drawn
*/
bool m_needScaleUpdate;
};
#endif // WMCOLORMAPPER_H
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment