Commit e6944d71 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[FIX] used names instead of numbers and added else case

parent 7f63731f
......@@ -28,6 +28,8 @@
#include "WDataTexture3D.h"
#include "../common/WLogger.h"
WDataTexture3D::WDataTexture3D( boost::shared_ptr<WValueSetBase> valueSet, boost::shared_ptr<WGrid> grid ):
m_alpha( 1.0 ),
m_threshold( 0.0 ),
......@@ -200,26 +202,29 @@ void WDataTexture3D::createTexture()
{
osg::ref_ptr< osg::Image > ima;
if ( m_valueSet->getDataType() == 2 )
if ( m_valueSet->getDataType() == W_DT_UINT8 )
{
std::cout << "W_DT_UINT8" << std::endl;
boost::shared_ptr< WValueSet< unsigned char > > vs = boost::shared_dynamic_cast< WValueSet< unsigned char > >( m_valueSet );
unsigned char* source = const_cast< unsigned char* > ( vs->rawData() );
ima = createTexture3D( source, m_valueSet->dimension() );
}
else if ( m_valueSet->getDataType() == 4 )
else if ( m_valueSet->getDataType() == W_DT_INT16 )
{
std::cout << "W_DT_INT16" << std::endl;
boost::shared_ptr< WValueSet< int16_t > > vs = boost::shared_dynamic_cast< WValueSet< int16_t > >( m_valueSet );
int16_t* source = const_cast< int16_t* > ( vs->rawData() );
ima = createTexture3D( source, m_valueSet->dimension() );
}
else if ( m_valueSet->getDataType() == 16 )
else if ( m_valueSet->getDataType() == W_DT_FLOAT )
{
std::cout << "W_DT_FLOAT" << std::endl;
boost::shared_ptr< WValueSet< float > > vs = boost::shared_dynamic_cast< WValueSet< float > >( m_valueSet );
float* source = const_cast< float* > ( vs->rawData() );
ima = createTexture3D( source, m_valueSet->dimension() );
}
else
wlog::error( "WDataTexture3D" ) << "COnversion of this data type to texture not supported yet.";
m_texture = osg::ref_ptr<osg::Texture3D>( new osg::Texture3D );
m_texture->setFilter( osg::Texture3D::MIN_FILTER, osg::Texture3D::LINEAR );
......
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