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
40be9068
Commit
40be9068
authored
Dec 12, 2011
by
André Reichenbach
Browse files
[ADD] added more bin information to WMHistogramView
parent
95590e79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
src/modules/histogramView/WMHistogramView.cpp
src/modules/histogramView/WMHistogramView.cpp
+22
-2
No files found.
src/modules/histogramView/WMHistogramView.cpp
View file @
40be9068
...
...
@@ -1138,7 +1138,8 @@ void WMHistogramView::createInfo()
if
(
bin
<
m_histograms
[
0
]
->
size
()
)
{
// add the bin value for every dataset as a text in the top right corner of the window
int
h
=
0
;
int
h
=
1
;
for
(
std
::
size_t
k
=
0
;
k
<
m_data
.
size
();
++
k
)
{
if
(
!
m_data
[
k
]
)
...
...
@@ -1146,7 +1147,7 @@ void WMHistogramView::createInfo()
continue
;
}
WVector3d
textPos
(
m_windowWidth
-
20.0
,
m_windowHeight
-
(
h
+
1
)
*
16
,
0.0
);
WVector3d
textPos
(
m_windowWidth
-
20.0
,
m_windowHeight
-
h
*
16
,
0.0
);
osgText
::
Text
*
text
=
new
osgText
::
Text
;
...
...
@@ -1163,6 +1164,25 @@ void WMHistogramView::createInfo()
++
h
;
}
// add the bin minimum and maximum
WVector3d
textPos
(
m_windowWidth
-
20.0
,
m_windowHeight
-
h
*
16
,
0.0
);
osgText
::
Text
*
text
=
new
osgText
::
Text
;
std
::
stringstream
s
;
s
<<
"["
<<
m_histograms
[
0
]
->
getIntervalForIndex
(
bin
).
first
<<
","
<<
m_histograms
[
0
]
->
getIntervalForIndex
(
bin
).
second
<<
")"
;
text
->
setFont
(
WPathHelper
::
getAllFonts
().
Default
.
file_string
()
);
text
->
setColor
(
WColor
(
0.0
,
0.0
,
0.0
,
1.0
)
);
text
->
setCharacterSize
(
12
);
text
->
setAlignment
(
osgText
::
TextBase
::
RIGHT_CENTER
);
text
->
setPosition
(
textPos
);
text
->
setLayout
(
osgText
::
Text
::
LEFT_TO_RIGHT
);
text
->
setText
(
s
.
str
()
);
m_infoNode
->
addDrawable
(
text
);
// mark the currently selected histogram bin by simple drawing a bar in the background
m_markerNode
=
new
osg
::
Geode
;
...
...
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