Commit 472caf58 authored by schultezub's avatar schultezub
Browse files

some minor changes

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@199 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 725f577a
......@@ -9,6 +9,7 @@
#include "tgt/quadric.h"
#include "core/datastructures/imagedatarendertarget.h"
#include "core/pipeline/visualizationpipeline.h"
namespace TUMVis {
const std::string TumVisPainter::loggerCat_ = "TUMVis.core.TumVisPainter";
......
......@@ -4,9 +4,7 @@
#include "tgt/logmanager.h"
#include "tgt/painter.h"
#include "core/tools/runnable.h"
#include "core/pipeline/visualizationpipeline.h"
namespace tgt {
class Shader;
......@@ -14,6 +12,7 @@ namespace tgt {
}
namespace TUMVis {
class VisualizationPipeline;
/**
* Painter class for TUMVis, rendering the render target of a VisualizationPipeline.
......
#include "abstractpipeline.h"
#include "tgt/exception.h"
#include "core/pipeline/abstractprocessor.h"
namespace TUMVis {
const std::string AbstractPipeline::loggerCat_ = "TUMVis.core.datastructures.AbstractPipeline";
......
#include "qtcontextmanager.h"
#include "tgt/assert.h"
#include "tgt/qt/qtglcontext.h"
namespace tgt {
......@@ -10,7 +12,7 @@ namespace tgt {
QtContextManager::~QtContextManager()
{
for (std::map<std::string, QtCanvas*>::iterator it = _contexts.begin(); it != _contexts.end(); ++it) {
for (std::map<std::string, QtThreadedCanvas*>::iterator it = _contexts.begin(); it != _contexts.end(); ++it) {
delete it->second;
}
_contexts.clear();
......@@ -37,24 +39,15 @@ namespace tgt {
}
QtGLContext* QtContextManager::getContextByKey(const std::string& key) {
std::map<std::string, QtCanvas*>::iterator it = _contexts.find(key);
std::map<std::string, QtThreadedCanvas*>::iterator it = _contexts.find(key);
if (it != _contexts.end())
return it->second->getContext();
else
return 0;
}
void QtContextManager::setCurrent(QtGLContext* context) {
if (_currentContext != context) {
if (_currentContext != 0) {
// // TODO: check whether this is necessary or Qt is already doing this
// glFlush();
// LGL_ERROR;
// _currentContext->getCanvas()->doneCurrent();
// LGL_ERROR;
}
if (context == 0) {
// explicitely release OpenGL context
_currentContext->getCanvas()->doneCurrent();
......@@ -85,11 +78,4 @@ namespace tgt {
setCurrent(0);
}
}
......@@ -3,12 +3,13 @@
#include "tgt/singleton.h"
#include "tgt/qt/qtthreadedcanvas.h"
#include "tgt/qt/qtglcontext.h"
#include "tbb/include/tbb/mutex.h" // TODO: TBB dependency in TGT is not that beautiful...
#include <map>
#include <string>
namespace tgt {
class QtGLContext;
class QtThreadedCanvas;
/**
* Manages multiple shared OpenGL contexts and offers methods to ensure that only one context is active at a time.
......@@ -82,7 +83,7 @@ namespace tgt {
void unlock();
std::map<std::string, QtCanvas*> _contexts; ///< Map of all OpenGL contexts
std::map<std::string, QtThreadedCanvas*> _contexts; ///< Map of all OpenGL contexts
QtGLContext* _currentContext; ///< Current active OpenGL context
tbb::mutex _glMutex; ///< Mutex protecting OpenGL for multi-threaded access
};
......
......@@ -8,7 +8,7 @@
namespace tgt {
/**
* Subclass of QtCanvas that manages a separate rendering thread.
* Subclass of QtCanvas that supports multi-threading.
*/
class QtThreadedCanvas : public tgt::QtCanvas {
public:
......
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