Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
48393d3b
Commit
48393d3b
authored
Jul 12, 2012
by
Sebastian Eichelbaum
Browse files
[MERGE]
parents
e1231b9b
75e1cdcd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
15 deletions
+42
-15
doc/qt4gui/help/OpenWalnutWelcome.html
doc/qt4gui/help/OpenWalnutWelcome.html
+5
-4
src/qt4gui/qt4/controlPanel/transferFunction/WTransferFunctionHistogram.cpp
...trolPanel/transferFunction/WTransferFunctionHistogram.cpp
+37
-11
No files found.
doc/qt4gui/help/OpenWalnutWelcome.html
View file @
48393d3b
...
...
@@ -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>
...
...
src/qt4gui/qt4/controlPanel/transferFunction/WTransferFunctionHistogram.cpp
View file @
48393d3b
...
...
@@ -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
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment