Commit 2840ccd4 by Alexander Wiebel

[FIX #322] iso value is now only set automatically for the first arriving

data
parent a574589e
......@@ -65,6 +65,7 @@ WMMarchingCubes::WMMarchingCubes():
m_dataSet(),
m_shaderUseLighting( false ),
m_shaderUseTransparency( false ),
m_firstDataProcessed( false ),
m_moduleNode( new WGEGroupNode() ),
m_surfaceGeode( 0 )
{
......@@ -136,7 +137,10 @@ void WMMarchingCubes::moduleMain()
// set appropriate constraints for properties
m_isoValueProp->setMin( m_dataSet->getMin() );
m_isoValueProp->setMax( m_dataSet->getMax() );
m_isoValueProp->set( 0.5 * ( m_dataSet->getMax() + m_dataSet->getMin() ), true );
if( !m_firstDataProcessed )
{
m_isoValueProp->set( 0.5 * ( m_dataSet->getMax() + m_dataSet->getMin() ), true );
}
}
// update ISO surface
......@@ -160,6 +164,8 @@ void WMMarchingCubes::moduleMain()
debugLog() << "Done!";
progress->finish();
m_firstDataProcessed = true;
// this waits for m_moduleState to fire. By default, this is only the m_shutdownFlag condition.
// NOTE: you can add your own conditions to m_moduleState using m_moduleState.add( ... )
m_moduleState.wait();
......
......@@ -177,6 +177,7 @@ private:
bool m_shaderUseLighting; //!< shall the shader use lighting?
bool m_shaderUseTransparency; //!< shall the shader use transparency?
bool m_firstDataProcessed; //!< Indicates if we already processed the first arrived data. This helps us to reset the isovalue only the first time.
osg::ref_ptr< WGEGroupNode > m_moduleNode; //!< Pointer to the modules group node. We need it to be able to update it when callback is invoked.
......
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