Commit bdd5c49f authored by schurade's avatar schurade

[CLEAN] further clean up of the fiber display module

parent 9e451ce0
...@@ -165,9 +165,6 @@ void WMFiberDisplay::properties() ...@@ -165,9 +165,6 @@ void WMFiberDisplay::properties()
{ {
m_propCondition = boost::shared_ptr< WCondition >( new WCondition() ); 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_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_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 ); m_tubeThickness = m_properties->addProperty( "Tube thickness", "Adjusts the thickness of the tubes.", 50., m_propCondition );
...@@ -217,11 +214,6 @@ void WMFiberDisplay::moduleMain() ...@@ -217,11 +214,6 @@ void WMFiberDisplay::moduleMain()
inputUpdated(); inputUpdated();
} }
if ( m_tubeThickness->changed() )
{
adjustTubes();
}
if ( m_showCullBox->changed() ) if ( m_showCullBox->changed() )
{ {
if( m_showCullBox->get() ) if( m_showCullBox->get() )
...@@ -394,39 +386,9 @@ void WMFiberDisplay::updateRenderModes() ...@@ -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<float>( m_tubeThickness->get( true ) ) );
}
}
void WMFiberDisplay::saveSelected() 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 ); m_dataset->saveSelected( m_saveFileName->getAsString(), active );
} }
...@@ -476,6 +438,13 @@ void WMFiberDisplay::notifyTextureChange() ...@@ -476,6 +438,13 @@ void WMFiberDisplay::notifyTextureChange()
void WMFiberDisplay::updateCallback() void WMFiberDisplay::updateCallback()
{ {
update(); update();
toggleColoring();
m_fiberDrawable->setColor( m_dataset->getColorScheme()->getColor() );
if ( m_tubeThickness->changed() && m_useTubesProp->get() )
{
m_uniformTubeThickness->set( static_cast<float>( m_tubeThickness->get( true ) ) );
}
updateRenderModes(); updateRenderModes();
} }
...@@ -129,11 +129,6 @@ protected: ...@@ -129,11 +129,6 @@ protected:
*/ */
void updateRenderModes(); void updateRenderModes();
/**
* Enable disable global or local coloring
*/
void toggleColoring();
private: private:
/** /**
* function gets called when the input connector has been updated * function gets called when the input connector has been updated
...@@ -150,8 +145,6 @@ private: ...@@ -150,8 +145,6 @@ private:
*/ */
boost::shared_ptr< WCondition > m_propCondition; 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_useTubesProp; //!< Property indicating whether to use tubes for the fibers tracts.
WPropBool m_useTextureProp; //!< 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 . WPropDouble m_tubeThickness; //!< Property determining the thickness of tubes .
...@@ -256,11 +249,6 @@ private: ...@@ -256,11 +249,6 @@ private:
osg::ref_ptr< WROIBox > m_cullBox; //!< stores a pointer to the cull box 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 * saves the currently selected (active field from roi manager) fibers to a file
*/ */
......
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