From bdd5c49f6d7d34de815e76869862b14ade8315bc Mon Sep 17 00:00:00 2001 From: schurade Date: Fri, 8 Oct 2010 13:09:35 +0200 Subject: [PATCH] [CLEAN] further clean up of the fiber display module --- src/modules/fiberDisplay/WMFiberDisplay.cpp | 49 ++++----------------- src/modules/fiberDisplay/WMFiberDisplay.h | 12 ----- 2 files changed, 9 insertions(+), 52 deletions(-) diff --git a/src/modules/fiberDisplay/WMFiberDisplay.cpp b/src/modules/fiberDisplay/WMFiberDisplay.cpp index 105a85672..f53561621 100644 --- a/src/modules/fiberDisplay/WMFiberDisplay.cpp +++ b/src/modules/fiberDisplay/WMFiberDisplay.cpp @@ -165,9 +165,6 @@ void WMFiberDisplay::properties() { m_propCondition = boost::shared_ptr< WCondition >( new WCondition() ); - m_customColoring = m_properties->addProperty( "Custom coloring", "Switches the coloring between custom and predefined.", false, m_propCondition ); - m_coloring = m_properties->addProperty( "Global or local coloring", "Switches the coloring between global and local.", true, m_propCondition ); - m_useTubesProp = m_properties->addProperty( "Use tubes", "Draw fiber tracts as fake tubes.", false, m_propCondition ); m_useTextureProp = m_properties->addProperty( "Use texture", "Texture fibers with the texture on top of the list.", false, m_propCondition ); m_tubeThickness = m_properties->addProperty( "Tube thickness", "Adjusts the thickness of the tubes.", 50., m_propCondition ); @@ -217,11 +214,6 @@ void WMFiberDisplay::moduleMain() inputUpdated(); } - if ( m_tubeThickness->changed() ) - { - adjustTubes(); - } - if ( m_showCullBox->changed() ) { if( m_showCullBox->get() ) @@ -394,39 +386,9 @@ void WMFiberDisplay::updateRenderModes() } } -void WMFiberDisplay::toggleColoring() -{ - if( m_coloring->changed() || m_customColoring->changed() ) - { - if ( m_customColoring->get( true ) ) - { - m_fiberDrawable->setColor( m_dataset->getColorScheme( "Custom Color" )->getColor() ); - } - else - { - if ( m_coloring->get( true ) ) - { - m_fiberDrawable->setColor( m_dataset->getGlobalColors() ); - } - else - { - m_fiberDrawable->setColor( m_dataset->getLocalColors() ); - } - } - } -} - -void WMFiberDisplay::adjustTubes() -{ - if ( m_tubeThickness->changed() && m_useTubesProp->get() ) - { - m_uniformTubeThickness->set( static_cast( m_tubeThickness->get( true ) ) ); - } -} - void WMFiberDisplay::saveSelected() { - boost::shared_ptr< std::vector< bool > > active = WKernel::getRunningKernel()->getSelectionManager()->getBitField(); + boost::shared_ptr< std::vector< bool > > active = m_fiberSelector->getBitfield(); m_dataset->saveSelected( m_saveFileName->getAsString(), active ); } @@ -476,6 +438,13 @@ void WMFiberDisplay::notifyTextureChange() void WMFiberDisplay::updateCallback() { update(); - toggleColoring(); + + m_fiberDrawable->setColor( m_dataset->getColorScheme()->getColor() ); + + if ( m_tubeThickness->changed() && m_useTubesProp->get() ) + { + m_uniformTubeThickness->set( static_cast( m_tubeThickness->get( true ) ) ); + } + updateRenderModes(); } diff --git a/src/modules/fiberDisplay/WMFiberDisplay.h b/src/modules/fiberDisplay/WMFiberDisplay.h index 951245b96..17130e52e 100644 --- a/src/modules/fiberDisplay/WMFiberDisplay.h +++ b/src/modules/fiberDisplay/WMFiberDisplay.h @@ -129,11 +129,6 @@ protected: */ void updateRenderModes(); - /** - * Enable disable global or local coloring - */ - void toggleColoring(); - private: /** * function gets called when the input connector has been updated @@ -150,8 +145,6 @@ private: */ boost::shared_ptr< WCondition > m_propCondition; - WPropBool m_coloring; //!< Enable/Disable global (true) or local (false) coloring of the fiber tracts - WPropBool m_customColoring; //!< Enable/Disable custom colors WPropBool m_useTubesProp; //!< Property indicating whether to use tubes for the fibers tracts. WPropBool m_useTextureProp; //!< Property indicating whether to use tubes for the fibers tracts. WPropDouble m_tubeThickness; //!< Property determining the thickness of tubes . @@ -256,11 +249,6 @@ private: osg::ref_ptr< WROIBox > m_cullBox; //!< stores a pointer to the cull box - /** - * changes tube parameters - */ - void adjustTubes(); - /** * saves the currently selected (active field from roi manager) fibers to a file */ -- GitLab