Commit 228410c6 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - now the nav slices get added automatically whenever a dataset...

[CHANGE] - now the nav slices get added automatically whenever a dataset single got added, but avoids adding it multiple times
parent 375cefc6
......@@ -52,6 +52,7 @@
#include "../../common/WPreferences.h"
#include "../../kernel/WKernel.h"
#include "../../modules/data/WMData.h"
#include "../../modules/navSlices/WMNavSlices.h"
#include "../../dataHandler/WEEG.h"
#include "../../dataHandler/WDataSetSingle.h"
......@@ -219,10 +220,12 @@ void WMainWindow::moduleSpecificSetup( boost::shared_ptr< WModule > module )
{
// it is a dataset single
// load a nav slice module if a WDataSetSingle is available!?
WLogger::getLogger()->addLogMessage( "Data module added. Implement this method to have Navigation slices added automatically.",
"GUI", LL_INFO );
//autoAdd( module, "Direct Volume endering" );
// if it already is running: add it
if ( !WMNavSlices::isRunning() )
{
autoAdd( module, "Navigation Slice Module" );
}
}
else if ( dataModule->getDataSet()->isA< WDataSetFibers >() )
{
......
......@@ -50,6 +50,8 @@
#include "WMNavSlices.h"
#include "navslices.xpm"
bool WMNavSlices::m_navsliceRunning = false;
WMNavSlices::WMNavSlices():
WModule(),
m_textureChanged( true )
......@@ -70,9 +72,15 @@ WMNavSlices::~WMNavSlices()
boost::shared_ptr< WModule > WMNavSlices::factory() const
{
m_navsliceRunning = true;
return boost::shared_ptr< WModule >( new WMNavSlices() );
}
bool WMNavSlices::isRunning()
{
return m_navsliceRunning;
}
const char** WMNavSlices::getXPMIcon() const
{
return navslices_xpm;
......
......@@ -95,6 +95,12 @@ public:
*/
virtual const char** getXPMIcon() const;
/**
* Checks whether the nav slices are already running.
*
* \return true if running.
*/
static bool isRunning();
protected:
......@@ -253,6 +259,11 @@ private:
*/
std::vector< osg::ref_ptr<osg::Uniform> > m_samplerUniforms;
/**
* To avoid multiple instances of the nav slices.
*/
static bool m_navsliceRunning;
/**
* Node callback to handle updates properly
*/
......
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