Commit 48393d3b authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents e1231b9b 75e1cdcd
......@@ -3,17 +3,18 @@
<br>
<br>
Hello User! New to OpenWalnut? Have a look at <a href="http://www.openwalnut.org">http://www.openwalnut.org</a>!
<br>
We provide
<ul>
<li> <a href="http://www.openwalnut.org/projects/openwalnut/wiki/FirstSteps">first steps tutorial</a>,
<li> user documentation,
<li> programming tutorials
<li> <a href="http://www.openwalnut.org/projects/openwalnut/wiki/FirstSteps">a first steps tutorial</a>,
<li> a user documentation,
<li> programming tutorials,
<li> and the latest information on OpenWalnut.
</ul>
Do you have problems using OpenWalnut? Do not hesitate to ask:
<ul>
<li><a href="mailto:openwalnut@lists.informatik.uni-leipzig.de">Mailing list</a>
<li>IRC Chat on irc.freenode.net in #ow
<li>IRC Chat on irc.freenode.net, channel #ow
</ul>
Found a bug? Do you have ideas for improvements? Please <a href="http://www.openwalnut.org/projects/openwalnut/wiki/Contribute">report</a> these issues! We can improve OpenWalnut only with your help and ideas.
<br><br>
......
......@@ -37,7 +37,7 @@
WTransferFunctionHistogram::WTransferFunctionHistogram( WTransferFunctionWidget * /*parent*/ ) : BaseClass()
{
setOpacity( 0.3 );
setOpacity( 0.4 );
setZValue( 2 );
}
......@@ -65,19 +65,45 @@ void WTransferFunctionHistogram::paint( QPainter *painter, const QStyleOptionGra
painter->setBrush( gradient );
QPolygon histogram;
QRectF bb( this->scene()->sceneRect() );
histogram << QPoint( bb.right(), bb.bottom() );
histogram << QPoint( bb.left(), bb.bottom() );
// polygon for logarithmic mapping ( background )
{
QPolygon histogram;
QRectF bb( this->scene()->sceneRect() );
histogram << QPoint( bb.right(), bb.bottom() );
histogram << QPoint( bb.left(), bb.bottom() );
for( int i = 0; i < steps; ++i )
for( int i = 0; i < steps; ++i )
{
// logarithmic mapping of histogram to values
// the added 0.001 is to avoid numerical problems but should work for most data sets
// when changing this value, keep in mind that the value has to work for a wide range of
// numbers ( i.e. maxval close to 0 and maxval close to infty )
histogram << QPoint( bb.left()+ ( double )bb.width()*( double )i/( double )steps,
bb.bottom() - ( double )bb.height() * std::log( m_data[ i ]+1 )/std::log( maxval+1+0.001 ) );
}
painter->drawPolygon( histogram );
}
// The paper "Multi-Dimensional Transfer Functions for Interactive Volume Rendering"
// by Joe Kniss, Gordon Kindlmann and Charles Hansen
// brought the idea of overlaying the logarithmic plot with a non-logarithmic plot
// which may help to understand the data a bit better. Maybe this should be a config option,
// but for now it is there for whoever likes to see it.
//
// polygon for non-logarithmic mapping
{
// logarithmic mapping of histogram to values
// the added 1.001 is to avoid numerical problems but should work for most data sets
histogram << QPoint( bb.left()+ ( double )bb.width()*( double )i/( double )steps,
bb.bottom() - ( double )bb.height() * std::log( m_data[ i ]+1 )/std::log( maxval+1.001 ) );
QPolygon histogram;
QRectF bb( this->scene()->sceneRect() );
histogram << QPoint( bb.right(), bb.bottom() );
histogram << QPoint( bb.left(), bb.bottom() );
for( int i = 0; i < steps; ++i )
{
// linear mapping of histogram to values
histogram << QPoint( bb.left()+ ( double )bb.width()*( double )i/( double )steps,
bb.bottom() - ( double )bb.height() * m_data[ i ]/maxval );
}
painter->drawPolygon( histogram );
}
painter->drawPolygon( histogram );
}
}
}
......
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