Commit 7bdc515d authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX #124] issue fixed. the reason was a re-used callback for each node...

[FIX #124] issue fixed. the reason was a re-used callback for each node registered to the colormapper. the nodemaskcallback of the navslices was then applied to all nodes in the colormnapper because addUpdateCallback nests them (enqueue).
parent 02be9fab
......@@ -85,8 +85,7 @@ void setPreTransform( osg::ref_ptr< WGEShader > shader, osg::Matrixd preTransfor
shader->setDefine( "ColormapPreTransform", out.str() );
}
WGEColormapping::WGEColormapping():
m_callback( new WGEFunctorCallback< osg::Node >( boost::bind( &WGEColormapping::callback, this, _1 ) ) )
WGEColormapping::WGEColormapping()
{
// initialize members
m_textures.getChangeCondition()->subscribeSignal( boost::bind( &WGEColormapping::textureUpdate, this ) );
......@@ -167,7 +166,7 @@ void WGEColormapping::applyInst( NodeList nodes, WMatrix4d preTransform, osg::re
info->m_preTransform = preTransform;
m_nodeInfo.insert( std::make_pair( *i, info ) );
( *i )->addUpdateCallback( m_callback );
( *i )->addUpdateCallback( new WGEFunctorCallback< osg::Node >( boost::bind( &WGEColormapping::callback, this, _1 ) ) );
// add the default shader if no other shader has been specified.
s->apply( *i );
......
......@@ -323,7 +323,7 @@ protected:
void replaceTextureInst( osg::ref_ptr< WGETexture3D > old, osg::ref_ptr< WGETexture3D > newTex, std::string name = "" );
/**
* This callback handles all the updates needed. It is called by the m_callback instance every update cycle for each node using this
* This callback handles all the updates needed. It is called by the callback instance every update cycle for each node using this
* WGEColormapping instance.
*
* \param node
......@@ -346,11 +346,6 @@ private:
*/
TextureContainerType m_textures;
/**
* The callback used for all the texture update handling on several nodes.
*/
osg::ref_ptr< WGEFunctorCallback< osg::Node > > m_callback;
/**
* Simple structure to store some additional node-related info like texture units and so on.
*/
......
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