Commit 0c3af408 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - the slice-sliders in the navwidgets are back

parent 2ff8517f
......@@ -371,17 +371,23 @@ void WMainWindow::setupGUI()
m_navAxial = boost::shared_ptr< WQtNavGLWidget >( new WQtNavGLWidget( "Axial View", "Axial View", this, "Axial Slice",
m_mainGLWidget.get() ) );
m_navAxial->setFeatures( QDockWidget::AllDockWidgetFeatures );
m_navAxial->setSliderProperty( WKernel::getRunningKernel()->getSelectionManager()->getPropAxialPos() );
m_glDock->addDockWidget( Qt::LeftDockWidgetArea, m_navAxial.get() );
m_navCoronal = boost::shared_ptr< WQtNavGLWidget >( new WQtNavGLWidget( "Coronal View", "Coronal View", this, "Coronal Slice",
m_mainGLWidget.get() ) );
m_navCoronal->setFeatures( QDockWidget::AllDockWidgetFeatures );
m_navCoronal->setSliderProperty( WKernel::getRunningKernel()->getSelectionManager()->getPropCoronalPos() );
m_glDock->addDockWidget( Qt::LeftDockWidgetArea, m_navCoronal.get() );
m_navSagittal =
boost::shared_ptr< WQtNavGLWidget >( new WQtNavGLWidget( "Sagittal View", "Sagittal View", this, "Sagittal Slice",
m_mainGLWidget.get() ) );
m_navSagittal->setFeatures( QDockWidget::AllDockWidgetFeatures );
m_navSagittal->setSliderProperty( WKernel::getRunningKernel()->getSelectionManager()->getPropSagittalPos() );
m_glDock->addDockWidget( Qt::LeftDockWidgetArea, m_navSagittal.get() );
bgColorMenu->addAction( m_navAxial->getGLWidget()->getBackgroundColorAction() );
......@@ -438,25 +444,6 @@ void WMainWindow::moduleSpecificCleanup( boost::shared_ptr< WModule > module )
prop = module->getProperties()->findProperty( "showSagittal" );
m_permanentToolBar->removeAction( propertyActionMap[prop] );
propertyActionMap.erase( prop );
prop = module->getProperties()->findProperty( "Axial Slice" );
if( m_navAxial )
{
m_navAxial->removeSliderProperty( prop );
}
prop = module->getProperties()->findProperty( "Coronal Slice" );
if( m_navCoronal )
{
m_navCoronal->removeSliderProperty( prop );
}
prop = module->getProperties()->findProperty( "Sagittal Slice" );
if( m_navSagittal )
{
m_navSagittal->removeSliderProperty( prop );
}
}
}
......@@ -552,52 +539,6 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
m_permanentToolBar->addAction( a );
propertyActionMap[prop] = a;
}
// now setup the nav widget sliders
prop = module->getProperties()->findProperty( "Slices/Axial Position" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"Axial Position\", which is required by the GUI.", "GUI",
LL_ERROR );
}
else
{
if( m_navAxial )
{
//m_navAxial->setSliderProperty( prop );
}
}
prop = module->getProperties()->findProperty( "Slices/Coronal Position" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"Coronal Position\", which is required by the GUI.", "GUI",
LL_ERROR );
}
else
{
if( m_navCoronal )
{
//m_navCoronal->setSliderProperty( prop );
}
}
prop = module->getProperties()->findProperty( "Slices/Sagittal Position" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"Sagittal Position\", which is required by the GUI.", "GUI",
LL_ERROR );
}
else
{
if( m_navSagittal )
{
//m_navSagittal->setSliderProperty( prop );
}
}
}
}
......
......@@ -162,7 +162,6 @@ int WQt4Gui::run()
new boost::function< void( osg::ref_ptr< WROI > ) > ( boost::bind( &WQt4Gui::slotAddRoiToTree, this, _1 ) ) );
m_kernel->getRoiManager()->addAddNotifier( assocRoiSignal );
boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > > removeRoiSignal;
removeRoiSignal =
boost::shared_ptr< boost::function< void( osg::ref_ptr< WROI > ) > >(
......
......@@ -56,7 +56,7 @@ WQtNavGLWidget::WQtNavGLWidget( QString viewTitle, QString dockTitle, QWidget* p
WQtNavGLWidget::~WQtNavGLWidget()
{
for( std::map< boost::shared_ptr< WPropertyBase >, WPropertyIntWidget* >::iterator it = propertyWidgetMap.begin();
for( std::map< boost::shared_ptr< WPropertyBase >, WPropertyDoubleWidget* >::iterator it = propertyWidgetMap.begin();
it != propertyWidgetMap.end();
++it )
{
......@@ -74,8 +74,8 @@ void WQtNavGLWidget::setSliderTitle( std::string title )
void WQtNavGLWidget::setSliderProperty( boost::shared_ptr< WPropertyBase > prop )
{
WPropertyIntWidget* propWidget;
propWidget = new WPropertyIntWidget( prop->toPropInt(), NULL, parentWidget() );
WPropertyDoubleWidget* propWidget;
propWidget = new WPropertyDoubleWidget( prop->toPropDouble(), NULL, parentWidget() );
propertyWidgetMap[prop] = propWidget;
m_layout->addWidget( propWidget );
m_layout->setStretchFactor( getGLWidget().get(), 1 );
......@@ -84,7 +84,7 @@ void WQtNavGLWidget::setSliderProperty( boost::shared_ptr< WPropertyBase > prop
void WQtNavGLWidget::removeSliderProperty( boost::shared_ptr< WPropertyBase > prop )
{
WPropertyIntWidget* propWidget = propertyWidgetMap[prop];
WPropertyDoubleWidget* propWidget = propertyWidgetMap[prop];
m_layout->removeWidget( propWidget );
delete propWidget;
propertyWidgetMap.erase( prop );
......
......@@ -33,7 +33,7 @@
#include "core/common/WPropertyVariable.h"
#include "core/graphicsEngine/WGEGroupNode.h"
#include "controlPanel/WPropertyIntWidget.h"
#include "controlPanel/WPropertyDoubleWidget.h"
#include "WQtGLDockWidget.h"
......@@ -105,7 +105,7 @@ private:
* Map holding the widgets for module properties added automatically. So they can be removed again automatically
* if the module is removed.
*/
std::map< boost::shared_ptr< WPropertyBase >, WPropertyIntWidget* > propertyWidgetMap;
std::map< boost::shared_ptr< WPropertyBase >, WPropertyDoubleWidget* > propertyWidgetMap;
};
#endif // WQTNAVGLWIDGET_H
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