The name of the initial branch for new projects is now "main" instead of "master". Existing projects remain unchanged. More information: https://doku.lrz.de/display/PUBLIC/GitLab

Commit 53ba5fe9 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Renamed TumVisPainter to CampVisPainter

parent 1a7539f2
...@@ -78,7 +78,7 @@ namespace campvis { ...@@ -78,7 +78,7 @@ namespace campvis {
tgtAssert(_initialized == false, "Destructing initialized CampVisApplication, deinitialize first!"); tgtAssert(_initialized == false, "Destructing initialized CampVisApplication, deinitialize first!");
// delete everything in the right order: // delete everything in the right order:
for (std::vector< std::pair<VisualizationPipeline*, TumVisPainter*> >::iterator it = _visualizations.begin(); it != _visualizations.end(); ++it) { for (std::vector< std::pair<VisualizationPipeline*, CampVisPainter*> >::iterator it = _visualizations.begin(); it != _visualizations.end(); ++it) {
delete it->second; delete it->second;
} }
for (std::vector<AbstractPipeline*>::iterator it = _pipelines.begin(); it != _pipelines.end(); ++it) { for (std::vector<AbstractPipeline*>::iterator it = _pipelines.begin(); it != _pipelines.end(); ++it) {
...@@ -167,7 +167,7 @@ namespace campvis { ...@@ -167,7 +167,7 @@ namespace campvis {
} }
// Now init painters: // Now init painters:
for (std::vector< std::pair<VisualizationPipeline*, TumVisPainter*> >::iterator it = _visualizations.begin(); it != _visualizations.end(); ++it) { for (std::vector< std::pair<VisualizationPipeline*, CampVisPainter*> >::iterator it = _visualizations.begin(); it != _visualizations.end(); ++it) {
it->second->init(); it->second->init();
} }
...@@ -190,7 +190,7 @@ namespace campvis { ...@@ -190,7 +190,7 @@ namespace campvis {
} }
// Now deinit painters: // Now deinit painters:
for (std::vector< std::pair<VisualizationPipeline*, TumVisPainter*> >::iterator it = _visualizations.begin(); it != _visualizations.end(); ++it) { for (std::vector< std::pair<VisualizationPipeline*, CampVisPainter*> >::iterator it = _visualizations.begin(); it != _visualizations.end(); ++it) {
it->second->deinit(); it->second->deinit();
} }
...@@ -253,7 +253,7 @@ namespace campvis { ...@@ -253,7 +253,7 @@ namespace campvis {
_mainWindow->addVisualizationPipelineWidget(name, canvas); _mainWindow->addVisualizationPipelineWidget(name, canvas);
canvas->init(); canvas->init();
TumVisPainter* painter = new TumVisPainter(canvas, vp); CampVisPainter* painter = new CampVisPainter(canvas, vp);
canvas->setPainter(painter, false); canvas->setPainter(painter, false);
_visualizations.push_back(std::make_pair(vp, painter)); _visualizations.push_back(std::make_pair(vp, painter));
......
...@@ -45,7 +45,7 @@ namespace tgt { ...@@ -45,7 +45,7 @@ namespace tgt {
namespace campvis { namespace campvis {
class AbstractPipeline; class AbstractPipeline;
class MainWindow; class MainWindow;
class TumVisPainter; class CampVisPainter;
class VisualizationPipeline; class VisualizationPipeline;
/** /**
...@@ -132,7 +132,7 @@ namespace campvis { ...@@ -132,7 +132,7 @@ namespace campvis {
/// All pipelines (incuding VisualizationPipelines) /// All pipelines (incuding VisualizationPipelines)
std::vector<AbstractPipeline*> _pipelines; std::vector<AbstractPipeline*> _pipelines;
/// All visualisations (i.e. VisualizationPipelines with their corresponding painters/canvases) /// All visualisations (i.e. VisualizationPipelines with their corresponding painters/canvases)
std::vector< std::pair<VisualizationPipeline*, TumVisPainter*> > _visualizations; std::vector< std::pair<VisualizationPipeline*, CampVisPainter*> > _visualizations;
/// A local OpenGL context used for initialization /// A local OpenGL context used for initialization
tgt::QtThreadedCanvas* _localContext; tgt::QtThreadedCanvas* _localContext;
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
#include "core/tools/quadrenderer.h" #include "core/tools/quadrenderer.h"
namespace campvis { namespace campvis {
const std::string TumVisPainter::loggerCat_ = "CAMPVis.core.TumVisPainter"; const std::string CampVisPainter::loggerCat_ = "CAMPVis.core.CampVisPainter";
TumVisPainter::TumVisPainter(tgt::GLCanvas* canvas, VisualizationPipeline* pipeline) CampVisPainter::CampVisPainter(tgt::GLCanvas* canvas, VisualizationPipeline* pipeline)
: Runnable() : Runnable()
, tgt::Painter(canvas) , tgt::Painter(canvas)
, _pipeline(0) , _pipeline(0)
...@@ -60,11 +60,11 @@ namespace campvis { ...@@ -60,11 +60,11 @@ namespace campvis {
setPipeline(pipeline); setPipeline(pipeline);
} }
TumVisPainter::~TumVisPainter() { CampVisPainter::~CampVisPainter() {
} }
void TumVisPainter::stop() { void CampVisPainter::stop() {
// we need to execute run() one more time to ensure correct release of the OpenGL context // we need to execute run() one more time to ensure correct release of the OpenGL context
_stopExecution = true; _stopExecution = true;
_renderCondition.notify_all(); _renderCondition.notify_all();
...@@ -72,7 +72,7 @@ namespace campvis { ...@@ -72,7 +72,7 @@ namespace campvis {
Runnable::stop(); Runnable::stop();
} }
void TumVisPainter::run() { void CampVisPainter::run() {
std::unique_lock<tbb::mutex> lock(CtxtMgr.getGlMutex()); std::unique_lock<tbb::mutex> lock(CtxtMgr.getGlMutex());
while (! _stopExecution) { while (! _stopExecution) {
...@@ -89,7 +89,7 @@ namespace campvis { ...@@ -89,7 +89,7 @@ namespace campvis {
CtxtMgr.releaseCurrentContext(); CtxtMgr.releaseCurrentContext();
} }
void TumVisPainter::paint() { void CampVisPainter::paint() {
if (getCanvas() == 0) if (getCanvas() == 0)
return; return;
...@@ -150,11 +150,11 @@ namespace campvis { ...@@ -150,11 +150,11 @@ namespace campvis {
getCanvas()->swap(); getCanvas()->swap();
} }
void TumVisPainter::sizeChanged(const tgt::ivec2& size) { void CampVisPainter::sizeChanged(const tgt::ivec2& size) {
_pipeline->setRenderTargetSize(size); _pipeline->setRenderTargetSize(size);
} }
void TumVisPainter::init() { void CampVisPainter::init() {
try { try {
// TODO: Remove hardcoded paths, and use ShdrMgr.addPath() at some central location // TODO: Remove hardcoded paths, and use ShdrMgr.addPath() at some central location
_copyShader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "", false); _copyShader = ShdrMgr.loadSeparate("core/glsl/passthrough.vert", "core/glsl/copyimage.frag", "", false);
...@@ -164,7 +164,7 @@ namespace campvis { ...@@ -164,7 +164,7 @@ namespace campvis {
} }
} }
void TumVisPainter::deinit() { void CampVisPainter::deinit() {
ShdrMgr.dispose(_copyShader); ShdrMgr.dispose(_copyShader);
if (_pipeline != 0) { if (_pipeline != 0) {
...@@ -175,7 +175,7 @@ namespace campvis { ...@@ -175,7 +175,7 @@ namespace campvis {
} }
} }
void TumVisPainter::setPipeline(VisualizationPipeline* pipeline) { void CampVisPainter::setPipeline(VisualizationPipeline* pipeline) {
tgtAssert(pipeline != 0, "The given pipeline must not be 0."); tgtAssert(pipeline != 0, "The given pipeline must not be 0.");
if (_pipeline != 0) { if (_pipeline != 0) {
_pipeline->s_renderTargetChanged.disconnect(this); _pipeline->s_renderTargetChanged.disconnect(this);
...@@ -184,21 +184,21 @@ namespace campvis { ...@@ -184,21 +184,21 @@ namespace campvis {
} }
_pipeline = pipeline; _pipeline = pipeline;
_pipeline->s_renderTargetChanged.connect(this, &TumVisPainter::onRenderTargetChanged); _pipeline->s_renderTargetChanged.connect(this, &CampVisPainter::onRenderTargetChanged);
_pipeline->setRenderTargetSize(getCanvas()->getSize()); _pipeline->setRenderTargetSize(getCanvas()->getSize());
if (getCanvas()->getEventHandler() != 0) if (getCanvas()->getEventHandler() != 0)
getCanvas()->getEventHandler()->addEventListenerToFront(_pipeline); getCanvas()->getEventHandler()->addEventListenerToFront(_pipeline);
} }
void TumVisPainter::repaint() { void CampVisPainter::repaint() {
GLJobProc.enqueueJob(getCanvas(), makeJobOnHeap(this, &TumVisPainter::paint), OpenGLJobProcessor::PaintJob); GLJobProc.enqueueJob(getCanvas(), makeJobOnHeap(this, &CampVisPainter::paint), OpenGLJobProcessor::PaintJob);
} }
void TumVisPainter::onRenderTargetChanged() { void CampVisPainter::onRenderTargetChanged() {
repaint(); repaint();
} }
void TumVisPainter::setCanvas(tgt::GLCanvas* canvas) { void CampVisPainter::setCanvas(tgt::GLCanvas* canvas) {
tgtAssert(dynamic_cast<tgt::QtThreadedCanvas*>(canvas) != 0, "Canvas must be of type QtThreadedCanvas!"); tgtAssert(dynamic_cast<tgt::QtThreadedCanvas*>(canvas) != 0, "Canvas must be of type QtThreadedCanvas!");
Painter::setCanvas(canvas); Painter::setCanvas(canvas);
} }
......
...@@ -55,19 +55,19 @@ namespace campvis { ...@@ -55,19 +55,19 @@ namespace campvis {
* *
* \sa Runnable, VisualizationPipeline * \sa Runnable, VisualizationPipeline
*/ */
class TumVisPainter : public Runnable, public tgt::Painter, public sigslot::has_slots<> { class CampVisPainter : public Runnable, public tgt::Painter, public sigslot::has_slots<> {
public: public:
/** /**
* Creates a new TumVisPainter rendering the render target of \a pipeline on \a canvas. * Creates a new CampVisPainter rendering the render target of \a pipeline on \a canvas.
* \param canvas Canvas to render on * \param canvas Canvas to render on
* \param pipeline Pipeline to render * \param pipeline Pipeline to render
*/ */
TumVisPainter(tgt::GLCanvas* canvas, VisualizationPipeline* pipeline); CampVisPainter(tgt::GLCanvas* canvas, VisualizationPipeline* pipeline);
/** /**
* Destructor, stops and waits for the rendering thread if it's still running. * Destructor, stops and waits for the rendering thread if it's still running.
*/ */
virtual ~TumVisPainter(); virtual ~CampVisPainter();
/// \see Runnable::stop /// \see Runnable::stop
void stop(); void stop();
......
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