Commit 5175ea4b authored by Mathias Goldau's avatar Mathias Goldau

[FIX] Random scalar dataset creator now recognizes the min-max range properly

parent cdbf531b
......@@ -72,7 +72,7 @@ WValueSetBase::SPtr WDataCreatorRandom::operator()( WProgress::SPtr progress,
// NOLINT: because we do not want to use rand_r.
double randD = static_cast< double >( std::rand() ) / static_cast< double >( RAND_MAX ); // NOLINT
data->operator[]( ( valuesPerVoxel * grid->getVoxelNum( x, y, z ) ) + v ) =
static_cast< ValueType >( m_rangeMin->get() + ( m_rangeMax->get() * randD ) );
static_cast< ValueType >( m_rangeMin->get() + ( std::abs( m_rangeMin->get() - m_rangeMax->get() ) * randD ) );
}
}
......
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