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
8e8b8b4f
Commit
8e8b8b4f
authored
Nov 21, 2011
by
Mario Hlawitschka
Browse files
[DOC] removed debug output and added explanation to the code
parent
49a825fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
src/qt4gui/qt4/controlPanel/transferFunction/WTransferFunctionHistogram.cpp
...trolPanel/transferFunction/WTransferFunctionHistogram.cpp
+2
-8
No files found.
src/qt4gui/qt4/controlPanel/transferFunction/WTransferFunctionHistogram.cpp
View file @
8e8b8b4f
...
...
@@ -51,11 +51,9 @@ QRectF WTransferFunctionHistogram::boundingRect() const
void
WTransferFunctionHistogram
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
/*option*/
,
QWidget
*
)
{
// std::cout << "Paint Histogram" << std::endl;
const
int
steps
=
data
.
size
();
if
(
steps
>
0
)
{
std
::
cout
<<
"actually Paint Histogram"
<<
std
::
endl
;
double
maxval
=
*
std
::
max_element
(
data
.
begin
(),
data
.
end
()
);
if
(
maxval
>
0.0
)
{
...
...
@@ -73,16 +71,12 @@ void WTransferFunctionHistogram::paint( QPainter *painter, const QStyleOptionGra
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
// 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( data[ i ]+1 )/std::log( maxval+1 ) );
bb
.
bottom
()
-
(
double
)
bb
.
height
()
*
std
::
log
(
data
[
i
]
+
1
)
/
std
::
log
(
maxval
+
1.001
)
);
}
painter
->
drawPolygon
(
histogram
);
}
// FIXME: put this somewhere else
//QRectF bb( this->scene()->sceneRect() );
//painter->setPen( QPen( Qt::black, 2 ) );
//painter->drawRect( bb );
}
}
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