Commit 8ee1cb3c authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[FIX] - Non-texture compatible datasets now do not generate an entry in colormapper anymore.

parent ace734e2
......@@ -55,7 +55,7 @@ WDataSetSingle::WDataSetSingle( boost::shared_ptr< WValueSetBase > newValueSet,
// technically this should be placed into the WDataSetScalar, WDataSetVector and so on
boost::shared_ptr< WGridRegular3D > regGrid = boost::shared_dynamic_cast< WGridRegular3D >( m_grid );
if( regGrid )
if( regGrid && ( m_valueSet->dimension() < 5 ) && ( m_valueSet->dimension() != 0 ) )
{
m_texture = osg::ref_ptr< WDataTexture3D >( new WDataTexture3D( m_valueSet, regGrid ) );
}
......
......@@ -216,33 +216,36 @@ void WMData::moduleMain()
if( dss )
{
m_dataType->set( getDataTypeString( dss ) );
switch( (*dss).getValueSet()->getDataType() )
if( dss->isTexture() )
{
case W_DT_UNSIGNED_CHAR:
case W_DT_INT16:
case W_DT_SIGNED_INT:
m_dataSet->getTexture()->colormap()->set(
m_dataSet->getTexture()->colormap()->get().newSelector( WItemSelector::IndexList( 1, 0 ) )
);
break;
case W_DT_FLOAT:
case W_DT_DOUBLE:
if( boost::shared_dynamic_cast< WDataSetVector >( m_dataSet ) )
{
m_dataSet->getTexture()->colormap()->set(
m_dataSet->getTexture()->colormap()->get().newSelector( WItemSelector::IndexList( 1, 6 ) )
);
m_dataSet->getTexture()->interpolation()->set( false );
}
else
{
switch( (*dss).getValueSet()->getDataType() )
{
case W_DT_UNSIGNED_CHAR:
case W_DT_INT16:
case W_DT_SIGNED_INT:
m_dataSet->getTexture()->colormap()->set(
m_dataSet->getTexture()->colormap()->get().newSelector( WItemSelector::IndexList( 1, 5 ) )
m_dataSet->getTexture()->colormap()->get().newSelector( WItemSelector::IndexList( 1, 0 ) )
);
}
break;
default:
WAssert( false, "Unknow data type in Data module" );
break;
case W_DT_FLOAT:
case W_DT_DOUBLE:
if( boost::shared_dynamic_cast< WDataSetVector >( m_dataSet ) )
{
m_dataSet->getTexture()->colormap()->set(
m_dataSet->getTexture()->colormap()->get().newSelector( WItemSelector::IndexList( 1, 6 ) )
);
m_dataSet->getTexture()->interpolation()->set( false );
}
else
{
m_dataSet->getTexture()->colormap()->set(
m_dataSet->getTexture()->colormap()->get().newSelector( WItemSelector::IndexList( 1, 5 ) )
);
}
break;
default:
WAssert( false, "Unknow data type in Data module" );
}
}
}
}
......
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