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
fe424a95
Commit
fe424a95
authored
Aug 04, 2010
by
Alexander Wiebel
Browse files
[ADD
#343
] made slice orientation selectable
parent
16c65f0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
src/modules/homeGlyphs/WMHomeGlyphs.cpp
src/modules/homeGlyphs/WMHomeGlyphs.cpp
+13
-2
src/modules/homeGlyphs/WMHomeGlyphs.h
src/modules/homeGlyphs/WMHomeGlyphs.h
+5
-4
No files found.
src/modules/homeGlyphs/WMHomeGlyphs.cpp
View file @
fe424a95
...
...
@@ -29,6 +29,7 @@
#include <osg/LightModel>
#include "../../common/WAssert.h"
#include "../../common/WPropertyHelper.h"
#include "../../kernel/WKernel.h"
#include "home.xpm"
...
...
@@ -82,6 +83,16 @@ void WMHomeGlyphs::connectors()
void
WMHomeGlyphs
::
properties
()
{
m_sliceOrientations
=
boost
::
shared_ptr
<
WItemSelection
>
(
new
WItemSelection
()
);
m_sliceOrientations
->
addItem
(
"x"
,
"x-slice"
);
m_sliceOrientations
->
addItem
(
"y"
,
"y-slice"
);
m_sliceOrientations
->
addItem
(
"z"
,
"z-slice"
);
m_sliceOrientationSelection
=
m_properties
->
addProperty
(
"Slice Orientation"
,
"Which slice will be shown?"
,
m_sliceOrientations
->
getSelectorFirst
(),
m_recompute
);
WPropertyHelper
::
PC_SELECTONLYONE
::
addTo
(
m_sliceOrientationSelection
);
m_glyphSizeProp
=
m_properties
->
addProperty
(
"Glyph Size"
,
"Size of the displayed glyphs."
,
0.5
,
m_recompute
);
m_glyphSizeProp
->
setMin
(
0
);
m_glyphSizeProp
->
setMax
(
100.
);
...
...
@@ -121,12 +132,12 @@ void WMHomeGlyphs::renderSlice( size_t sliceId )
{
enum
sliceTypeEnum
{
xSlice
,
xSlice
=
0
,
ySlice
,
zSlice
};
sliceType
Enum
sliceType
=
ySlice
;
size_t
sliceType
=
m_sliceOrientationSelection
->
get
(
true
).
getItemIndexOfSelected
(
0
)
;
debugLog
()
<<
"Rendering slice ... "
<<
sliceId
;
// Please look here http://www.ci.uchicago.edu/~schultz/sphinx/home-glyph.htm
...
...
src/modules/homeGlyphs/WMHomeGlyphs.h
View file @
fe424a95
...
...
@@ -111,9 +111,6 @@ private:
*/
boost
::
shared_ptr
<
WCondition
>
m_recompute
;
WPropDouble
m_glyphSizeProp
;
//!< Property holding the size of the displayed glyphs
WPropInt
m_sliceIdProp
;
//!< Property holding the slice ID
/**
* Just a preliminary function to avoid polluting moduleMain()
*/
...
...
@@ -130,10 +127,14 @@ private:
* \param sliceId The number of the slice to be rendered.
*/
void
renderSlice
(
size_t
sliceId
);
osg
::
ref_ptr
<
WShader
>
m_shader
;
//!< The shader used for the glyph surfaces
osg
::
ref_ptr
<
WShader
>
m_shader
;
//!< The shader used for the glyph surfaces
boost
::
shared_ptr
<
WItemSelection
>
m_sliceOrientations
;
//!< A list of the selectable slice orientations, i.e x, y and z.
WPropSelection
m_sliceOrientationSelection
;
//!< To choose whether to x, y or z slice.
WPropBool
m_usePolarPlotProp
;
//!< Property indicating whether to use polar plot instead of HOME glyph
WPropDouble
m_glyphSizeProp
;
//!< Property holding the size of the displayed glyphs
WPropInt
m_sliceIdProp
;
//!< Property holding the slice ID
osg
::
ref_ptr
<
osg
::
Geode
>
m_glyphsGeode
;
//!< Pointer to geode containing the glyphs.
osg
::
ref_ptr
<
WGEGroupNode
>
m_moduleNode
;
//!< Pointer to the modules group node.
...
...
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