Commit fe424a95 authored by Alexander Wiebel's avatar Alexander Wiebel

[ADD #343] made slice orientation selectable

parent 16c65f0c
......@@ -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
};
sliceTypeEnum 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
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment