Commit b86b9ba6 authored by André Reichenbach's avatar André Reichenbach
Browse files

[MERGE]

parents f4d01413 1ac35e54
......@@ -483,12 +483,6 @@ MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is NO.
SHOW_DIRECTORIES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
......@@ -519,7 +513,7 @@ FILE_VERSION_FILTER =
# file name after the option, if omitted DoxygenLayout.xml will be used as the name
# of the layout file.
#LAYOUT_FILE = doc/developer/doxygenLayout.xml
# LAYOUT_FILE = doc/developer/doxygenLayout.xml
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
......@@ -823,12 +817,6 @@ HTML_STYLESHEET =
HTML_TIMESTAMP = NO
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
......@@ -1000,11 +988,6 @@ ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
# and Class Hierarchy pages using a tree view instead of an ordered list.
USE_INLINE_TREES = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
......@@ -1539,7 +1522,7 @@ DOTFILE_DIRS =
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
DOT_GRAPH_MAX_NODES = 50
DOT_GRAPH_MAX_NODES = 500
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
......
......@@ -483,12 +483,6 @@ MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is NO.
SHOW_DIRECTORIES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
......@@ -519,7 +513,7 @@ FILE_VERSION_FILTER =
# file name after the option, if omitted DoxygenLayout.xml will be used as the name
# of the layout file.
LAYOUT_FILE = doc/developer/doxygenLayout.xml
# LAYOUT_FILE = doc/developer/doxygenLayout.xml
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
......@@ -825,12 +819,6 @@ HTML_STYLESHEET =
HTML_TIMESTAMP = NO
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
......@@ -1002,11 +990,6 @@ ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
# and Class Hierarchy pages using a tree view instead of an ordered list.
USE_INLINE_TREES = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
......@@ -1541,7 +1524,7 @@ DOTFILE_DIRS =
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
DOT_GRAPH_MAX_NODES = 50
DOT_GRAPH_MAX_NODES = 500
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
......
<doxygenlayout version="1.0">
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title=""/>
<tab type="modules" visible="yes" title="Groups"/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespaces" visible="yes" title=""/>
<tab type="namespacemembers" visible="yes" title=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classes" visible="yes" title=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title=""/>
<tab type="classmembers" visible="yes" title=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="files" visible="yes" title=""/>
<tab type="globals" visible="yes" title=""/>
</tab>
<tab type="dirs" visible="yes" title=""/>
<tab type="examples" visible="yes" title=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<allmemberslink visible="yes"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<typedefs title=""/>
<enums title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<dirs visible="yes" title=""/>
<nestedgroups visible="yes" title=""/>
<files visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>
......@@ -40,8 +40,6 @@
#include "WValueSetBase.h"
#include "WGridRegular3D.h"
/**
* Namespace provides some scaling functions for scaling data values to meet the OpenGL requirements.
*/
......
......@@ -52,6 +52,9 @@ namespace wge
* - u_textureXSizeY: height of the texture in pixels
* - u_textureXSizeZ: depth of the texture in pixels
*
* \warning this is not OSG-thread-safe. This method binds the texture immediately. So please use this only for nodes which are not yet used
* in the scene graph. For safely binding textures to a node already in the scene, utilize an update callback.
*
* \param node where to bind
* \param unit the unit to use
* \param texture the texture to use.
......@@ -70,6 +73,9 @@ namespace wge
* - u_textureXSizeZ: depth of the texture in pixels
* If the specified texture is a WGETexture, it additionally adds u_textureXMin and u_textureXScale for unscaling.
*
* \warning this is not OSG-thread-safe. This method binds the texture immediately. So please use this only for nodes which are not yet used
* in the scene graph. For safely binding textures to a node already in the scene, utilize an update callback.
*
* \param node where to bind
* \param unit the unit to use
* \param texture the texture to use.
......
......@@ -180,7 +180,6 @@ osg::ref_ptr< osg::Image > genWhiteNoise( size_t resX )
void WMDirectVolumeRendering::moduleMain()
{
m_shader = osg::ref_ptr< WGEShader > ( new WGEShader( "WMDirectVolumeRendering", m_localPath ) );
// setup all the defines needed
// local illumination model
......@@ -200,6 +199,7 @@ void WMDirectVolumeRendering::moduleMain()
// jitter
WGEShaderDefine< std::string >::SPtr jitterSamplerDefine = m_shader->setDefine( "JITTERTEXTURE_SAMPLER", std::string( "tex3" ) );
WGEShaderDefine< int >::SPtr jitterSizeXDefine = m_shader->setDefine( "JITTERTEXTURE_SIZEX", 0 );
WGEShaderDefineSwitch::SPtr jitterEnable = m_shader->setDefine( "JITTERTEXTURE_ENABLED" );
// opacity correction enabled?
WGEShaderDefineSwitch::SPtr opacityCorrectionEnableDefine = m_shader->setDefine( "OPACITYCORRECTION_ENABLED" );
......@@ -207,6 +207,10 @@ void WMDirectVolumeRendering::moduleMain()
WGEShaderDefineSwitch::SPtr maximumIntensityProjectionEnabledDefine = m_shader->setDefine( "MIP_ENABLED" );
WGEShaderDefineSwitch::SPtr depthProjectionEnabledDefine = m_shader->setDefine( "DEPTH_PROJECTION_ENABLED" );
// the texture used for the transfer function
osg::ref_ptr< osg::Texture1D > tfTexture = new osg::Texture1D();
osg::ref_ptr< osg::Image > tfImage = new osg::Image();
bool updateTF = false; // if true, update of TF is enforced
// let the main loop awake if the data changes or the properties changed.
m_moduleState.setResetable( true, true );
......@@ -229,7 +233,6 @@ void WMDirectVolumeRendering::moduleMain()
{
// Now, the moduleState variable comes into play. The module can wait for the condition, which gets fired whenever the input receives data
// or an property changes. The main loop now waits until something happens.
debugLog() << "Waiting ...";
m_moduleState.wait();
// quit if requested
......@@ -319,17 +322,45 @@ void WMDirectVolumeRendering::moduleMain()
// create some random noise
jitterSamplerDefine->setActive( false );
jitterEnable->setActive( false );
if( m_stochasticJitterEnabled->get( true ) )
{
const size_t size = 64;
osg::ref_ptr< WGETexture2D > randTexture = new WGETexture2D( genWhiteNoise( size ) );
randTexture->setFilterMinMag( osg::Texture2D::NEAREST );
randTexture->setWrapSTR( osg::Texture2D::REPEAT );
wge::bindTexture( cube, randTexture, 3, "u_jitter" );
wge::bindTexture( cube, randTexture, 2, "u_jitter" );
jitterSamplerDefine->setActive( true );
jitterEnable->setActive( true );
jitterSizeXDefine->setValue( size );
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// transfer function texture
////////////////////////////////////////////////////////////////////////////////////////////////////
osg::ref_ptr< osg::Texture1D > tfTexture = new osg::Texture1D();
tfTexture->setDataVariance( osg::Object::DYNAMIC );
// create some ramp as default
{
int resX = 32;
tfImage->allocateImage( resX, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE );
unsigned char *data = tfImage->data(); // should be 4 megs
for( int x = 0; x < resX; x++ )
{
unsigned char r = ( unsigned char )( 0.1 * 255.0 * static_cast< float >( x ) / static_cast< float >( resX ) );
data[ 4 * x + 0 ] = 255;
data[ 4 * x + 1 ] = 255;
data[ 4 * x + 2 ] = 255;
data[ 4 * x + 3 ] = r;
}
}
tfTexture->setImage( tfImage );
wge::bindTexture( cube, tfTexture, 3, "u_transferFunction" );
// permanently enable the TF texture. As we have no alternative way to set the TF, always use a TF texture
tfTexEnableDefine->setActive( true );
////////////////////////////////////////////////////////////////////////////////////////////////////
// opacity correction
////////////////////////////////////////////////////////////////////////////////////////////////////
......@@ -392,15 +423,17 @@ void WMDirectVolumeRendering::moduleMain()
rootInserted = true;
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( rootNode );
}
updateTF = true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// load transfer function
////////////////////////////////////////////////////////////////////////////////////////////////////
if( ( propUpdated || m_transferFunction->updated() ) && dataValid && cube )
if( ( updateTF || propUpdated || m_transferFunction->updated() ) && dataValid && cube )
{
debugLog() << "updated transfer function";
updateTF = false;
boost::shared_ptr< WDataSetSingle > dataSet = m_transferFunction->getData();
if( !dataSet )
{
......@@ -418,35 +451,18 @@ void WMDirectVolumeRendering::moduleMain()
}
else
{
//debugLog() << "creating transfer function texture";
size_t tfsize = cvalueSet->rawSize();
//debugLog() << "Texture raw size" << tfsize;
const unsigned char* orig = cvalueSet->rawData();
unsigned char* data = new unsigned char[ tfsize ];
std::copy( orig, &orig[ tfsize ], data );
// for ( size_t i = 0; i< 30 && i < tfsize/4; ++i )
// {
// debugLog() << i << ":" << ( int )data[ 4*i ] << ' ' << ( int )data[ 4*i+1 ] << ' '<< ( int )data[ 4*i+2 ]
// << ' '<< ( int ) data[ 4*i+3 ];
// }
osg::ref_ptr< osg::Image > tfImg( new osg::Image() );
//debugLog() << "set image";
tfImg->setImage( tfsize/4, 1, 1, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE,
data, osg::Image::USE_NEW_DELETE ); // FIXME: check allocation mode
//debugLog() << "activate";
tfTexEnableDefine->setActive( false );
osg::ref_ptr< osg::Texture1D > tfTexture = new osg::Texture1D();
tfTexture->setImage( tfImg );
wge::bindTexture( cube, tfTexture, 2, "u_transferFunction" );
tfTexEnableDefine->setActive( true );
//debugLog() << "done creating transfer function texture";
// create image and copy the TF
tfImage->allocateImage( tfsize/4, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE );
tfImage->setInternalTextureFormat( GL_RGBA );
unsigned char* data = reinterpret_cast< unsigned char* >( tfImage->data() );
std::copy( cvalueSet->rawData(), &cvalueSet->rawData()[ tfsize ], data );
// force OpenGl to use the new texture
tfTexture->dirtyTextureObject();
}
}
debugLog() << "end updated transfer function";
}
}
......
......@@ -185,6 +185,7 @@ protected:
/** the port for listening connections */
uint32_t port;
private:
/**
* Points to the socket used by this connection.
*/
......
......@@ -25,6 +25,7 @@
#include <algorithm>
#include <iostream>
#include <cmath>
#include <vector>
#include "WTransferFunctionHistogram.h"
#include "WTransferFunctionWidget.h"
......
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