Commit 8698e301 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[MERGE] merged latest changes of release branch

parents 5a3ba030 dc3395ca
......@@ -78,18 +78,13 @@ void WPathHelper::setBasePaths( boost::filesystem::path appPath, boost::filesyst
void WPathHelper::setBasePathsOSXBundle( boost::filesystem::path appPath, boost::filesystem::path homePath )
{
//W_ASSERT( appPath.substr( size()-sizeof( "MacOS" ), sizeof( "MacOS" ) ) == "MacOS" );
m_appPath = appPath;
m_homePath = homePath;
setBasePaths( appPath, homePath ); // set all to ordinary paths, but the following are different:
m_sharePath = m_appPath / "../Resources/openwalnut";
m_docPath = m_appPath / "../Resources/doc";
m_configPath = m_appPath / "../Resources/openwalnut";
m_libPath = m_appPath / ".." / W_LIB_DIR_RELATIVE; // NOTE: this variable is set by CMake.
// This is the default search path. Use getAllModulePaths for finding all modules, including those whose
// directories where defined by the user.
m_modulePath = m_appPath / "../Resources/modules";
// this is the relative path for module resources. It is relative to the path of the lib containing the module.
// The MacOSX bundle stores the modules in Resources/modules. We want the additional resources to be stored in the module's directory.
m_moduleResourcePathRelative = boost::filesystem::path( "." );
}
......
......@@ -123,7 +123,7 @@ void computeSVD( const WMatrix< T >& A,
WMatrix< T >& V,
WValue< T >& S )
{
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > eigenA( A );
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > eigenA = A;
Eigen::JacobiSVD< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > > svd( eigenA, Eigen::ComputeFullU | Eigen::ComputeFullV );
U = WMatrix< T >( svd.matrixU() );
V = WMatrix< T >( svd.matrixV() );
......
......@@ -61,7 +61,7 @@ std::ostream& operator<<( std::ostream& os, const RealEigenSystem& sys );
*
* \param es Eigensystem consisting of eigenvalues and eigenvectors.
*/
void sortRealEigenSystem( RealEigenSystem* es )
inline void sortRealEigenSystem( RealEigenSystem* es )
{
if( ( *es )[0].first > ( *es )[2].first )
{
......
......@@ -52,14 +52,14 @@ public:
typedef WMatrixFixed< int, 3, 2 > WMI32;
typedef WMatrixFixed< std::size_t, 3, 2 > WMS32;
TS_ASSERT_THROWS_NOTHING( WMD32 matrix() );
TS_ASSERT_THROWS_NOTHING( WMF32 matrix() );
TS_ASSERT_THROWS_NOTHING( WMD11 matrix() );
TS_ASSERT_THROWS_NOTHING( WMF11 matrix() );
TS_ASSERT_THROWS_NOTHING( WMD44 matrix() );
TS_ASSERT_THROWS_NOTHING( WMF44 matrix() );
TS_ASSERT_THROWS_NOTHING( WMI32 matrix() );
TS_ASSERT_THROWS_NOTHING( WMS32 matrix() );
TS_ASSERT_THROWS_NOTHING( WMD32 matrix );
TS_ASSERT_THROWS_NOTHING( WMF32 matrix );
TS_ASSERT_THROWS_NOTHING( WMD11 matrix );
TS_ASSERT_THROWS_NOTHING( WMF11 matrix );
TS_ASSERT_THROWS_NOTHING( WMD44 matrix );
TS_ASSERT_THROWS_NOTHING( WMF44 matrix );
TS_ASSERT_THROWS_NOTHING( WMI32 matrix );
TS_ASSERT_THROWS_NOTHING( WMS32 matrix );
}
/**
......
......@@ -66,7 +66,7 @@ public:
typedef WTensorBase< 0, 0, int > T00;
// standard constructor should never throw
TS_ASSERT_THROWS_NOTHING( T12 t12() );
TS_ASSERT_THROWS_NOTHING( T12 t12 );
T12 t12;
// number of data elements should be 2
......@@ -82,7 +82,7 @@ public:
}
// do the same for some more tensors
TS_ASSERT_THROWS_NOTHING( T23 t23() );
TS_ASSERT_THROWS_NOTHING( T23 t23 );
T23 t23;
ds = T23::dataSize;
TS_ASSERT_EQUALS( ds, 9 );
......@@ -91,7 +91,7 @@ public:
TS_ASSERT_EQUALS( t23.m_data[ k ], 0.0f );
}
TS_ASSERT_THROWS_NOTHING( T42 t42() );
TS_ASSERT_THROWS_NOTHING( T42 t42 );
T42 t42;
ds = T42::dataSize;
TS_ASSERT_EQUALS( ds, 16 );
......@@ -100,7 +100,7 @@ public:
TS_ASSERT_EQUALS( t42.m_data[ k ], 0 );
}
TS_ASSERT_THROWS_NOTHING( T63 t63() );
TS_ASSERT_THROWS_NOTHING( T63 t63 );
T63 t63;
ds = T63::dataSize;
TS_ASSERT_EQUALS( ds, 729 );
......@@ -109,7 +109,7 @@ public:
TS_ASSERT_EQUALS( t63.m_data[ k ], 0.0 );
}
TS_ASSERT_THROWS_NOTHING( T00 t00() );
TS_ASSERT_THROWS_NOTHING( T00 t00 );
T00 t00;
TS_ASSERT_EQUALS( t00.m_data, 0 );
}
......@@ -998,7 +998,7 @@ public:
typedef WTensorBaseSym< 0, 0, int > T00;
// standard constructor should never throw
TS_ASSERT_THROWS_NOTHING( T12 t12() );
TS_ASSERT_THROWS_NOTHING( T12 t12 );
T12 t12;
// number of data elements should be 2
......@@ -1015,7 +1015,7 @@ public:
// do the same for some more tensors
// symmetric tensors need less memory, 6 instead of 9 values in this case
TS_ASSERT_THROWS_NOTHING( T23 t23() );
TS_ASSERT_THROWS_NOTHING( T23 t23 );
T23 t23;
ds = T23::dataSize;
TS_ASSERT_EQUALS( ds, 6 );
......@@ -1024,7 +1024,7 @@ public:
TS_ASSERT_EQUALS( t23.m_data[ k ], 0.0f );
}
TS_ASSERT_THROWS_NOTHING( T42 t42() );
TS_ASSERT_THROWS_NOTHING( T42 t42 );
T42 t42;
ds = T42::dataSize;
TS_ASSERT_EQUALS( ds, 5 );
......@@ -1033,7 +1033,7 @@ public:
TS_ASSERT_EQUALS( t42.m_data[ k ], 0 );
}
TS_ASSERT_THROWS_NOTHING( T63 t63() );
TS_ASSERT_THROWS_NOTHING( T63 t63 );
T63 t63;
ds = T63::dataSize;
TS_ASSERT_EQUALS( ds, 28 );
......@@ -1042,7 +1042,7 @@ public:
TS_ASSERT_EQUALS( t63.m_data[ k ], 0.0 );
}
TS_ASSERT_THROWS_NOTHING( T00 t00() );
TS_ASSERT_THROWS_NOTHING( T00 t00 );
T00 t00;
TS_ASSERT_EQUALS( t00.m_data, 0 );
}
......
......@@ -43,7 +43,7 @@ public:
*/
void testInstantiation( void )
{
TS_ASSERT_THROWS_NOTHING( WException e() );
TS_ASSERT_THROWS_NOTHING( WException e );
TS_ASSERT_THROWS_NOTHING( WException e( std::string( "Some message" ) ) );
}
......
......@@ -44,7 +44,7 @@ public:
*/
void testInstantiation( void )
{
TS_ASSERT_THROWS_NOTHING( WTerminalColor c() );
TS_ASSERT_THROWS_NOTHING( WTerminalColor c );
TS_ASSERT_THROWS_NOTHING( WTerminalColor( WTerminalColor::Bold, WTerminalColor::FGRed, WTerminalColor::BGNone ) );
}
......
......@@ -32,7 +32,7 @@ WDataTexture3D::WDataTexture3D( boost::shared_ptr< WValueSetBase > valueSet, boo
WGETexture3D( static_cast< float >( valueSet->getMaximumValue() - valueSet->getMinimumValue() ),
static_cast< float >( valueSet->getMinimumValue() ) ),
m_valueSet( valueSet ),
m_boundingBox( grid->getBoundingBoxIncludingBorder() )
m_boundingBox( grid->getVoxelBoundingBox() )
{
// initialize members
setTextureSize( grid->getNbCoordsX(), grid->getNbCoordsY(), grid->getNbCoordsZ() );
......@@ -61,11 +61,14 @@ WDataTexture3D::WDataTexture3D( boost::shared_ptr< WValueSetBase > valueSet, boo
// Move to voxel center. This scaling is NOT included in the grid's transform, so we need to add it here
WMatrix4d offset = WMatrix4d::identity();
offset( 0, 3 ) = 0.5 / grid->getNbCoordsX();
offset( 1, 3 ) = 0.5 / grid->getNbCoordsY();
offset( 2, 3 ) = 0.5 / grid->getNbCoordsZ();
offset( 3, 0 ) = 0.5 / grid->getNbCoordsX();
offset( 3, 1 ) = 0.5 / grid->getNbCoordsY();
offset( 3, 2 ) = 0.5 / grid->getNbCoordsZ();
transformation()->set( invert( static_cast< WMatrix4d >( grid->getTransform() ) ) * scale * offset );
WMatrix4d const m = grid->getTransform(); // implicit cast
Eigen::Matrix4d em = m;
transformation()->set( WMatrix4d( em.inverse() ) * scale * offset );
// set the size
WGETexture3D::initTextureSize( this, grid->getNbCoordsX(), grid->getNbCoordsY(), grid->getNbCoordsZ() );
......
......@@ -40,7 +40,7 @@ public:
*/
void testInstantiation( void )
{
TS_ASSERT_THROWS_NOTHING( WDataSet dataSet() );
TS_ASSERT_THROWS_NOTHING( WDataSet dataSet );
}
};
......
......@@ -51,7 +51,7 @@ public:
void testInstantiation()
{
{
TS_ASSERT_THROWS_NOTHING( WGridTransformOrtho v() );
TS_ASSERT_THROWS_NOTHING( WGridTransformOrtho v );
WGridTransformOrtho v;
TS_ASSERT_EQUALS( v.getOffsetX(), 1.0 );
TS_ASSERT_EQUALS( v.getOffsetY(), 1.0 );
......
......@@ -242,34 +242,77 @@ osg::ref_ptr< osg::Geometry > wge::createUnitCube( const WColor& color )
return createCube( WPosition( 0.0, 0.0, 0.0 ), WPosition( 1.0, 1.0, 1.0 ), color );
}
osg::ref_ptr< osg::Geometry > wge::createUnitCubeAsLines( const WColor& color )
osg::ref_ptr< osg::Geometry > wge::createUnitCubeAsLines( const WColor& color, bool asLines )
{
// create the unit cube manually as the ShapeDrawable and osg::Box does not provide 3D texture coordinates
osg::ref_ptr< osg::Geometry > cube = new osg::Geometry();
osg::ref_ptr< osg::Vec3Array > vertices = osg::ref_ptr< osg::Vec3Array >( new osg::Vec3Array );
osg::ref_ptr< osg::Vec4Array > colors = osg::ref_ptr< osg::Vec4Array >( new osg::Vec4Array );
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
cube->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::LINE_STRIP, 0, vertices->size() ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
cube->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::LINES, vertices->size() - 6, 6 ) );
if( !asLines )
{
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
cube->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::LINE_STRIP, 0, vertices->size() ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
cube->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::LINES, vertices->size() - 6, 6 ) );
}
else
{
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 0.0, 1.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 0.0, 1.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 0.0 ) );
vertices->push_back( osg::Vec3( 1.0, 1.0, 1.0 ) );
cube->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::LINES, 0, vertices->size() ) );
}
// set it up and set arrays
cube->setVertexArray( vertices );
......
......@@ -113,10 +113,11 @@ namespace wge
* Creates a osg::Geometry containing an unit cube as line-strips, having 3D texture coordinates.
*
* \param color the color to set for all vertices
* \param asLines force the cube to be made only of lines, no line strips.
*
* \return the geometry
*/
osg::ref_ptr< osg::Geometry > createUnitCubeAsLines( const WColor& color );
osg::ref_ptr< osg::Geometry > createUnitCubeAsLines( const WColor& color, bool asLines = false );
/**
* Extract the vertices and triangles from a WTriangleMesh and save them
......
......@@ -30,33 +30,10 @@
#include "exceptions/WGEInitFailed.h"
WGEGraphicsWindow::WGEGraphicsWindow( osg::ref_ptr<osg::Referenced>
#ifdef WGEMODE_MULTITHREADED
wdata // this parameter is only needed on non-mac
#endif
,
int x,
int y,
int width,
int height ):
m_closed( false )
WGEGraphicsWindow::WGEGraphicsWindow( osg::ref_ptr< osg::Referenced >, int x, int y, int width, int height ) : m_closed( false )
{
#ifdef WGEMODE_MULTITHREADED
// initialize context
m_WindowData = wdata;
try
{
createContext( x, y, width, height );
}
catch( ... )
{
// use our own exceptions
throw WGEInitFailed( "Initialization of OpenGL graphics context failed." );
}
#else
m_GraphicsWindow = osg::ref_ptr<osgViewer::GraphicsWindow>(
static_cast<osgViewer::GraphicsWindow*>( new osgViewer::GraphicsWindowEmbedded( x, y, width, height ) ) );
#endif
}
WGEGraphicsWindow::~WGEGraphicsWindow()
......@@ -69,42 +46,6 @@ osg::ref_ptr<osgViewer::GraphicsWindow> WGEGraphicsWindow::getGraphicsWindow()
return m_GraphicsWindow;
}
#ifdef WGEMODE_MULTITHREADED
void WGEGraphicsWindow::createContext( int x, int y, int width, int height )
{
// Create traits for graphics contest request
osg::ref_ptr<osg::DisplaySettings> ds = osg::DisplaySettings::instance();
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
// set a lot of values
traits->windowName = "OpenWalnut";
traits->x = x;
traits->y = y;
traits->width = width;
traits->height = height;
traits->alpha = ds->getMinimumNumAlphaBits();
traits->stencil = ds->getMinimumNumStencilBits();
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->sampleBuffers = ds->getMultiSamples();
traits->samples = ds->getNumMultiSamples();
traits->inheritedWindowData = m_WindowData;
traits->vsync = true;
// finally create graphics context and window
m_GraphicsContext = osg::GraphicsContext::createGraphicsContext( traits.get() );
m_GraphicsWindow = osg::ref_ptr<osgViewer::GraphicsWindow>(
static_cast<osgViewer::GraphicsWindow*>( m_GraphicsContext.get() ) );
// get around dearranged traits on X11 (MTCompositeViewer only)
traits->x = x;
traits->y = x;
traits->width = width;
traits->height = height;
}
#endif
void WGEGraphicsWindow::resize( int width, int height )
{
if( !m_GraphicsWindow )
......
......@@ -28,8 +28,6 @@
#include <boost/shared_ptr.hpp>
#include <osgViewer/GraphicsWindow>
#include "WGraphicsEngineMode.h"
/**
* Class managing a single graphics context and OSG GraphicsWindow.
* \ingroup ge
......@@ -129,27 +127,6 @@ protected:
*/
osg::ref_ptr<osgViewer::GraphicsWindow> m_GraphicsWindow;
#ifdef WGEMODE_MULTITHREADED
/**
* Creates a new OpenGL context in the calling thread. Needs to be called before any other OpenGL operation.
*
* \param x X coordinate of widget where to create the context.
* \param y Y coordinate of widget where to create the context.
* \param width Width of the widget.
* \param height Height of the Widget.
*/
void createContext( int x, int y, int width, int height );
/**
* OpenSceneGraph render context.
*/
osg::ref_ptr<osg::GraphicsContext> m_GraphicsContext;
/**
* Widget window data.
*/
osg::ref_ptr<osg::Referenced> m_WindowData;
#endif
private:
/**
* Mark the window opened or closed.
......
......@@ -278,6 +278,13 @@ public:
*/
virtual WBoundingBox getBoundingBox() const;
/**
* Copy the values of all properties except the texture transformation into the properties of this texture.
*
* \param from The texture to copy property values from.
*/
virtual void copyPropertiesExceptTransformation( osg::ref_ptr< WGETexture< TextureType > > const& from );
protected:
/**
* Handles all property updates. Called by m_propCondition.
......@@ -774,6 +781,29 @@ WBoundingBox WGETexture< TextureType >::getBoundingBox() const
return WBoundingBox( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 );
}
template < typename TextureType >
void WGETexture< TextureType >::copyPropertiesExceptTransformation( osg::ref_ptr< WGETexture< TextureType > > const& from )
{
m_name->set( from->m_name->get() );
m_sortIdx->set( from->m_sortIdx->get() );
m_min->set( from->m_min->get() );
m_scale->set( from->m_scale->get() );
m_alpha->set( from->m_alpha->get() );
m_clipZero->set( from->m_clipZero->get() );
m_thresholdEnabled->set( from->m_thresholdEnabled->get() );
m_thresholdLower->set( from->m_thresholdLower->get() );
m_thresholdUpper->set( from->m_thresholdUpper->get() );
m_windowEnabled->set( from->m_windowEnabled->get() );
m_window->set( from->m_window->get() );
m_interpolation->set( from->m_interpolation->get() );
m_colorMapSelectionsList = from->m_colorMapSelectionsList;
m_colorMap->set( from->m_colorMap->get() );
m_active->set( from->m_active->get() );
}
template < typename TextureType >
WPVBaseTypes::PV_INT WGETexture< TextureType >::getUnsetSortIndex()
{
......
......@@ -41,6 +41,8 @@
#include <osgDB/ReadFile>
#include "core/common/WLogger.h"
#include "WGE2DManipulator.h"
#include "WGEGroupNode.h"
#include "WGENoOpManipulator.h"
......@@ -49,8 +51,8 @@
#include "WPickHandler.h"
#include "exceptions/WGEInitFailed.h"
#include "../common/WConditionOneShot.h"
#include "../common/WThreadedRunner.h"
#include "core/common/WConditionOneShot.h"
#include "core/common/WThreadedRunner.h"
#include "WGEViewer.h"
......@@ -70,12 +72,7 @@ WGEViewer::WGEViewer( std::string name, osg::ref_ptr<osg::Referenced> wdata, int
{
try
{
#ifdef WGEMODE_MULTITHREADED
m_View = osg::ref_ptr<osgViewer::View>( new osgViewer::View );
#else
// on mac, this is a viewer!
m_View = osg::ref_ptr<osgViewer::Viewer>( new osgViewer::Viewer );
#endif
osg::ref_ptr< WGECamera > cam( new WGECamera( width, height, projectionMode ) );
m_View->setCamera( cam );
......@@ -83,11 +80,7 @@ WGEViewer::WGEViewer( std::string name, osg::ref_ptr<osg::Referenced> wdata, int
m_View->getCamera()->setInitialDrawCallback( m_queryCallback );
m_View->getCamera()->setFinalDrawCallback( m_screenCapture );
#ifdef WGEMODE_MULTITHREADED
m_View->getCamera()->setGraphicsContext( m_GraphicsContext.get() );
#else
m_View->getCamera()->setGraphicsContext( m_GraphicsWindow.get() );
#endif
switch( projectionMode )
{
......@@ -154,12 +147,7 @@ WGEViewer::~WGEViewer()
close();
}
#ifdef WGEMODE_SINGLETHREADED
osg::ref_ptr<osgViewer::Viewer>
#else
osg::ref_ptr<osgViewer::View>
#endif
WGEViewer::getView()
osg::ref_ptr<osgViewer::Viewer> WGEViewer::getView()
{
return m_View;
}
......@@ -233,9 +221,7 @@ WColor WGEViewer::getBgColor() const
void WGEViewer::paint()
{
#ifdef WGEMODE_SINGLETHREADED
m_View->frame();
#endif
}
void WGEViewer::resize( int width, int height )
......
......@@ -53,7 +53,6 @@
#include "WGECamera.h"
#include "WGEGraphicsWindow.h"
#include "WGraphicsEngineMode.h"
class WGEGroupNode;
#include "WGEScreenCapture.h"
class WPickHandler;
......@@ -125,11 +124,7 @@ public:
*
* \return the OSG Viewer instance.
*/
#ifdef WGEMODE_SINGLETHREADED
osg::ref_ptr<osgViewer::Viewer> getView();
#else
osg::ref_ptr<osgViewer::View> getView();
#endif
/**
* If the widget is not visible, we might be able to reduce CPU load. This does not hide the widget.
......@@ -340,11 +335,7 @@ protected:
/**
* The OpenSceneGraph view used in this (Composite)Viewer.
*/
#ifdef WGEMODE_SINGLETHREADED
osg::ref_ptr< osgViewer::Viewer > m_View;
#else
osg::ref_ptr< osgViewer::View > m_View;
#endif
/**
* The name of the viewer.
......
......@@ -46,7 +46,6 @@
#include "WGEViewer.h"
#include "exceptions/WGEInitFailed.h"