Commit c48c67f5 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - moved some modules to the kernel as they can't be build separately yet.

parent 37142ba4
......@@ -126,16 +126,20 @@ void WMData::properties()
// use this callback for the other properties
WPropertyBase::PropertyChangeNotifierType propertyCallback = boost::bind( &WMData::propertyChanged, this, _1 );
m_groupTex = m_properties->addPropertyGroup( "Texture Properties", "Properties only related to the texture representation." );
m_groupTexManip = m_properties->addPropertyGroup( "Texture Manipulation", "Properties only related to the texture manipulation." );
// several other properties
m_interpolation = m_properties->addProperty( "Interpolation",
m_interpolation = m_groupTex->addProperty( "Interpolation",
"If active, the boundaries of single voxels"
" will not be visible in colormaps. The transition between"
" them will be smooth by using interpolation then.",
true,
propertyCallback );
m_threshold = m_properties->addProperty( "Threshold", "Values below this threshold will not be "
m_threshold = m_groupTex->addProperty( "Threshold", "Values below this threshold will not be "
"shown in colormaps.", 0., propertyCallback );
m_opacity = m_properties->addProperty( "Opacity %", "The opacity of this data in colormaps combining"
m_opacity = m_groupTex->addProperty( "Opacity %", "The opacity of this data in colormaps combining"
" values from several data sets.", 100, propertyCallback );
m_opacity->setMax( 100 );
m_opacity->setMin( 0 );
......@@ -148,8 +152,38 @@ void WMData::properties()
m_colorMapSelectionsList->addItem( "Atlas", "" );
m_colorMapSelectionsList->addItem( "Blue-Green-Purple", "" );
m_colorMapSelection = m_properties->addProperty( "Colormap", "Colormap type.", m_colorMapSelectionsList->getSelectorFirst(), propertyCallback );
m_colorMapSelection = m_groupTex->addProperty( "Colormap", "Colormap type.", m_colorMapSelectionsList->getSelectorFirst(), propertyCallback );
WPropertyHelper::PC_SELECTONLYONE::addTo( m_colorMapSelection );
m_translationX = m_groupTexManip->addProperty( "X translation", "", 0, propertyCallback );
m_translationX->setMax( 300 );
m_translationX->setMin( -300 );
m_translationY = m_groupTexManip->addProperty( "Y translation", "", 0, propertyCallback );
m_translationY->setMax( 300 );
m_translationY->setMin( -300 );
m_translationZ = m_groupTexManip->addProperty( "Z translation", "", 0, propertyCallback );
m_translationZ->setMax( 300 );
m_translationZ->setMin( -300 );
m_stretchX = m_groupTexManip->addProperty( "voxel size X", "", 1.0, propertyCallback );
m_stretchX->setMax( 10. );
m_stretchX->setMin( 0.1 );
m_stretchY = m_groupTexManip->addProperty( "voxel size Y", "", 1.0, propertyCallback );
m_stretchY->setMax( 10. );
m_stretchY->setMin( 0.1 );
m_stretchZ = m_groupTexManip->addProperty( "voxel size Z", "", 1.0, propertyCallback );
m_stretchZ->setMax( 10. );
m_stretchZ->setMin( 0.1 );
m_rotationX = m_groupTexManip->addProperty( "X rotation", "", 0, propertyCallback );
m_rotationX->setMax( 180 );
m_rotationX->setMin( -180 );
m_rotationY = m_groupTexManip->addProperty( "Y rotation", "", 0, propertyCallback );
m_rotationY->setMax( 180 );
m_rotationY->setMin( -180 );
m_rotationZ = m_groupTexManip->addProperty( "Z rotation", "", 0, propertyCallback );
m_rotationZ->setMax( 180 );
m_rotationZ->setMin( -180 );
}
void WMData::propertyChanged( boost::shared_ptr< WPropertyBase > property )
......@@ -176,6 +210,32 @@ void WMData::propertyChanged( boost::shared_ptr< WPropertyBase > property )
{
m_dataSet->getTexture()->setSelectedColormap( m_colorMapSelection->get( true ).getItemIndexOfSelected( 0 ) );
}
else if ( property == m_translationX || property == m_translationY || property == m_translationZ )
{
boost::shared_ptr< WGridRegular3D > grid = m_dataSet->getTexture()->getGrid();
wmath::WPosition pos( m_translationX->get(), m_translationY->get(), m_translationZ->get() );
grid->translate( pos );
WDataHandler::getDefaultSubject()->getChangeCondition()->notify();
}
else if ( property == m_stretchX || property == m_stretchY || property == m_stretchZ )
{
boost::shared_ptr< WGridRegular3D > grid = m_dataSet->getTexture()->getGrid();
wmath::WPosition str( m_stretchX->get(), m_stretchY->get(), m_stretchZ->get() );
grid->stretch( str );
WDataHandler::getDefaultSubject()->getChangeCondition()->notify();
}
else if ( property == m_rotationX || property == m_rotationY || property == m_rotationZ )
{
float pi = 3.14159265;
float rotx = static_cast<float>( m_rotationX->get() ) / 180. * pi;
float roty = static_cast<float>( m_rotationY->get() ) / 180. * pi;
float rotz = static_cast<float>( m_rotationZ->get() ) / 180. * pi;
boost::shared_ptr< WGridRegular3D > grid = m_dataSet->getTexture()->getGrid();
wmath::WPosition rot( rotx, roty, rotz );
grid->rotate( rot );
WDataHandler::getDefaultSubject()->getChangeCondition()->notify();
}
}
else
{
......@@ -236,11 +296,8 @@ void WMData::moduleMain()
|| suffix == ".edf" )
{
// hide other properties since they make no sense fo these data set types.
m_interpolation->setHidden();
m_threshold->setHidden();
m_opacity->setHidden();
m_active->setHidden();
m_colorMapSelection->setHidden();
m_groupTex->setHidden();
m_groupTexManip->setHidden();
}
if( suffix == ".nii"
......
......@@ -171,6 +171,16 @@ protected:
*/
WPropString m_dataName;
/**
* grouping the texture display properties
*/
WPropGroup m_groupTex;
/**
* grouping the texture manipulation properties
*/
WPropGroup m_groupTexManip;
/**
* Interpolation?
*/
......@@ -196,6 +206,51 @@ protected:
*/
WPropInt m_opacity;
/**
* translation of the texture
*/
WPropInt m_translationX;
/**
* translation of the texture
*/
WPropInt m_translationY;
/**
* translation of the texture
*/
WPropInt m_translationZ;
/**
* voxel size in x direction
*/
WPropDouble m_stretchX;
/**
* voxel size in y direction
*/
WPropDouble m_stretchY;
/**
* voxel size in z direction
*/
WPropDouble m_stretchZ;
/**
* rotation around the x axis
*/
WPropInt m_rotationX;
/**
* rotation around the y axis
*/
WPropInt m_rotationY;
/**
* rotation around the z axis
*/
WPropInt m_rotationZ;
bool m_isTexture; //!< Indicates whether the loaded dataSet will be available as texture.
/**
......
......@@ -25,8 +25,8 @@
#include <algorithm>
#include <vector>
#include "../../common/WAssert.h"
#include "../../common/WLogger.h"
#include "../../../common/WAssert.h"
#include "../../../common/WLogger.h"
#include "WKdTree.h"
......
......@@ -28,7 +28,7 @@
#include <algorithm>
#include <vector>
#include "../../common/WThreadedRunner.h"
#include "../../../common/WThreadedRunner.h"
/**
* implements the compare function for std::nth_element on a point array
......
......@@ -31,13 +31,13 @@
#include <osg/Geode>
#include <osg/Geometry>
#include "../../common/WColor.h"
#include "../../common/WLogger.h"
#include "../../dataHandler/WDataHandler.h"
#include "../../dataHandler/WDataTexture3D.h"
#include "../../dataHandler/WSubject.h"
#include "../../graphicsEngine/WGEUtils.h"
#include "../../kernel/WKernel.h"
#include "../../../common/WColor.h"
#include "../../../common/WLogger.h"
#include "../../../dataHandler/WDataHandler.h"
#include "../../../dataHandler/WDataTexture3D.h"
#include "../../../dataHandler/WSubject.h"
#include "../../../graphicsEngine/WGEUtils.h"
#include "../../../kernel/WKernel.h"
#include "fiberdisplay.xpm"
#include "WMFiberDisplay.h"
......
......@@ -29,11 +29,11 @@
#include <osg/Geode>
#include "../../dataHandler/datastructures/WFiberCluster.h"
#include "../../dataHandler/WDataSetFibers.h"
#include "../../graphicsEngine/WShader.h"
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleInputData.h"
#include "../../../dataHandler/datastructures/WFiberCluster.h"
#include "../../../dataHandler/WDataSetFibers.h"
#include "../../../graphicsEngine/WShader.h"
#include "../../WModule.h"
#include "../../WModuleInputData.h"
#include "WTubeDrawable.h"
/**
......
......@@ -31,7 +31,7 @@
#include <boost/enable_shared_from_this.hpp>
#include "./../../common/WProperties.h"
#include "./../../../common/WProperties.h"
#include "WRMROIRepresentation.h"
class WROIManagerFibers;
......
......@@ -26,11 +26,11 @@
#include <string>
#include <vector>
#include "../../dataHandler/WDataSetScalar.h"
#include "../../../dataHandler/WDataSetScalar.h"
#include "../../graphicsEngine/WGraphicsEngine.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../graphicsEngine/WROIArbitrary.h"
#include "../../../graphicsEngine/WGraphicsEngine.h"
#include "../../../graphicsEngine/WROIBox.h"
#include "../../../graphicsEngine/WROIArbitrary.h"
#include "WRMBranch.h"
#include "WROIManagerFibers.h"
......
......@@ -34,8 +34,8 @@
#include <boost/thread/thread.hpp>
#include "WKdTree.h"
#include "./../../common/WProperties.h"
#include "../../graphicsEngine/WROI.h"
#include "../../../common/WProperties.h"
#include "../../../graphicsEngine/WROI.h"
class WRMBranch;
/**
* class encapsulates rois for the roi manager class
......
......@@ -25,10 +25,10 @@
#include <list>
#include <vector>
#include "../../common/WAssert.h"
#include "../../../common/WAssert.h"
#include "WUpdateThread.h"
#include "WROIManagerFibers.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../../graphicsEngine/WROIBox.h"
WROIManagerFibers::WROIManagerFibers()
{
......
......@@ -24,7 +24,7 @@
#include <string>
#include "../../common/WLogger.h"
#include "../../../common/WLogger.h"
#include "WRoiProjectFileIO.h"
......
......@@ -27,7 +27,7 @@
#include <string>
#include "../../common/WProjectFileIO.h"
#include "../../../common/WProjectFileIO.h"
/**
* IO Class for writing the ROI structure to a project file.
......
......@@ -24,8 +24,8 @@
#include <vector>
#include "../../dataHandler/WDataSetFibers.h"
#include "../../kernel/WKernel.h"
#include "../../../dataHandler/WDataSetFibers.h"
#include "../../../kernel/WKernel.h"
#include "WTubeDrawable.h"
// The constructor here does nothing. One thing that may be necessary is
......
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