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
c07d1aaf
Commit
c07d1aaf
authored
Dec 03, 2010
by
Alexander Wiebel
Browse files
[CHANGE
#453
] order is a selector now
parent
fd00ca8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
src/modules/teemGlyphs/WMTeemGlyphs.cpp
src/modules/teemGlyphs/WMTeemGlyphs.cpp
+18
-13
src/modules/teemGlyphs/WMTeemGlyphs.h
src/modules/teemGlyphs/WMTeemGlyphs.h
+7
-3
No files found.
src/modules/teemGlyphs/WMTeemGlyphs.cpp
View file @
c07d1aaf
...
...
@@ -158,19 +158,27 @@ void WMTeemGlyphs::properties()
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"
,
m_sliceOrientationSelection
Prop
=
m_properties
->
addProperty
(
"Slice orientation"
,
"Which slice will be shown?"
,
m_sliceOrientations
->
getSelector
(
1
),
m_recompute
);
WPropertyHelper
::
PC_SELECTONLYONE
::
addTo
(
m_sliceOrientationSelection
);
WPropertyHelper
::
PC_SELECTONLYONE
::
addTo
(
m_sliceOrientationSelection
Prop
);
m_sliceIdProp
=
m_properties
->
addProperty
(
"Slice ID"
,
"Number of the slice to display"
,
100
,
m_recompute
);
m_sliceIdProp
->
setMin
(
0
);
m_sliceIdProp
->
setMax
(
128
);
m_orderProp
=
m_properties
->
addProperty
(
"Order"
,
"Will be rounded to the next even order"
,
4
,
m_recompute
);
m_orderProp
->
setMin
(
2
);
m_orderProp
->
setMax
(
6
);
m_orders
=
boost
::
shared_ptr
<
WItemSelection
>
(
new
WItemSelection
()
);
m_orders
->
addItem
(
"2"
,
"Order 2"
);
m_orders
->
addItem
(
"4"
,
"Order 4"
);
m_orders
->
addItem
(
"6"
,
"Order 6"
);
m_orderProp
=
m_properties
->
addProperty
(
"Order"
,
"Order of the displayed spherical harmonics."
" If actual order is higer, the additional coefficients are ignored."
,
m_orders
->
getSelector
(
1
),
m_recompute
);
WPropertyHelper
::
PC_SELECTONLYONE
::
addTo
(
m_orderProp
);
m_GFAThresholdProp
=
m_properties
->
addProperty
(
"GFA threshold"
,
"Show only glyphs at voxels above the given generalized fractional"
" anisotropy (GFA) threshold"
...
...
@@ -222,6 +230,7 @@ void WMTeemGlyphs::moduleMain()
m_moduleState
.
wait
();
continue
;
}
// std::cout << "FA: " << m_GFAThresholdProp->get( true ) << std::endl;
if
(
m_input
->
getData
().
get
()
)
{
bool
dataChanged
=
false
;
...
...
@@ -233,7 +242,7 @@ void WMTeemGlyphs::moduleMain()
}
boost
::
shared_ptr
<
WGridRegular3D
>
gridReg
=
boost
::
shared_dynamic_cast
<
WGridRegular3D
>
(
m_input
->
getData
().
get
()
->
getGrid
()
);
switch
(
m_sliceOrientationSelection
->
get
(
true
).
getItemIndexOfSelected
(
0
)
)
switch
(
m_sliceOrientationSelection
Prop
->
get
(
true
).
getItemIndexOfSelected
(
0
)
)
{
case
0
:
m_sliceIdProp
->
setMax
(
gridReg
->
getNbCoordsX
()
-
1
);
...
...
@@ -258,11 +267,6 @@ void WMTeemGlyphs::moduleMain()
m_GFAThresholdProp
->
setMin
(
gfa
->
getMin
()
);
}
if
(
m_orderProp
->
get
()
%
2
!=
0
)
{
m_orderProp
->
set
(
m_orderProp
->
get
()
+
1
);
}
renderSlice
(
m_sliceIdProp
->
get
()
);
}
...
...
@@ -277,7 +281,8 @@ void WMTeemGlyphs::renderSlice( size_t sliceId )
progress
=
boost
::
shared_ptr
<
WProgress
>
(
new
WProgress
(
"Glyph Generation"
,
2
)
);
m_progress
->
addSubProgress
(
progress
);
size_t
sliceType
=
m_sliceOrientationSelection
->
get
(
true
).
getItemIndexOfSelected
(
0
);
size_t
sliceType
=
m_sliceOrientationSelectionProp
->
get
(
true
).
getItemIndexOfSelected
(
0
);
size_t
order
=
boost
::
lexical_cast
<
float
>
(
m_orders
->
getSelector
(
m_orderProp
->
get
().
getItemIndexOfSelected
(
0
)
)
.
at
(
0
)
->
getName
()
);
// Please look here http://www.ci.uchicago.edu/~schultz/sphinx/home-glyph.htm
if
(
m_moduleNode
)
...
...
@@ -293,7 +298,7 @@ void WMTeemGlyphs::renderSlice( size_t sliceId )
boost
::
shared_dynamic_cast
<
WDataSetScalar
>
(
m_inputGFA
->
getData
()
),
m_GFAThresholdProp
->
get
(),
sliceId
,
m_
order
Prop
->
get
()
,
order
,
m_subdivisionLevelProp
->
get
(),
m_moduloProp
->
get
(),
sliceType
,
...
...
src/modules/teemGlyphs/WMTeemGlyphs.h
View file @
c07d1aaf
...
...
@@ -29,8 +29,10 @@
#include <osg/Geode>
#include "../../dataHandler/WDataSetSphericalHarmonics.h"
#include "../../common/WItemSelection.h"
#include "../../common/WItemSelector.h"
#include "../../dataHandler/WDataSetScalar.h"
#include "../../dataHandler/WDataSetSphericalHarmonics.h"
#include "../../graphicsEngine/WShader.h"
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleInputData.h"
...
...
@@ -134,13 +136,15 @@ private:
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetScalar
>
>
m_inputGFA
;
//!< The input for the GFA.
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.
WPropSelection
m_sliceOrientationSelection
Prop
;
//!< To choose whether to x, y or z slice.
WPropBool
m_usePolarPlotProp
;
//!< Property indicating whether to use polar plot instead of HOME glyph
WPropBool
m_useNormalizationProp
;
//!< Indicates whether to us radius normalization.
WPropDouble
m_GFAThresholdProp
;
//!< Property holding the threshold of GFA above which glyphs should be drawn.
WPropDouble
m_glyphSizeProp
;
//!< Property holding the size of the displayed glyphs
WPropInt
m_sliceIdProp
;
//!< Property holding the slice ID
WPropInt
m_orderProp
;
//!< Property holding the order of the SH to show.
boost
::
shared_ptr
<
WItemSelection
>
m_orders
;
//!< A list of the selectable orders
WPropSelection
m_orderProp
;
//!< Property holding the order of the SH to show.
WPropInt
m_moduloProp
;
//!< Property holding information on how many glyphs will be omited between two glyphs (modulo-1).
WPropInt
m_subdivisionLevelProp
;
//!< Property holding information on the subdivision level of the spheres (resolution).
...
...
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