Commit c2e8b349 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[CHANGE] - removed old colormapping. Removed NavSlices and ported Marching Cubes.

parent f5c767e8
......@@ -145,13 +145,3 @@ boost::shared_ptr< WSubject > WDataHandler::getDefaultSubject()
return getDataHandler()->getSubjectByID( WSubject::SUBJECT_UNKNOWN );
}
void WDataHandler::registerDataSet( boost::shared_ptr< WDataSet > dataset )
{
getDefaultSubject()->addDataSet( dataset );
}
void WDataHandler::deregisterDataSet( boost::shared_ptr< WDataSet > dataset )
{
getDefaultSubject()->removeDataSet( dataset );
}
......@@ -93,24 +93,6 @@ public:
*/
static boost::shared_ptr< WDataHandler > getDataHandler();
// TODO(all): the following two methods are only useful with our current single-subject stuff. You should consider redesigning
// it in conjunction with the multi subject stuff.
/**
* Register a dataset to the "UNKNOWN" subject. This is a convenience class which is useful as long as we do not have proper
* multi subject facilities.
*
* \param dataset the dataset to register.
*/
static void registerDataSet( boost::shared_ptr< WDataSet > dataset );
/**
* Deregister a dataset to the "UNKNOWN" subject. This is a convenience class which is useful as long as we do not have proper
* multi subject facilities.
*
* \param dataset the dataset to deregister.
*/
static void deregisterDataSet( boost::shared_ptr< WDataSet > dataset );
/**
* Insert a new subject referenced by a pointer.
*
......
......@@ -30,7 +30,6 @@
#include "exceptions/WDHException.h"
#include "WDataSet.h"
#include "WDataSetVector.h"
#include "WDataTexture3D.h"
#include "WDataTexture3D_2.h"
// prototype instance as singleton
......@@ -61,11 +60,6 @@ bool WDataSet::isTexture() const
return false;
}
boost::shared_ptr< WDataTexture3D > WDataSet::getTexture()
{
throw WDHException( std::string( "This dataset does not provide a texture." ) );
}
osg::ref_ptr< WDataTexture3D_2 > WDataSet::getTexture2() const
{
throw WDHException( std::string( "This dataset does not provide a texture." ) );
......@@ -91,18 +85,6 @@ boost::shared_ptr< WPrototyped > WDataSet::getPrototype()
return m_prototype;
}
boost::shared_ptr< WCondition > WDataSet::getChangeCondition()
{
// this just forwards to the texture condition. In the future maybe datasets may also change so we need an separate condition in every
// dataset.
if ( isTexture() )
{
return getTexture()->getChangeCondition();
}
return boost::shared_ptr< WCondition >();
}
boost::shared_ptr< WDataSetVector > WDataSet::isVectorDataSet()
{
return boost::shared_ptr< WDataSetVector >();
......
......@@ -38,7 +38,6 @@
#include "WDataTexture3D_2.h"
#include "WExportDataHandler.h"
class WDataTexture3D;
class WCondition;
class WDataSetVector;
......@@ -92,15 +91,6 @@ public:
*/
virtual boost::shared_ptr< WDataSetVector > isVectorDataSet();
/**
* Returns the texture- representation of the dataset. May throw an exception if no texture is available.
*
* \return The texture.
* \deprecated
*/
OW_API_DEPRECATED
virtual boost::shared_ptr< WDataTexture3D > getTexture();
/**
* Returns the texture- representation of the dataset. May throw an exception if no texture is available.
*
......@@ -130,14 +120,6 @@ public:
*/
static boost::shared_ptr< WPrototyped > getPrototype();
/**
* Gets the condition which is fired whenever the dataset gets some kind of dirty (threshold, opacity, ...)
*
* \return the condition, or NULL if the dataset has no texture.
* \deprecated this is deprecated. Use dataset properties instead.
*/
boost::shared_ptr< WCondition > getChangeCondition();
/**
* Return a pointer to the properties object of the dataset. Add all the modifiable settings here. This allows the user to modify several
* properties of a dataset.
......
......@@ -28,7 +28,6 @@
#include "../common/WAssert.h"
#include "../common/WException.h"
#include "../common/WPrototyped.h"
#include "WDataTexture3D.h"
#include "WDataTexture3D_2.h"
#include "WGrid.h"
#include "WGridRegular3D.h"
......@@ -51,7 +50,6 @@ WDataSetSingle::WDataSetSingle( boost::shared_ptr< WValueSetBase > newValueSet,
m_valueSet = newValueSet;
m_grid = newGrid;
m_texture3D = boost::shared_ptr< WDataTexture3D >( new WDataTexture3D( m_valueSet, m_grid ) );
m_infoProperties->addProperty( m_grid->getInformationProperties() );
......@@ -67,7 +65,6 @@ WDataSetSingle::WDataSetSingle()
: WDataSet(),
m_grid(),
m_valueSet(),
m_texture3D(),
m_texture()
{
// default constructor used by the prototype mechanism
......@@ -108,11 +105,6 @@ bool WDataSetSingle::isTexture() const
return m_texture;
}
boost::shared_ptr< WDataTexture3D > WDataSetSingle::getTexture()
{
return m_texture3D;
}
osg::ref_ptr< WDataTexture3D_2 > WDataSetSingle::getTexture2() const
{
return m_texture;
......
......@@ -38,7 +38,6 @@
#include "WExportDataHandler.h"
class WDataTexture3D;
class WDataTexture3D_2;
/**
......@@ -141,14 +140,6 @@ public:
*/
virtual bool isTexture() const;
/**
* Returns the texture- representation of the dataset. May throw an exception if no texture is available.
*
* \return The texture.
* \deprecated
*/
virtual boost::shared_ptr< WDataTexture3D > getTexture();
/**
* Returns the texture representation of the dataset. May throw an exception if no texture is available.
*
......@@ -195,10 +186,6 @@ protected:
boost::shared_ptr< WValueSetBase > m_valueSet;
private:
/**
* The 3D texture representing this dataset.
*/
boost::shared_ptr< WDataTexture3D > m_texture3D;
/**
* The 3D texture representing this dataset.
......
This diff is collapsed.
This diff is collapsed.
......@@ -30,7 +30,6 @@
#include "../common/WLogger.h"
#include "WDataSet.h"
#include "WDataTexture3D.h"
#include "exceptions/WDHNoSuchDataSet.h"
#include "WSubject.h"
......@@ -70,13 +69,6 @@ void WSubject::addDataSet( boost::shared_ptr< WDataSet > dataset )
{
// simply add the new dataset
m_datasets.push_back( dataset );
// also register condition
boost::shared_ptr< WCondition > c = dataset->getChangeCondition();
if ( c.get() )
{
m_changeCondition->add( c );
}
m_changeCondition->notify();
m_listChangeCondition->notify();
}
......@@ -89,13 +81,6 @@ void WSubject::removeDataSet( boost::shared_ptr< WDataSet > dataset )
DatasetIterator fIt = std::find( l->get().begin(), l->get().end(), dataset );
l->get().erase( fIt );
// also de-register condition
boost::shared_ptr< WCondition > c = dataset->getChangeCondition();
if ( c.get() )
{
m_changeCondition->remove( c );
}
// unlock if some callback notified below wants to access the list
l.reset();
......@@ -106,17 +91,6 @@ void WSubject::removeDataSet( boost::shared_ptr< WDataSet > dataset )
void WSubject::clear()
{
DatasetSharedContainerType::WriteTicket l = m_datasets.getWriteTicket();
// iterate and find, remove
for ( DatasetIterator iter = l->get().begin(); iter != l->get().end(); ++iter )
{
// also de-register condition
boost::shared_ptr< WCondition > c = ( *iter )->getChangeCondition();
if ( c.get() )
{
m_changeCondition->remove( c );
}
}
l->get().clear();
// unlock if some callback notified below wants to access the list
......@@ -135,26 +109,6 @@ WSubject::DatasetSharedContainerType::WriteTicket WSubject::getDatasetsForWritin
return m_datasets.getWriteTicket();
}
std::vector< boost::shared_ptr< WDataTexture3D > > WSubject::getDataTextures( bool onlyActive )
{
std::vector< boost::shared_ptr< WDataTexture3D > > tex;
// Read lock the list, the lock is freed upon destruction of the ticket (if it goes out of scope for example).
DatasetSharedContainerType::ReadTicket l = m_datasets.getReadTicket();
// iterate the list and find all textures
for ( DatasetConstIterator iter = l->get().begin(); iter != l->get().end(); ++iter )
{
// is it a texture?
if ( ( *iter )->isTexture() && ( !onlyActive || ( *iter )->getTexture()->isGloballyActive() ) )
{
tex.push_back( ( *iter )->getTexture() );
}
}
return tex;
}
boost::shared_ptr< WCondition > WSubject::getChangeCondition() const
{
return m_changeCondition;
......
......@@ -38,7 +38,6 @@
#include "WExportDataHandler.h"
class WDataSet;
class WDataTexture3D;
/**
* Container for all WDataSets belonging to one subject or patient.
......@@ -144,15 +143,6 @@ public:
*/
DatasetSharedContainerType::WriteTicket getDatasetsForWriting() const;
/**
* This gives a list of data textures from all supporting datasets in this subject.
*
* \param onlyActive true whenever only textures should be returned where isGloballyActive() == true.
* \return the list of textures.
* \deprecated
*/
std::vector< boost::shared_ptr< WDataTexture3D > > getDataTextures( bool onlyActive = false );
/**
* This condition fires whenever the list of datasets changes, or one dataset got marked as "dirty" (threshold, opacity, ...).
*
......
......@@ -35,7 +35,6 @@ SET(GUI_QT4_MOC_HDRS
controlPanel/WQtPropertyGroupWidget.h
controlPanel/WQtTreeWidget.h
controlPanel/WQtTreeItem.h
controlPanel/WQtTextureSorter.h
controlPanel/WQtColormapper.h
networkEditor/WQtNetworkEditor.h
networkEditor/WQtNetworkScene.h
......
......@@ -56,7 +56,6 @@
#include "../../graphicsEngine/WGEZoomTrackballManipulator.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../kernel/modules/data/WMData.h"
#include "../../kernel/modules/navSlices/WMNavSlices.h"
#include "../../kernel/WKernel.h"
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleCombiner.h"
......@@ -83,7 +82,8 @@
WMainWindow::WMainWindow() :
QMainWindow(),
m_currentCompatiblesToolbar( NULL ),
m_iconManager()
m_iconManager(),
m_navSlicesAlreadyLoaded( false )
{
}
......@@ -131,12 +131,8 @@ void WMainWindow::setupGUI()
addDockWidget( Qt::RightDockWidgetArea, m_networkEditor );
tabifyDockWidget( m_networkEditor, m_controlPanel->getModuleDock() );
// { TODO(all): deprecated. Replaced by WQtColormapper
addDockWidget( Qt::RightDockWidgetArea, m_controlPanel->getTextureSorterDock() );
// }
addDockWidget( Qt::RightDockWidgetArea, m_controlPanel->getColormapperDock() );
addDockWidget( Qt::RightDockWidgetArea, m_controlPanel->getRoiDock() );
tabifyDockWidget( m_controlPanel->getTextureSorterDock(), m_controlPanel->getColormapperDock() );
tabifyDockWidget( m_controlPanel->getColormapperDock(), m_controlPanel->getRoiDock() );
addDockWidget( Qt::RightDockWidgetArea, m_controlPanel );
......@@ -429,11 +425,10 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
{
// it is a dataset single
// load a nav slice module if a WDataSetSingle is available!?
// if it not already is running: add it
if( !WMNavSlices::isRunning() )
if ( !m_navSlicesAlreadyLoaded )
{
autoAdd( module, "Navigation Slices" );
m_navSlicesAlreadyLoaded = true;
}
}
else if( dataModule->getDataSet()->isA< WDataSetFibers >() )
......@@ -451,11 +446,11 @@ 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( "showAxial" );
boost::shared_ptr< WPropertyBase > prop = module->getProperties()->findProperty( "Show Axial" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"showAxial\", which is required by the GUI.", "GUI",
addLogMessage( "Navigation Slices module does not provide the property \"Show Axial\", which is required by the GUI.", "GUI",
LL_ERROR );
}
else
......@@ -468,11 +463,11 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
propertyActionMap[prop] = a;
}
prop = module->getProperties()->findProperty( "showCoronal" );
prop = module->getProperties()->findProperty( "Show Coronal" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"showCoronal\", which is required by the GUI.", "GUI",
addLogMessage( "Navigation Slices module does not provide the property \"Show Coronal\", which is required by the GUI.", "GUI",
LL_ERROR );
}
else
......@@ -485,11 +480,11 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
propertyActionMap[prop] = a;
}
prop = module->getProperties()->findProperty( "showSagittal" );
prop = module->getProperties()->findProperty( "Show Sagittal" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"showSagittal\", which is required by the GUI.", "GUI",
addLogMessage( "Navigation Slices module does not provide the property \"Show Sagittal\", which is required by the GUI.", "GUI",
LL_ERROR );
}
else
......@@ -503,48 +498,48 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
}
// now setup the nav widget sliders
prop = module->getProperties()->findProperty( "Axial Slice" );
prop = module->getProperties()->findProperty( "Axial Position" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"Axial Slice\", which is required by the GUI.", "GUI",
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 );
//m_navAxial->setSliderProperty( prop );
}
}
prop = module->getProperties()->findProperty( "Coronal Slice" );
prop = module->getProperties()->findProperty( "Coronal Position" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"Coronal Slice\", which is required by the GUI.", "GUI",
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 );
//m_navCoronal->setSliderProperty( prop );
}
}
prop = module->getProperties()->findProperty( "Sagittal Slice" );
prop = module->getProperties()->findProperty( "Sagittal Position" );
if( !prop )
{
WLogger::getLogger()->
addLogMessage( "Navigation Slices module does not provide the property \"Sagittal Slice\", which is required by the GUI.", "GUI",
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 );
//m_navSagittal->setSliderProperty( prop );
}
}
}
......
......@@ -324,6 +324,8 @@ private:
*/
void autoAdd( boost::shared_ptr< WModule > module, std::string proto );
bool m_navSlicesAlreadyLoaded; //!< if true, the navslices have been loaded already
/**
* Map holding the actions for module properties added automatically. So they can be removed again automatically
* if the module is removed.
......
......@@ -58,7 +58,6 @@
#include "../WQtCombinerActionList.h"
#include "WQtBranchTreeItem.h"
#include "WQtControlPanel.h"
#include "WQtTextureSorter.h"
#include "WQtColormapper.h"
WQtControlPanel::WQtControlPanel( WMainWindow* parent )
......@@ -119,10 +118,6 @@ WQtControlPanel::WQtControlPanel( WMainWindow* parent )
m_mainWindow->getNetworkEditor()->addAction( m_disconnectAction );
m_mainWindow->getNetworkEditor()->addAction( m_deleteModuleAction );
// { TODO(all): deprecated. Replaced by WQtColormapper
m_textureSorter = new WQtTextureSorter( m_mainWindow );
m_textureSorter->setToolTip( "Reorder the textures." );
// }
m_colormapper = new WQtColormapper( m_mainWindow );
m_colormapper->setToolTip( "Reorder the textures." );
......@@ -187,10 +182,6 @@ void WQtControlPanel::connectSlots()
connect( m_moduleTreeWidget, SIGNAL( itemClicked( QTreeWidgetItem*, int ) ), m_roiTreeWidget, SLOT( clearSelection() ) );
connect( m_roiTreeWidget, SIGNAL( itemClicked( QTreeWidgetItem*, int ) ), this, SLOT( selectRoiTreeItem() ) );
connect( m_roiTreeWidget, SIGNAL( itemClicked( QTreeWidgetItem*, int ) ), m_moduleTreeWidget, SLOT( clearSelection() ) );
// { TODO(all): deprecated. Replaced by WQtColormapper
connect( m_textureSorter, SIGNAL( textureSelectionChanged( boost::shared_ptr< WDataSet > ) ),
this, SLOT( selectDataModule( boost::shared_ptr< WDataSet > ) ) );
// }
connect( m_colormapper, SIGNAL( textureSelectionChanged( osg::ref_ptr< WGETexture3D > ) ),
this, SLOT( selectDataModule( osg::ref_ptr< WGETexture3D > ) ) );
connect( m_roiTreeWidget, SIGNAL( dragDrop() ), this, SLOT( handleDragDrop() ) );
......@@ -213,14 +204,6 @@ WQtSubjectTreeItem* WQtControlPanel::addSubject( std::string name )
bool WQtControlPanel::event( QEvent* event )
{
// { TODO(all): deprecated. Replaced by WQtColormapper
// a subject signals a newly registered data set
if ( event->type() == WQT_UPDATE_TEXTURE_SORTER_EVENT )
{
m_textureSorter->update();
}
// }
if ( event->type() == WQT_ROI_ASSOC_EVENT )
{
WRoiAssocEvent* e2 = dynamic_cast< WRoiAssocEvent* >( event ); // NOLINT
......@@ -674,9 +657,6 @@ void WQtControlPanel::selectTreeItem()
{
if( dataModule->getDataSet() )
{
// { TODO(all): deprecated. Replaced by WQtColormapper
m_textureSorter->selectTexture( dataModule->getDataSet() );
// }
m_colormapper->selectTexture( dataModule->getDataSet() );
}
}
......@@ -1142,11 +1122,6 @@ QDockWidget* WQtControlPanel::getModuleDock() const
return m_moduleDock;
}
QDockWidget* WQtControlPanel::getTextureSorterDock() const
{
return m_textureSorter;
}
QDockWidget* WQtControlPanel::getColormapperDock() const
{
return m_colormapper;
......
......@@ -46,7 +46,6 @@
#include "WQtRoiHeaderTreeItem.h"
#include "WQtSubjectTreeItem.h"
#include "WQtTreeWidget.h"
#include "WQtTextureSorter.h"
class WMainWindow;
class WQtColormapper;
......@@ -190,13 +189,6 @@ public:
*/
QDockWidget* getModuleDock() const;
/**
* Gets the texture sorter dock
*
* \return the dock
*/
QDockWidget* getTextureSorterDock() const;
/**
* Gets the colormapper dock
*
......@@ -259,8 +251,6 @@ private:
WQtTreeWidget* m_roiTreeWidget; //!< pointer to the tree widget
WQtTextureSorter* m_textureSorter; //!< pointer to the tree widget
WQtColormapper* m_colormapper; //!< the colormapper control widget
QTabWidget* m_tabWidget; //!< pointer to the tab widget
......
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#include <boost/bind.hpp>
#include <QtCore/QList>
#include <QtGui/QScrollArea>
#include <QtGui/QVBoxLayout>
#include <QtGui/QListWidgetItem>
#include "../../../common/WLimits.h"
#include "../../../dataHandler/WDataSet.h"
#include "../../../dataHandler/WSubject.h"
#include "../../../dataHandler/WDataHandler.h"
#include "../../../dataHandler/exceptions/WDHNoSuchSubject.h"
#include "../../../kernel/WModuleFactory.h"
#include "WQtTextureSorter.h"
WQtTextureSorter::WQtTextureSorter( QWidget* parent )
: QDockWidget( "Texture Sorter", parent )
{
setObjectName( "Texture Sorter Dock" );
m_textureListWidget = new QListWidget( this );
m_textureListWidget->setToolTip( "List of available textures. Only the upper <b>"
+ QString().setNum( wlimits::MAX_NUMBER_OF_TEXTURES )
+ "</b> textures will be applied." );
this->setAllowedAreas( Qt::AllDockWidgetAreas );
this->setFeatures( QDockWidget::DockWidgetClosable |QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
QWidget* panel = new QWidget( this );
m_layout = new QVBoxLayout();
QHBoxLayout* buttonLayout = new QHBoxLayout();
m_downButton = new QPushButton();
m_downButton->setText( QString( "down" ) );
m_upButton = new QPushButton();
m_upButton->setText( QString( "up" ) );
buttonLayout->addWidget( m_downButton );
buttonLayout->addWidget( m_upButton );
connect( m_upButton, SIGNAL( pressed() ), this, SLOT( moveItemUp() ) );
connect( m_downButton, SIGNAL( pressed() ), this, SLOT( moveItemDown() ) );
m_layout->addWidget( m_textureListWidget );
m_layout->addLayout( buttonLayout );
connect( m_textureListWidget, SIGNAL( itemClicked( QListWidgetItem* ) ), this, SLOT( handleTextureClicked() ) );
panel->setLayout( m_layout );
setWidget( panel );
}
WQtTextureSorter::~WQtTextureSorter()