Commit 869ceb7e authored by Joshua Santana's avatar Joshua Santana
Browse files

[FIX #52] set correct opacity when changing alpha value in transfer function

parent 4a49bb2a
......@@ -51,7 +51,7 @@ boost::shared_ptr< std::vector<unsigned char> > WMCsvConverter::sampleTransferFu
{
boost::shared_ptr< std::vector<unsigned char> > data( new std::vector<unsigned char>( 10 * 4 ) );
WTransferFunction tf = m_propertyStatus->getVisualizationPropertyHandler()->getTransferFunction()->get();
WTransferFunction tf = m_propertyStatus->getVisualizationPropertyHandler()->getTransferFunction()->get( true );
tf.sample1DTransferFunction( &( *data )[ 0 ], 10, 0.0, 1.0 );
......@@ -64,7 +64,7 @@ void WMCsvConverter::normalizeEdeps( SPFloatVector edeps, SPFloatVector colorArr
for( std::vector< float >::iterator currentEdep = edeps->begin(); currentEdep != edeps->end(); currentEdep++ )
{
float clusterSize = 9.0 *( ( 2.4 * ( pow( *currentEdep, 0.338 ) ) ) / 4.0 );
int clusterSize = 9.0 *( ( 2.4 * ( pow( *currentEdep, 0.338 ) ) ) / 4.0 );
float r = data->at( clusterSize * 4 ) / 255.0;
float g = data->at( clusterSize * 4 + 1 ) / 255.0;
......
......@@ -87,9 +87,11 @@ WTransferFunction WMVisualizationPropertyHandler::setColorGradient()
tf.addColor( 0.75, WColor( 0.97, 0.0, 0.53, 1.0 ) );
tf.addColor( 1.0, WColor( 1.0, 0.0, 0.0, 1.0 ) );
tf.addAlpha( 0.0, 0.0 );
tf.addAlpha( 0.75, 0.25 );
tf.addAlpha( 1.0, 0.5 );
tf.addAlpha( 0.0, 1.0 );
tf.addAlpha( 0.25, 1.0 );
tf.addAlpha( 0.5, 1.0 );
tf.addAlpha( 0.75, 1.0 );
tf.addAlpha( 1.0, 1.0 );
return tf;
}
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