Commit 947a448f authored by Mathias Goldau's avatar Mathias Goldau

[STYLE #164] Now all module implementations subclassed from WModule starts...

[STYLE #164] Now all module implementations subclassed from WModule starts with WM and no "Module" phrase should be containted anymore
parent 180b6711
......@@ -22,7 +22,7 @@ IF( CXXTEST_FOUND )
"WModuleOutputData.hpp"
"WModuleInputData.cpp"
"WModuleOutputData.cpp"
"../modules/navigationSlices/WNavigationSliceModule.cpp"
"../modules/eegTest/WEEGTestModule.cpp"
"../modules/navigationSlices/WMNavSlice.cpp"
"../modules/eegTest/WMEEGTest.cpp"
)
ENDIF( CXXTEST_FOUND )
......@@ -34,11 +34,11 @@
#include <boost/thread/xtime.hpp>
#include "WModule.h"
#include "../modules/data/WDataModule.hpp"
#include "../modules/navigationSlices/WNavigationSliceModule.h"
#include "../modules/fiberDisplay/WFiberDisplay.h"
#include "../modules/fiberCulling/WFiberCulling.h"
#include "../modules/fiberClustering/WFiberClustering.h"
#include "../modules/data/WMData.hpp"
#include "../modules/navigationSlices/WMNavSlice.h"
#include "../modules/fiberDisplay/WMFiberDisplay.h"
#include "../modules/fiberCulling/WMFiberCulling.h"
#include "../modules/fiberClustering/WMFiberClustering.h"
#include "../common/WException.h"
#include "../graphicsEngine/WGraphicsEngine.h"
......@@ -187,10 +187,10 @@ void WKernel::loadModules()
m_modules.clear();
using boost::shared_ptr;
shared_ptr< WModule > m = shared_ptr< WModule >( new WNavigationSliceModule() );
// shared_ptr< WModule > m = shared_ptr< WModule >( new WFiberDisplay() );
// shared_ptr< WModule > m = shared_ptr< WModule >( new WFiberCulling() );
// shared_ptr< WModule > m = shared_ptr< WModule >( new WFiberClustering() );
shared_ptr< WModule > m = shared_ptr< WModule >( new WMNavSlice() );
// shared_ptr< WModule > m = shared_ptr< WModule >( new WMFiberDisplay() );
// shared_ptr< WModule > m = shared_ptr< WModule >( new WMFiberCulling() );
// shared_ptr< WModule > m = shared_ptr< WModule >( new WMFiberClustering() );
WLogger::getLogger()->addLogMessage( "Loading module: " + m->getName(), "Kernel", LL_DEBUG );
m_modules.push_back( m );
......@@ -299,7 +299,7 @@ void WKernel::doLoadDataSets( std::vector< std::string > fileNames )
void WKernel::slotFinishLoadData( boost::shared_ptr< WDataSet > dataSet )
{
boost::shared_ptr< WModule > module = boost::shared_ptr< WModule >( new WDataModule< int >( dataSet ) );
boost::shared_ptr< WModule > module = boost::shared_ptr< WModule >( new WMData< int >( dataSet ) );
module->getProperties()->addBool( "active", true );
module->getProperties()->hideProperty( "active" );
......
......@@ -22,8 +22,8 @@
//
//---------------------------------------------------------------------------
#ifndef WDATAMODULE_H
#define WDATAMODULE_H
#ifndef WMDATA_H
#define WMDATA_H
#include <string>
......@@ -42,7 +42,7 @@
* inherited classes. This class builds a "source".
*/
template < typename T >
class WDataModule: public WModule
class WMData: public WModule
{
public:
......@@ -50,19 +50,19 @@ public:
* \par Description
* Default constructor.
*/
// WDataModule();
// WMData();
/**
* \par Description
* constructor with dataset
*/
explicit WDataModule( boost::shared_ptr< WDataSet > dataSet );
explicit WMData( boost::shared_ptr< WDataSet > dataSet );
/**
* \par Description
* Destructor.
*/
virtual ~WDataModule();
virtual ~WMData();
/**
* \par Description
......@@ -94,7 +94,6 @@ public:
virtual osg::ref_ptr<osg::Texture3D> getTexture3D();
protected:
/**
* \par Description
* Entry point after loading the module. Runs in separate thread.
......@@ -113,7 +112,7 @@ protected:
* \param output the output connector that sent the signal. Not part of this module instance.
*/
virtual void notifyDataChange( boost::shared_ptr<WModuleConnector> input,
boost::shared_ptr<WModuleConnector> output );
boost::shared_ptr<WModuleConnector> output );
/**
* Creates a 3d texture from a dataset. This function will be overloaded for the
......@@ -131,9 +130,7 @@ protected:
osg::ref_ptr<osg::Texture3D> createTexture3D( int16_t* source, boost::shared_ptr<WGridRegular3D> grid, int components = 1 );
osg::ref_ptr<osg::Texture3D> createTexture3D( float* source, boost::shared_ptr<WGridRegular3D> grid, int components = 1 );
private:
/**
* The only output of this data module.
*/
......@@ -152,7 +149,7 @@ private:
// TODO(schurade, ebaum): do we still need/want that constructor?
// template < typename T >
// WDataModule<T>::WDataModule():
// WMData<T>::WMData():
// WModule()
// {
// // WARNING: initializing connectors inside the constructor will lead to an exception.
......@@ -163,7 +160,7 @@ private:
// }
template < typename T >
WDataModule<T>::WDataModule( boost::shared_ptr< WDataSet > dataSet ):
WMData<T>::WMData( boost::shared_ptr< WDataSet > dataSet ):
WModule()
{
// WARNING: initializing connectors inside the constructor will lead to an exception.
......@@ -175,32 +172,32 @@ WDataModule<T>::WDataModule( boost::shared_ptr< WDataSet > dataSet ):
m_properties->addString( "name", "not initialized" );
}
template < typename T >
WDataModule<T>::~WDataModule()
template < typename T >
WMData<T>::~WMData()
{
// cleanup
}
template < typename T >
const std::string WDataModule<T>::getName() const
const std::string WMData<T>::getName() const
{
return "Data Module";
}
template < typename T >
const std::string WDataModule<T>::getDescription() const
const std::string WMData<T>::getDescription() const
{
return "This module can encapsulate data.";
}
template < typename T >
void WDataModule<T>::connectors()
template < typename T >
void WMData<T>::connectors()
{
// initialize connectors
m_output= boost::shared_ptr<WModuleOutputData<T> >(
new WModuleOutputData<T>( shared_from_this(),
"out1", "A loaded dataset." )
);
);
// add it to the list of connectors. Please note, that a connector NOT added via addConnector will not work as expected.
addConnector( m_output );
......@@ -209,15 +206,15 @@ void WDataModule<T>::connectors()
WModule::connectors();
}
template < typename T >
void WDataModule<T>::notifyDataChange( boost::shared_ptr<WModuleConnector> input,
boost::shared_ptr<WModuleConnector> output )
template < typename T >
void WMData<T>::notifyDataChange( boost::shared_ptr<WModuleConnector> input,
boost::shared_ptr<WModuleConnector> output )
{
WModule::notifyDataChange( input, output );
}
template < typename T >
void WDataModule<T>::threadMain()
template < typename T >
void WMData<T>::threadMain()
{
// Since the modules run in a separate thread: such loops are possible
while ( !m_FinishRequested )
......@@ -229,20 +226,20 @@ void WDataModule<T>::threadMain()
// clean up stuff
}
template < typename T >
void WDataModule<T>::setDataSet( boost::shared_ptr< WDataSet > dataSet )
template < typename T >
void WMData<T>::setDataSet( boost::shared_ptr< WDataSet > dataSet )
{
m_dataSet = dataSet;
}
template < typename T >
boost::shared_ptr< WDataSet > WDataModule<T>::getDataSet()
template < typename T >
boost::shared_ptr< WDataSet > WMData<T>::getDataSet()
{
return m_dataSet;
}
template < typename T >
osg::ref_ptr<osg::Texture3D> WDataModule<T>::getTexture3D()
template < typename T >
osg::ref_ptr<osg::Texture3D> WMData<T>::getTexture3D()
{
if ( !m_texture3D )
{
......@@ -273,8 +270,8 @@ osg::ref_ptr<osg::Texture3D> WDataModule<T>::getTexture3D()
return m_texture3D;
}
template < typename T >
osg::ref_ptr<osg::Texture3D> WDataModule<T>::createTexture3D( unsigned char* source, boost::shared_ptr<WGridRegular3D> grid, int components )
template < typename T >
osg::ref_ptr<osg::Texture3D> WMData<T>::createTexture3D( unsigned char* source, boost::shared_ptr<WGridRegular3D> grid, int components )
{
if ( components == 1 )
{
......@@ -320,8 +317,8 @@ osg::ref_ptr<osg::Texture3D> WDataModule<T>::createTexture3D( unsigned char* sou
return 0;
}
template < typename T >
osg::ref_ptr<osg::Texture3D> WDataModule<T>::createTexture3D( int16_t* source, boost::shared_ptr<WGridRegular3D> grid, int components )
template < typename T >
osg::ref_ptr<osg::Texture3D> WMData<T>::createTexture3D( int16_t* source, boost::shared_ptr<WGridRegular3D> grid, int components )
{
if ( components == 1)
{
......@@ -348,8 +345,8 @@ osg::ref_ptr<osg::Texture3D> WDataModule<T>::createTexture3D( int16_t* source, b
return 0;
}
template < typename T >
osg::ref_ptr<osg::Texture3D> WDataModule<T>::createTexture3D( float* source, boost::shared_ptr<WGridRegular3D> grid, int components )
template < typename T >
osg::ref_ptr<osg::Texture3D> WMData<T>::createTexture3D( float* source, boost::shared_ptr<WGridRegular3D> grid, int components )
{
if ( components == 1)
{
......@@ -376,7 +373,5 @@ osg::ref_ptr<osg::Texture3D> WDataModule<T>::createTexture3D( float* source, boo
return 0;
}
#endif // WDATAMODULE_H
#endif // WMDATA_H
......@@ -32,36 +32,36 @@
#include <osgText/Font>
#include <osgText/Text>
#include "WEEGTestModule.h"
#include "WMEEGTest.h"
#include "../../kernel/WKernel.h"
#include "../../dataHandler/WLoaderManager.h"
#include "../../dataHandler/WEEG.h"
#include "../../dataHandler/WDataHandler.h"
#include "../../dataHandler/WSubject.h"
WEEGTestModule::WEEGTestModule():
WMEEGTest::WMEEGTest():
WModule()
{
// initialize members
}
WEEGTestModule::~WEEGTestModule()
WMEEGTest::~WMEEGTest()
{
// cleanup
}
WEEGTestModule::WEEGTestModule( const WEEGTestModule& other )
WMEEGTest::WMEEGTest( const WMEEGTest& other )
: WModule()
{
*this = other;
}
const std::string WEEGTestModule::getName() const
const std::string WMEEGTest::getName() const
{
return "Eeg Module";
}
const std::string WEEGTestModule::getDescription() const
const std::string WMEEGTest::getDescription() const
{
return "This module is for testing and development";
}
......@@ -106,7 +106,7 @@ void drawChannel( boost::shared_ptr< const WEEG > eegData, size_t channelId, osg
sceneDataGeode->addDrawable( textOne );
}
void WEEGTestModule::threadMain()
void WMEEGTest::threadMain()
{
// load the sample scene.
osg::Geode* sceneDataGeode = new osg::Geode();
......
......@@ -22,8 +22,8 @@
//
//---------------------------------------------------------------------------
#ifndef WEEGTESTMODULE_H
#define WEEGTESTMODULE_H
#ifndef WMEEGTEST_H
#define WMEEGTEST_H
#include <string>
......@@ -33,25 +33,25 @@
* Simple module for testing Eeg loading stuff.
* \ingroup kernel
*/
class WEEGTestModule: public WModule
class WMEEGTest: public WModule
{
public:
/**
* Default constructor.
*/
WEEGTestModule();
WMEEGTest();
/**
* Destructor.
*/
virtual ~WEEGTestModule();
virtual ~WMEEGTest();
/**
* Copy constructor
* \param other Reference on object to copy.
*/
WEEGTestModule( const WEEGTestModule& other );
WMEEGTest( const WMEEGTest& other );
/**
* Gives back the name of this module.
......@@ -75,5 +75,5 @@ protected:
private:
};
#endif // WEEGTESTMODULE_H
#endif // WMEEGTEST_H
......@@ -31,7 +31,7 @@
#include <osg/Geode>
#include <osg/Geometry>
#include "WFiberClustering.h"
#include "WMFiberClustering.h"
#include "../../math/WFiber.h"
#include "../../common/WColor.h"
#include "../../common/WLogger.h"
......@@ -43,7 +43,7 @@
#include "../../kernel/WKernel.h"
#include "../../utils/WColorUtils.h"
WFiberClustering::WFiberClustering()
WMFiberClustering::WMFiberClustering()
: WModule(),
m_maxDistance_t( 0.0 ),
m_dLtTableExists( false ),
......@@ -54,21 +54,21 @@ WFiberClustering::WFiberClustering()
{
}
WFiberClustering::~WFiberClustering()
WMFiberClustering::~WMFiberClustering()
{
}
const std::string WFiberClustering::getName() const
const std::string WMFiberClustering::getName() const
{
return std::string( "FiberClustering" );
}
const std::string WFiberClustering::getDescription() const
const std::string WMFiberClustering::getDescription() const
{
return std::string( "Clusters fibers from a WDataSetFibers" );
}
void WFiberClustering::threadMain()
void WMFiberClustering::threadMain()
{
boost::shared_ptr< WDataHandler > dataHandler;
// TODO(math): fix this hack when possible by using an input connector.
......@@ -99,7 +99,7 @@ void WFiberClustering::threadMain()
}
}
void WFiberClustering::checkDLtLookUpTable()
void WMFiberClustering::checkDLtLookUpTable()
{
if( m_dLtTableExists )
{
......@@ -112,7 +112,7 @@ void WFiberClustering::checkDLtLookUpTable()
}
}
void WFiberClustering::cluster()
void WMFiberClustering::cluster()
{
std::cout << "Start clustering with " << m_fibs->size() << " fibers." << std::endl;
m_clusters.clear(); // remove evtl. old clustering
......@@ -191,6 +191,6 @@ void WFiberClustering::cluster()
m_lastFibsSize = m_fibs->size();
}
void WFiberClustering::paint()
void WMFiberClustering::paint()
{
}
......@@ -22,8 +22,8 @@
//
//---------------------------------------------------------------------------
#ifndef WFIBERCLUSTERING_H
#define WFIBERCLUSTERING_H
#ifndef WMFIBERCLUSTERING_H
#define WMFIBERCLUSTERING_H
#include <string>
#include <vector>
......@@ -41,19 +41,19 @@
/**
* Test module for Clustering fibers
*/
class WFiberClustering : public WModule
class WMFiberClustering : public WModule
{
friend class WFiberClusteringTest;
friend class WMFiberClusteringTest;
public:
/**
* Constructs new FiberTestModule
*/
WFiberClustering();
WMFiberClustering();
/**
* Destructs this FiberTestModule
*/
virtual ~WFiberClustering();
virtual ~WMFiberClustering();
/**
* Gives back the name of this module.
......@@ -139,4 +139,4 @@ private:
size_t m_lastFibsSize;
};
#endif // WFIBERCLUSTERING_H
#endif // WMFIBERCLUSTERING_H
......@@ -22,17 +22,17 @@
//
//---------------------------------------------------------------------------
#ifndef WFIBERCLUSTERING_TEST_H
#define WFIBERCLUSTERING_TEST_H
#ifndef WMFIBERCLUSTERING_TEST_H
#define WMFIBERCLUSTERING_TEST_H
#include <cxxtest/TestSuite.h>
#include "../WFiberClustering.h"
#include "../WMFiberClustering.h"
/**
* TODO(math): Document this!
*/
class WFiberClusteringTest : public CxxTest::TestSuite
class WMFiberClusteringTest : public CxxTest::TestSuite
{
public:
/**
......@@ -43,4 +43,4 @@ public:
}
};
#endif // WFIBERCLUSTERING_TEST_H
#endif // WMFIBERCLUSTERING_TEST_H
......@@ -30,7 +30,7 @@
#include <osg/Geode>
#include <osg/Geometry>
#include "WFiberCulling.h"
#include "WMFiberCulling.h"
#include "../../math/WFiber.h"
#include "../../common/WColor.h"
#include "../../common/WLogger.h"
......@@ -42,7 +42,7 @@
#include "../../kernel/WKernel.h"
#include "../../utils/WColorUtils.h"
WFiberCulling::WFiberCulling()
WMFiberCulling::WMFiberCulling()
: WModule(),
m_proximity_t( 0.0 ),
m_dSt_culling_t( 0.0 ),
......@@ -50,21 +50,21 @@ WFiberCulling::WFiberCulling()
{
}
WFiberCulling::~WFiberCulling()
WMFiberCulling::~WMFiberCulling()
{
}
const std::string WFiberCulling::getName() const
const std::string WMFiberCulling::getName() const
{
return std::string( "FiberCulling" );
}
const std::string WFiberCulling::getDescription() const
const std::string WMFiberCulling::getDescription() const
{
return std::string( "Removes or culls out fibers from a WDataSetFibers" );
}
void WFiberCulling::threadMain()
void WMFiberCulling::threadMain()
{
boost::shared_ptr< WDataHandler > dataHandler;
// TODO(math): fix this hack when possible by using an input connector.
......@@ -107,7 +107,7 @@ void WFiberCulling::threadMain()
}
}
void WFiberCulling::cullOutFibers( boost::shared_ptr< WDataSetFibers > fibers )
void WMFiberCulling::cullOutFibers( boost::shared_ptr< WDataSetFibers > fibers )
{
size_t numFibers = fibers->size();
std::cout << "Recoginzed " << numFibers << " fibers" << std::endl;
......
......@@ -22,8 +22,8 @@
//
//---------------------------------------------------------------------------
#ifndef WFIBERCULLING_H
#define WFIBERCULLING_H
#ifndef WMFIBERCULLING_H
#define WMFIBERCULLING_H
#include <string>
......@@ -38,19 +38,19 @@
/**
* Test module for culling fibers
*/
class WFiberCulling : public WModule
class WMFiberCulling : public WModule
{
friend class WFiberCullingTest;
friend class WMFiberCullingTest;
public:
/**
* Constructs new FiberTestModule
*/
WFiberCulling();
WMFiberCulling();
/**
* Destructs this FiberTestModule
*/
virtual ~WFiberCulling();
virtual ~WMFiberCulling();
/**
* Gives back the name of this module.
......@@ -87,4 +87,4 @@ protected:
private:
};
#endif // WFIBERCULLING_H
#endif // WMFIBERCULLING_H
......@@ -22,17 +22,17 @@
//
//---------------------------------------------------------------------------
#ifndef WFIBERCULLING_TEST_H
#define WFIBERCULLING_TEST_H
#ifndef WMFIBERCULLING_TEST_H
#define WMFIBERCULLING_TEST_H
#include <cxxtest/TestSuite.h>
#include "../WFiberCulling.h"
#include "../WMFiberCulling.h"
/**
* TODO(math): Document this!
*/
class WFiberCullingTest : public CxxTest::TestSuite
class WMFiberCullingTest : public CxxTest::TestSuite
{
public:
/**
......@@ -43,4 +43,4 @@ public:
}
};
#endif // WFIBERCULLING_TEST_H
#endif // WMFIBERCULLING_TEST_H
......@@ -27,7 +27,7 @@
#include <osg/Geode>
#include <osg/Geometry>
#include "WFiberDisplay.h"
#include "WMFiberDisplay.h"
#include "../../math/WFiber.h"
#include "../../common/WLogger.h"
#include "../../common/WColor.h"
......@@ -38,26 +38,26 @@
#include "../../kernel/WKernel.h"
#include "../../utils/WColorUtils.h"
WFiberDisplay::WFiberDisplay()
WMFiberDisplay::WMFiberDisplay()
: WModule()
{
}
WFiberDisplay::~WFiberDisplay()
WMFiberDisplay::~WMFiberDisplay()
{
}
const std::string WFiberDisplay::getName() const
const std::string WMFiberDisplay::getName() const
{
return std::string( "FiberTestModule" );
}
const std::string WFiberDisplay::getDescription() const
const std::string WMFiberDisplay::getDescription() const
{
return std