Commit 0a918f8e authored by mstuber's avatar mstuber
Browse files

[FIX] Fixed some issues of the default branch's current version, partially due...

[FIX] Fixed some issues of the default branch's current version, partially due to misuse of import/export statements. Deinlined some methods of WGlyphmodule.
parent c0d432d0
...@@ -25,7 +25,7 @@ IF( NOT OW_BUILD_AS_ONE_BIG_FILE ) ...@@ -25,7 +25,7 @@ IF( NOT OW_BUILD_AS_ONE_BIG_FILE )
ADD_LIBRARY( ${LIB_NAME} SHARED ${${LIB_NAME}_COMBINER_SRC} ) ADD_LIBRARY( ${LIB_NAME} SHARED ${${LIB_NAME}_COMBINER_SRC} )
ENDIF( NOT OW_BUILD_AS_ONE_BIG_FILE ) ENDIF( NOT OW_BUILD_AS_ONE_BIG_FILE )
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ) TARGET_LINK_LIBRARIES( ${LIB_NAME} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ${OPENSCENEGRAPH_LIBRARIES} )
IF(MSVC_IDE) IF(MSVC_IDE)
SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES PREFIX "../") SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES PREFIX "../")
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include <osg/Vec4> #include <osg/Vec4>
#include <osg/io_utils> // for the operator<< and operator>> for Vec4 #include <osg/io_utils> // for the operator<< and operator>> for Vec4
#include "WExportCommon.h"
/** /**
* Represents a RGBA Color. * Represents a RGBA Color.
*/ */
...@@ -46,7 +48,7 @@ typedef osg::Vec4 WColor; ...@@ -46,7 +48,7 @@ typedef osg::Vec4 WColor;
* *
* \return The same color but in rgba format. * \return The same color but in rgba format.
*/ */
WColor convertHSVtoRGBA( double h, double s, double v ); WColor OWCOMMON_EXPORT convertHSVtoRGBA( double h, double s, double v );
/** /**
* Computes the inverse of this color in means of RGB space. The alpha value is untouched. * Computes the inverse of this color in means of RGB space. The alpha value is untouched.
...@@ -55,7 +57,7 @@ WColor convertHSVtoRGBA( double h, double s, double v ); ...@@ -55,7 +57,7 @@ WColor convertHSVtoRGBA( double h, double s, double v );
* *
* \param other The color (RGBA) from which the inverse should be calculated. * \param other The color (RGBA) from which the inverse should be calculated.
*/ */
WColor inverseColor( const WColor& other ); WColor OWCOMMON_EXPORT inverseColor( const WColor& other );
/** /**
* Some default colors. * Some default colors.
......
...@@ -234,7 +234,7 @@ public: ...@@ -234,7 +234,7 @@ public:
* *
* \return the iterator pointing to the found element. * \return the iterator pointing to the found element.
*/ */
typename WSharedSequenceContainer< S >::Iterator find( const typename S::value_type& value ); typename WSharedSequenceContainer< S >::ConstIterator find( const typename S::value_type& value );
protected: protected:
...@@ -392,7 +392,7 @@ typename WSharedSequenceContainer< S >::Iterator WSharedSequenceContainer< S >:: ...@@ -392,7 +392,7 @@ typename WSharedSequenceContainer< S >::Iterator WSharedSequenceContainer< S >::
} }
template < typename S > template < typename S >
typename WSharedSequenceContainer< S >::Iterator WSharedSequenceContainer< S >::find( const typename S::value_type& value ) typename WSharedSequenceContainer< S >::ConstIterator WSharedSequenceContainer< S >::find( const typename S::value_type& value )
{ {
typename WSharedObject< S >::ReadTicket a = WSharedObject< S >::getReadTicket(); typename WSharedObject< S >::ReadTicket a = WSharedObject< S >::getReadTicket();
return std::find( a->get().begin(), a->get().end(), value ); return std::find( a->get().begin(), a->get().end(), value );
......
...@@ -186,7 +186,7 @@ namespace wge ...@@ -186,7 +186,7 @@ namespace wge
* \param prefix if specified, defines the uniform name prefix. (Sampler, Unit, Sizes, ...) * \param prefix if specified, defines the uniform name prefix. (Sampler, Unit, Sizes, ...)
* \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D. * \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D.
*/ */
void bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WDataTexture3D_2 > texture, size_t unit = 0, std::string prefix = "" ); void OWDATAHANDLER_EXPORT bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WDataTexture3D_2 > texture, size_t unit = 0, std::string prefix = "" );
} }
template < typename T > template < typename T >
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#include <GL/gl.h>
#include "../common/exceptions/WPreconditionNotMet.h" #include "../common/exceptions/WPreconditionNotMet.h"
#include "WGETexture.h" #include "WGETexture.h"
......
...@@ -61,7 +61,7 @@ namespace wge ...@@ -61,7 +61,7 @@ namespace wge
* \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D. * \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D.
*/ */
template < typename T > template < typename T >
void WGE_EXPORT bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< T > texture, size_t unit = 0, std::string prefix = "" ); void bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< T > texture, size_t unit = 0, std::string prefix = "" );
/** /**
* Binds the specified texture to the specified unit. It automatically adds several uniforms which then can be utilized in the shader: * Binds the specified texture to the specified unit. It automatically adds several uniforms which then can be utilized in the shader:
...@@ -79,7 +79,7 @@ namespace wge ...@@ -79,7 +79,7 @@ namespace wge
* \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D. * \tparam T the type of texture. Usually osg::Texture3D or osg::Texture2D.
*/ */
template < typename T > template < typename T >
void WGE_EXPORT bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WGETexture< T > > texture, size_t unit = 0, std::string prefix = "" ); void bindTexture( osg::ref_ptr< osg::Node > node, osg::ref_ptr< WGETexture< T > > texture, size_t unit = 0, std::string prefix = "" );
/** /**
* Removes the binding associated with the specified unit. * Removes the binding associated with the specified unit.
...@@ -105,7 +105,7 @@ namespace wge ...@@ -105,7 +105,7 @@ namespace wge
* *
* \return the generated texture. * \return the generated texture.
*/ */
osg::ref_ptr< WGETexture< osg::Texture1D > > genWhiteNoiseTexture( size_t sizeX, size_t channels ); osg::ref_ptr< WGETexture< osg::Texture1D > > WGE_EXPORT genWhiteNoiseTexture( size_t sizeX, size_t channels );
/** /**
* This generates an 2D texture only containing white noise in its channels. * This generates an 2D texture only containing white noise in its channels.
...@@ -116,7 +116,7 @@ namespace wge ...@@ -116,7 +116,7 @@ namespace wge
* *
* \return the generated texture. * \return the generated texture.
*/ */
osg::ref_ptr< WGETexture< osg::Texture2D > > genWhiteNoiseTexture( size_t sizeX, size_t sizeY, size_t channels ); osg::ref_ptr< WGETexture< osg::Texture2D > > WGE_EXPORT genWhiteNoiseTexture( size_t sizeX, size_t sizeY, size_t channels );
/** /**
* This generates an 3D texture only containing white noise in its channels. * This generates an 3D texture only containing white noise in its channels.
...@@ -128,7 +128,7 @@ namespace wge ...@@ -128,7 +128,7 @@ namespace wge
* *
* \return the generated texture. * \return the generated texture.
*/ */
osg::ref_ptr< WGETexture< osg::Texture3D > > genWhiteNoiseTexture( size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels ); osg::ref_ptr< WGETexture< osg::Texture3D > > WGE_EXPORT genWhiteNoiseTexture( size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels );
/** /**
* Generates an image only containing white noise in its channels. * Generates an image only containing white noise in its channels.
...@@ -140,7 +140,7 @@ namespace wge ...@@ -140,7 +140,7 @@ namespace wge
* *
* \return the generated image. * \return the generated image.
*/ */
osg::ref_ptr< osg::Image > genWhiteNoiseImage( size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels = 1 ); osg::ref_ptr< osg::Image > WGE_EXPORT genWhiteNoiseImage( size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels = 1 );
} }
template < typename T > template < typename T >
......
...@@ -28,14 +28,12 @@ ...@@ -28,14 +28,12 @@
#include <osg/Node> #include <osg/Node>
#include <osg/Switch> #include <osg/Switch>
#include "../WExportWGE.h"
/** /**
* This callback is able to switch a osg::Switch node using a property. Although this callback is a template, only int and bool props are useful * This callback is able to switch a osg::Switch node using a property. Although this callback is a template, only int and bool props are useful
* here. If a bool prop is used, the callback can trigger between child 0 and 1. Technically, WPropDouble is also possible. * here. If a bool prop is used, the callback can trigger between child 0 and 1. Technically, WPropDouble is also possible.
*/ */
template < typename PropType > template < typename PropType >
class WGE_EXPORT WGESwitchCallback: public osg::NodeCallback class WGESwitchCallback: public osg::NodeCallback
{ {
public: public:
/** /**
......
...@@ -32,13 +32,11 @@ ...@@ -32,13 +32,11 @@
#include "WGEShaderPreprocessor.h" #include "WGEShaderPreprocessor.h"
#include "../WExportWGE.h"
/** /**
* This class is able to provide arbitrary values as define statements in GLSL code. * This class is able to provide arbitrary values as define statements in GLSL code.
*/ */
template< typename ValueType = bool > template< typename ValueType = bool >
class WGE_EXPORT WGEShaderDefine: public WGEShaderPreprocessor class WGEShaderDefine: public WGEShaderPreprocessor
{ {
public: public:
/** /**
......
...@@ -54,7 +54,7 @@ class WGEShaderPropertyDefineOptionsIndexAdapter; ...@@ -54,7 +54,7 @@ class WGEShaderPropertyDefineOptionsIndexAdapter;
* update the property. * update the property.
*/ */
template< typename PropType = WPropSelection, typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType > > template< typename PropType = WPropSelection, typename PropIndexAdapter = WGEShaderPropertyDefineOptionsIndexAdapter< PropType > >
class WGE_EXPORT WGEShaderPropertyDefineOptions: public WGEShaderDefineOptions class WGEShaderPropertyDefineOptions: public WGEShaderDefineOptions
{ {
public: public:
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include "../../../graphicsEngine/WGECamera.h" #include "../../../graphicsEngine/WGECamera.h"
#include "../../../graphicsEngine/WGEViewer.h" #include "../../../graphicsEngine/WGEViewer.h"
class WColor;
/** /**
* A widget containing an open gl display area. This initializes OpenGL context and adds a view to the * A widget containing an open gl display area. This initializes OpenGL context and adds a view to the
* engine. * engine.
......
...@@ -111,6 +111,87 @@ WGlyphModule::~WGlyphModule() ...@@ -111,6 +111,87 @@ WGlyphModule::~WGlyphModule()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void WGlyphModule::setTensorData( const boost::shared_ptr< WDataSetSingle >& data, int order, int mode )
{
getNode()->setDeactivated( true );
WGridRegular3D* grid = static_cast< WGridRegular3D* >( data->getGrid().get() );
m_order = order;
m_mode = mode;
m_numOfTensors[ 0 ] = grid->getNbCoordsX();
m_numOfTensors[ 1 ] = grid->getNbCoordsY();
m_numOfTensors[ 2 ] = grid->getNbCoordsZ();
m_slicePosition[ 0 ] = m_numOfTensors[ 0 ] / 2;
m_slicePosition[ 1 ] = m_numOfTensors[ 1 ] / 2;
m_slicePosition[ 2 ] = m_numOfTensors[ 2 ] / 2;
m_sliceVisibility[ 0 ] = true;
m_sliceVisibility[ 1 ] = true;
m_sliceVisibility[ 2 ] = true;
m_tensorData = data;
m_sliceData[ 0 ] = extractSlice( 0 );
m_sliceData[ 1 ] = extractSlice( 1 );
m_sliceData[ 2 ] = extractSlice( 2 );
dirtyBound();
changeCLData( ChangeCallback( this, ChangeCallback::LOAD_DATA_SET ) );
getNode()->setDeactivated( false );
}
//---------------------------------------------------------------------------------------------------------------------
void WGlyphModule::setPosition( int slice, int coord )
{
boost::shared_array< cl_float > sliceData = extractSlice( slice );
getNode()->setDeactivated( true );
m_slicePosition[ slice ] = coord;
m_sliceData[ slice ] = sliceData;
changeCLData( ChangeCallback( this, static_cast< ChangeCallback::ChangeOperation >( slice ) ) );
getNode()->setDeactivated( false );
}
//---------------------------------------------------------------------------------------------------------------------
void WGlyphModule::setVisibility( bool sliceX, bool sliceY, bool sliceZ )
{
getNode()->setDeactivated( true );
m_sliceVisibility[ 0 ] = sliceX;
m_sliceVisibility[ 1 ] = sliceY;
m_sliceVisibility[ 2 ] = sliceZ;
changeCLData( ChangeCallback( this, ChangeCallback::VISIBILITY ) );
getNode()->setDeactivated( false );
}
//---------------------------------------------------------------------------------------------------------------------
void WGlyphModule::setColoring( int mode )
{
getNode()->setDeactivated( true );
m_mode = mode;
changeCLData( ChangeCallback( this, ChangeCallback::SET_COLORING ) );
getNode()->setDeactivated( false );
}
//---------------------------------------------------------------------------------------------------------------------
WGEModuleCL::CLData* WGlyphModule::initCLData( const CLViewData& viewData ) const WGEModuleCL::CLData* WGlyphModule::initCLData( const CLViewData& viewData ) const
{ {
if ( m_source == "" ) if ( m_source == "" )
......
...@@ -326,85 +326,4 @@ inline bool WGlyphModule::isSourceRead() const ...@@ -326,85 +326,4 @@ inline bool WGlyphModule::isSourceRead() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
inline void WGlyphModule::setTensorData( const boost::shared_ptr< WDataSetSingle >& data, int order, int mode )
{
getNode()->setDeactivated( true );
WGridRegular3D* grid = static_cast< WGridRegular3D* >( data->getGrid().get() );
m_order = order;
m_mode = mode;
m_numOfTensors[ 0 ] = grid->getNbCoordsX();
m_numOfTensors[ 1 ] = grid->getNbCoordsY();
m_numOfTensors[ 2 ] = grid->getNbCoordsZ();
m_slicePosition[ 0 ] = m_numOfTensors[ 0 ] / 2;
m_slicePosition[ 1 ] = m_numOfTensors[ 1 ] / 2;
m_slicePosition[ 2 ] = m_numOfTensors[ 2 ] / 2;
m_sliceVisibility[ 0 ] = true;
m_sliceVisibility[ 1 ] = true;
m_sliceVisibility[ 2 ] = true;
m_tensorData = data;
m_sliceData[ 0 ] = extractSlice( 0 );
m_sliceData[ 1 ] = extractSlice( 1 );
m_sliceData[ 2 ] = extractSlice( 2 );
dirtyBound();
changeCLData( ChangeCallback( this, ChangeCallback::LOAD_DATA_SET ) );
getNode()->setDeactivated( false );
}
//---------------------------------------------------------------------------------------------------------------------
inline void WGlyphModule::setPosition( int slice, int coord )
{
boost::shared_array< cl_float > sliceData = extractSlice( slice );
getNode()->setDeactivated( true );
m_slicePosition[ slice ] = coord;
m_sliceData[ slice ] = sliceData;
changeCLData( ChangeCallback( this, static_cast< ChangeCallback::ChangeOperation >( slice ) ) );
getNode()->setDeactivated( false );
}
//---------------------------------------------------------------------------------------------------------------------
inline void WGlyphModule::setVisibility( bool sliceX, bool sliceY, bool sliceZ )
{
getNode()->setDeactivated( true );
m_sliceVisibility[ 0 ] = sliceX;
m_sliceVisibility[ 1 ] = sliceY;
m_sliceVisibility[ 2 ] = sliceZ;
changeCLData( ChangeCallback( this, ChangeCallback::VISIBILITY ) );
getNode()->setDeactivated( false );
}
//---------------------------------------------------------------------------------------------------------------------
inline void WGlyphModule::setColoring( int mode )
{
getNode()->setDeactivated( true );
m_mode = mode;
changeCLData( ChangeCallback( this, ChangeCallback::SET_COLORING ) );
getNode()->setDeactivated( false );
}
//---------------------------------------------------------------------------------------------------------------------
#endif // WGLYPHMODULE_H #endif // WGLYPHMODULE_H
\ No newline at end of file
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