Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
2352fe09
Commit
2352fe09
authored
Nov 17, 2014
by
reichenbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[STYLE] fixed intention
parent
518c3ae3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
63 deletions
+63
-63
src/modules/histogramView/WMHistogramView.cpp
src/modules/histogramView/WMHistogramView.cpp
+63
-63
No files found.
src/modules/histogramView/WMHistogramView.cpp
View file @
2352fe09
...
...
@@ -547,69 +547,69 @@ void WMHistogramView::createGeometryStairs()
calculateFrameSize
();
calculateFramePosition
();
// this is the geode for the histogram bars
osg
::
ref_ptr
<
osg
::
Geode
>
geode
=
new
osg
::
Geode
();
geode
->
setDataVariance
(
osg
::
Object
::
STATIC
);
osg
::
ref_ptr
<
osg
::
Vec2Array
>
lineVertices
=
new
osg
::
Vec2Array
;
osg
::
ref_ptr
<
osg
::
Vec4Array
>
lineColors
=
new
osg
::
Vec4Array
;
// one color per dataset
WColor
color
=
m_color
->
get
(
true
);
color
[
3
]
=
1.0
;
lineColors
->
push_back
(
color
);
// add lines for every bar/bucket/bin
for
(
std
::
size_t
j
=
0
;
j
<
m_histogram
->
size
();
++
j
)
{
// 'histogram' coords for bar j
std
::
pair
<
double
,
double
>
barPosHistoCoordsX
=
m_histogram
->
getIntervalForIndex
(
j
);
WVector2d
barLowerLeft
(
barPosHistoCoordsX
.
first
,
0.0
);
WVector2d
barUpperRight
(
barPosHistoCoordsX
.
second
,
m_histogram
->
at
(
j
)
);
// transform to window coords
barLowerLeft
=
histogramSpaceToWindowSpace
(
barLowerLeft
);
barUpperRight
=
histogramSpaceToWindowSpace
(
barUpperRight
);
// line vertices
if
(
j
==
0
)
{
lineVertices
->
push_back
(
barLowerLeft
);
}
lineVertices
->
push_back
(
WVector2d
(
barLowerLeft
[
0
],
barUpperRight
[
1
]
)
);
lineVertices
->
push_back
(
barUpperRight
);
if
(
j
==
m_histogram
->
size
()
-
1
)
{
lineVertices
->
push_back
(
WVector2d
(
barUpperRight
[
0
],
barLowerLeft
[
1
]
)
);
}
}
// create drawable for the lines
{
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
new
osg
::
Geometry
;
geometry
->
addPrimitiveSet
(
new
osg
::
DrawArrays
(
osg
::
PrimitiveSet
::
LINE_STRIP
,
0
,
2
*
m_histogram
->
size
()
+
2
)
);
geometry
->
setVertexArray
(
lineVertices
);
geometry
->
setColorArray
(
lineColors
);
geometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
// enable VBO
geometry
->
setUseDisplayList
(
false
);
geometry
->
setUseVertexBufferObjects
(
true
);
geode
->
addDrawable
(
geometry
);
}
// we do not want any lighting
osg
::
StateSet
*
state
=
geode
->
getOrCreateStateSet
();
state
->
setMode
(
GL_LIGHTING
,
osg
::
StateAttribute
::
OFF
|
osg
::
StateAttribute
::
PROTECTED
);
// no depth test
state
->
setMode
(
GL_DEPTH_TEST
,
osg
::
StateAttribute
::
OFF
);
state
->
setRenderBinDetails
(
1001
,
"RenderBin"
);
m_mainNode
->
insert
(
geode
);
// this is the geode for the histogram bars
osg
::
ref_ptr
<
osg
::
Geode
>
geode
=
new
osg
::
Geode
();
geode
->
setDataVariance
(
osg
::
Object
::
STATIC
);
osg
::
ref_ptr
<
osg
::
Vec2Array
>
lineVertices
=
new
osg
::
Vec2Array
;
osg
::
ref_ptr
<
osg
::
Vec4Array
>
lineColors
=
new
osg
::
Vec4Array
;
// one color per dataset
WColor
color
=
m_color
->
get
(
true
);
color
[
3
]
=
1.0
;
lineColors
->
push_back
(
color
);
// add lines for every bar/bucket/bin
for
(
std
::
size_t
j
=
0
;
j
<
m_histogram
->
size
();
++
j
)
{
// 'histogram' coords for bar j
std
::
pair
<
double
,
double
>
barPosHistoCoordsX
=
m_histogram
->
getIntervalForIndex
(
j
);
WVector2d
barLowerLeft
(
barPosHistoCoordsX
.
first
,
0.0
);
WVector2d
barUpperRight
(
barPosHistoCoordsX
.
second
,
m_histogram
->
at
(
j
)
);
// transform to window coords
barLowerLeft
=
histogramSpaceToWindowSpace
(
barLowerLeft
);
barUpperRight
=
histogramSpaceToWindowSpace
(
barUpperRight
);
// line vertices
if
(
j
==
0
)
{
lineVertices
->
push_back
(
barLowerLeft
);
}
lineVertices
->
push_back
(
WVector2d
(
barLowerLeft
[
0
],
barUpperRight
[
1
]
)
);
lineVertices
->
push_back
(
barUpperRight
);
if
(
j
==
m_histogram
->
size
()
-
1
)
{
lineVertices
->
push_back
(
WVector2d
(
barUpperRight
[
0
],
barLowerLeft
[
1
]
)
);
}
}
// create drawable for the lines
{
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
new
osg
::
Geometry
;
geometry
->
addPrimitiveSet
(
new
osg
::
DrawArrays
(
osg
::
PrimitiveSet
::
LINE_STRIP
,
0
,
2
*
m_histogram
->
size
()
+
2
)
);
geometry
->
setVertexArray
(
lineVertices
);
geometry
->
setColorArray
(
lineColors
);
geometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
// enable VBO
geometry
->
setUseDisplayList
(
false
);
geometry
->
setUseVertexBufferObjects
(
true
);
geode
->
addDrawable
(
geometry
);
}
// we do not want any lighting
osg
::
StateSet
*
state
=
geode
->
getOrCreateStateSet
();
state
->
setMode
(
GL_LIGHTING
,
osg
::
StateAttribute
::
OFF
|
osg
::
StateAttribute
::
PROTECTED
);
// no depth test
state
->
setMode
(
GL_DEPTH_TEST
,
osg
::
StateAttribute
::
OFF
);
state
->
setRenderBinDetails
(
1001
,
"RenderBin"
);
m_mainNode
->
insert
(
geode
);
}
double
WMHistogramView
::
findOptimalSpacing
(
double
intervalLength
,
double
availableSpace
,
double
textSize
)
...
...
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