Commit 7bca8f3c authored by schurade's avatar schurade

[ADD] faster fiber loading, display and selection

parent ccaa6d58
......@@ -29,3 +29,8 @@
WROI::~WROI()
{
}
boost::signals2::signal0< void >* WROI::getSignalIsModified()
{
return &m_signalIsModified;
}
......@@ -27,6 +27,9 @@
#include <string>
#include <boost/signals2/signal.hpp>
#include <boost/signals2/connection.hpp>
#include <osg/Geode>
#include "../common/WColor.h"
......@@ -43,13 +46,26 @@ public:
* Need virtual destructor because of virtual function.
*/
virtual ~WROI();
/**
* getter for the boost signal object that indicates a modified box
*
* \return signal object
*/
boost::signals2::signal0< void >* getSignalIsModified();
protected:
osg::ref_ptr< WPickHandler > m_pickHandler; //!< A pointer to the pick handler used to get gui events for moving the box.
osg::Geode* m_geode; //!< The graphical representation of the ROI.
bool m_isModified; //!< Indicates whether a changed ROI has already taken effect. Means: if true, still some updates needed.
/**
* boost signal object to indicate box manipulation
*/
boost::signals2::signal0< void >m_signalIsModified;
private:
bool m_isNot; //!< Indivated whether the region of interest is inside the WROI (false) oroutside (true).
bool m_isModified; //!< Indicates whether a changed ROI has already taken effect. Means: if true, still some updates needed.
WColor m_color; //!< The selected onject (Fibers, region on surface, ...) will have this color if m_useColor.
bool m_useColor; //!< Indicated whether m_color should be used for display.
......@@ -58,6 +74,7 @@ private:
* \param text text info from pick
*/
virtual void updateGFX( std::string text ) = 0;
};
#endif // WROI_H
......@@ -166,8 +166,14 @@ WROIBox::WROIBox( wmath::WPosition minPos, wmath::WPosition maxPos ) :
lightModel->setTwoSided( true );
state->setAttributeAndModes( lightModel.get(), osg::StateAttribute::ON );
state->setMode( GL_BLEND, osg::StateAttribute::ON );
<<<<<<< /SCR/schurade/workspace/walnut-hg/src/graphicsEngine/WROIBox.cpp
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->addChild( m_geode );
m_isModified = true;
=======
assert( WGraphicsEngine::getGraphicsEngine() );
WGraphicsEngine::getGraphicsEngine()->getScene()->addChild( m_geode );
>>>>>>> /tmp/WROIBox.cpp~other.0y8ftg
}
wmath::WPosition WROIBox::getMinPos() const
......@@ -180,6 +186,13 @@ wmath::WPosition WROIBox::getMaxPos() const
return m_maxPos;
}
bool WROIBox::isModified()
{
bool tmp = m_isModified;
m_isModified = false;
return tmp;
}
void WROIBox::updateGFX( std::string text )
{
......@@ -208,7 +221,10 @@ void WROIBox::updateGFX( std::string text )
((osg::Geometry*)(m_geode->getDrawable( 0 )))->setColorArray( colors );
}
m_pickedPosition = newPos;
m_isModified = true;
m_isPicked = true;
m_signalIsModified();
}
if( m_isPicked && text.find( "unpick" ) != std::string::npos )
{
......@@ -218,4 +234,5 @@ void WROIBox::updateGFX( std::string text )
m_isPicked = false;
}
slock.unlock();
}
......@@ -57,6 +57,11 @@ public:
*/
wmath::WPosition getMaxPos() const;
/**
* Getter for modified flag
*/
bool isModified();
protected:
private:
static size_t maxBoxId; //!< Current maximum boxId over all boxes.
......
......@@ -98,6 +98,8 @@ void WKernel::init()
{
// initialize
findAppPath();
m_roiManager = boost::shared_ptr< WROIManagerFibers >( new WROIManagerFibers() );
// get module factory
m_moduleFactory = WModuleFactory::getModuleFactory();
......@@ -241,6 +243,13 @@ std::string WKernel::getShaderPath()
findAppPath();
return WKernel::m_shaderPath;
}
<<<<<<< /SCR/schurade/workspace/walnut-hg/src/kernel/WKernel.cpp
boost::shared_ptr< WROIManagerFibers> WKernel::getRoiManager()
{
return m_roiManager;
}
=======
std::string WKernel::getFontPath()
{
......@@ -248,3 +257,4 @@ std::string WKernel::getFontPath()
return WKernel::m_fontPath;
}
>>>>>>> /tmp/WKernel.cpp~other.StDg3q
......@@ -40,6 +40,7 @@
#include "../common/WFlag.h"
#include "../graphicsEngine/WGraphicsEngine.h"
#include "../gui/WGUI.h"
#include "../modules/fiberDisplay2/WROIManagerFibers.h"
/**
* \defgroup kernel Kernel
......@@ -148,11 +149,19 @@ public:
*/
static std::string getShaderPath();
/**
* get for roi manager
*/
boost::shared_ptr< WROIManagerFibers>getRoiManager();
/**
* getter for font path
*/
static std::string getFontPath();
protected:
/**
......@@ -171,6 +180,11 @@ protected:
*/
boost::shared_ptr< WGraphicsEngine > m_graphicsEngine;
/**
* Pointer to a roi manager
*/
boost::shared_ptr< WROIManagerFibers >m_roiManager;
/**
* The module factory to use.
*/
......
......@@ -34,7 +34,7 @@
#include "../modules/eegView/WMEEGView.h"
#include "../modules/fiberClustering/WMFiberClustering.h"
#include "../modules/fiberCulling/WMFiberCulling.h"
#include "../modules/fiberDisplay/WMFiberDisplay.h"
#include "../modules/fiberDisplay2/WMFiberDisplay2.h"
#include "../modules/gaussFiltering/WMGaussFiltering.h"
#include "../modules/hud/WMHud.h"
#include "../modules/marchingCubes/WMMarchingCubes.h"
......@@ -71,7 +71,7 @@ void WModuleFactory::load()
// currently the prototypes are added by hand. This will be done automatically later.
m_prototypes.insert( boost::shared_ptr< WModule >( new WMData() ) );
m_prototypes.insert( boost::shared_ptr< WModule >( new WMNavSlices() ) );
m_prototypes.insert( boost::shared_ptr< WModule >( new WMFiberDisplay() ) );
m_prototypes.insert( boost::shared_ptr< WModule >( new WMFiberDisplay2() ) );
m_prototypes.insert( boost::shared_ptr< WModule >( new WMFiberCulling() ) );
m_prototypes.insert( boost::shared_ptr< WModule >( new WMFiberClustering() ) );
m_prototypes.insert( boost::shared_ptr< WModule >( new WMCoordinateSystem() ) );
......
......@@ -34,7 +34,7 @@
#include "../../dataHandler/io/WLoaderBiosig.h"
#endif
#include "../../dataHandler/io/WLoaderEEGASCII.h"
#include "../../dataHandler/io/WLoaderFibers.h"
#include "../../dataHandler/io/WLoaderFibers2.h"
#include "../../dataHandler/io/WLoaderNIfTI.h"
#include "WMData.h"
......@@ -169,7 +169,7 @@ void WMData::moduleMain()
}
else if( suffix == ".fib" )
{
WLoaderFibers fibLoader( fileName );
WLoaderFibers2 fibLoader( fileName );
m_dataSet = fibLoader.load();
}
else
......
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