Commit c5ce86ce authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - navslices now use the selection manager again. GUI properly handles...

[CHANGE] - navslices now use the selection manager again. GUI properly handles show properties of nav-slices
parent 92f79e56
......@@ -446,7 +446,7 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
// nav slices use separate buttons for slice on/off switching
if( module->getName() == "Navigation Slices" )
{
boost::shared_ptr< WPropertyBase > prop = module->getProperties()->findProperty( "Show Axial" );
boost::shared_ptr< WPropertyBase > prop = module->getProperties()->findProperty( "Slices/Show Axial" );
if( !prop )
{
WLogger::getLogger()->
......@@ -463,7 +463,7 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
propertyActionMap[prop] = a;
}
prop = module->getProperties()->findProperty( "Show Coronal" );
prop = module->getProperties()->findProperty( "Slices/Show Coronal" );
if( !prop )
{
WLogger::getLogger()->
......@@ -480,7 +480,7 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
propertyActionMap[prop] = a;
}
prop = module->getProperties()->findProperty( "Show Sagittal" );
prop = module->getProperties()->findProperty( "Slices/Show Sagittal" );
if( !prop )
{
WLogger::getLogger()->
......@@ -498,7 +498,7 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
}
// now setup the nav widget sliders
prop = module->getProperties()->findProperty( "Axial Position" );
prop = module->getProperties()->findProperty( "Slices/Axial Position" );
if( !prop )
{
WLogger::getLogger()->
......@@ -513,7 +513,7 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
}
}
prop = module->getProperties()->findProperty( "Coronal Position" );
prop = module->getProperties()->findProperty( "Slices/Coronal Position" );
if( !prop )
{
WLogger::getLogger()->
......@@ -528,7 +528,7 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
}
}
prop = module->getProperties()->findProperty( "Sagittal Position" );
prop = module->getProperties()->findProperty( "Slices/Sagittal Position" );
if( !prop )
{
WLogger::getLogger()->
......
......@@ -163,32 +163,44 @@ void WSelectionManager::setTextureOpacity( float value )
m_textureOpacity = value;
}
void WSelectionManager::setPropAxialPos( WPropInt prop )
void WSelectionManager::setPropAxialPos( WPropDouble prop )
{
m_axialUpdateConnection.disconnect();
m_axialPos = prop;
m_axialUpdateConnection = m_axialPos->getUpdateCondition()->subscribeSignal(
boost::bind( &WSelectionManager::updateCrosshairPosition, this )
);
}
void WSelectionManager::setPropCoronalPos( WPropInt prop )
void WSelectionManager::setPropCoronalPos( WPropDouble prop )
{
m_coronalUpdateConnection.disconnect();
m_coronalPos = prop;
m_coronalUpdateConnection = m_coronalPos->getUpdateCondition()->subscribeSignal(
boost::bind( &WSelectionManager::updateCrosshairPosition, this )
);
}
void WSelectionManager::setPropSagittalPos( WPropInt prop )
void WSelectionManager::setPropSagittalPos( WPropDouble prop )
{
m_sagittalUpdateConnection.disconnect();
m_sagittalPos = prop;
m_sagittalUpdateConnection = m_sagittalPos->getUpdateCondition()->subscribeSignal(
boost::bind( &WSelectionManager::updateCrosshairPosition, this )
);
}
WPropInt WSelectionManager::getPropAxialPos()
WPropDouble WSelectionManager::getPropAxialPos()
{
return m_axialPos;
}
WPropInt WSelectionManager::getPropCoronalPos()
WPropDouble WSelectionManager::getPropCoronalPos()
{
return m_coronalPos;
}
WPropInt WSelectionManager::getPropSagittalPos()
WPropDouble WSelectionManager::getPropSagittalPos()
{
return m_sagittalPos;
}
......@@ -202,3 +214,9 @@ int WSelectionManager::getShader()
{
return m_shader;
}
void WSelectionManager::updateCrosshairPosition()
{
m_crosshair->setPosition( WPosition( m_sagittalPos->get(), m_coronalPos->get(), m_axialPos->get()) );
}
......@@ -121,40 +121,40 @@ public:
void setTextureOpacity( float value );
/**
* setter
* setter. These props automatically update the crosshair position
* \param prop
*/
void setPropAxialPos( WPropInt prop );
void setPropAxialPos( WPropDouble prop );
/**
* setter
* setter. These props automatically update the crosshair position
* \param prop
*/
void setPropCoronalPos( WPropInt prop );
void setPropCoronalPos( WPropDouble prop );
/**
* setter
* setter. These props automatically update the crosshair position
* \param prop
*/
void setPropSagittalPos( WPropInt prop );
void setPropSagittalPos( WPropDouble prop );
/**
* getter
* \return property
*/
WPropInt getPropAxialPos();
WPropDouble getPropAxialPos();
/**
* getter
* \return property
*/
WPropInt getPropCoronalPos();
WPropDouble getPropCoronalPos();
/**
* getter
* \return property
*/
WPropInt getPropSagittalPos();
WPropDouble getPropSagittalPos();
/**
* setter for the shader index to be used with the custom texture
......@@ -170,23 +170,42 @@ public:
protected:
private:
/**
* Updates the crosshair position
*/
void updateCrosshairPosition();
boost::shared_ptr< WCrosshair >m_crosshair; //!< stores pointer to crosshair
/**
* Axial slice position.
*/
WPropInt m_axialPos;
WPropDouble m_axialPos;
/**
* Coronal slice position.
*/
WPropInt m_coronalPos;
WPropDouble m_coronalPos;
/**
* Sagittal slice position.
*/
WPropInt m_sagittalPos;
WPropDouble m_sagittalPos;
/**
* The connection for the axial property
*/
boost::signals2::connection m_axialUpdateConnection;
/**
* The connection for the coronal property
*/
boost::signals2::connection m_coronalUpdateConnection;
/**
* The connection for the sagittal property
*/
boost::signals2::connection m_sagittalUpdateConnection;
WPaintMode m_paintMode; //!< stores the currently selected paint mode
......
......@@ -95,7 +95,7 @@ void WMArbitraryPlane::properties()
false, m_propCondition );
m_showManipulators = m_properties->addProperty( "Show manipulators", "Hide/Show manipulators.", true, m_propCondition );
m_attach2Crosshair = m_properties->addProperty( "Attach to crosshair", "Attach to Crosshair", false, m_propCondition );
m_attach2Crosshair = m_properties->addProperty( "Attach to crosshair", "Attach to Crosshair", true, m_propCondition );
m_buttonReset2Axial = m_properties->addProperty( "Axial", "Resets and aligns the plane", WPVBaseTypes::PV_TRIGGER_READY, m_propCondition );
m_buttonReset2Coronal = m_properties->addProperty( "Coronal", "Resets and aligns the plane", WPVBaseTypes::PV_TRIGGER_READY, m_propCondition );
......
......@@ -37,6 +37,7 @@
#include "../../graphicsEngine/shaders/WGEShader.h"
#include "../../graphicsEngine/shaders/WGEShaderDefineOptions.h"
#include "../../graphicsEngine/shaders/WGEShaderPropertyDefineOptions.h"
#include "../../kernel/WSelectionManager.h"
#include "../../graphicsEngine/WGraphicsEngine.h"
#include "../../kernel/WKernel.h"
......@@ -302,6 +303,11 @@ void WMNavigationSlices::moduleMain()
// we need to be informed if the bounding box of the volume containing all the data changes.
m_moduleState.add( WGEColormapping::instance()->getChangeCondition() );
// Forward position to selection manager.
WKernel::getRunningKernel()->getSelectionManager()->setPropSagittalPos( m_xPos );
WKernel::getRunningKernel()->getSelectionManager()->setPropCoronalPos( m_yPos );
WKernel::getRunningKernel()->getSelectionManager()->setPropAxialPos( m_zPos );
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// Main loop
/////////////////////////////////////////////////////////////////////////////////////////////////////////
......
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