Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 73cd3ed8 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

fixed dynamic creation of pipeline canvases

parent 21800549
......@@ -255,14 +255,25 @@ namespace campvis {
// OpenGL job processor, since we need to create a new context.
if (_initialized) {
GLJobProc.pause();
{
tgt::QtThreadedCanvas* canvas = CtxtMgr.createContext(name, "CAMPVis", tgt::ivec2(512, 512));
tgt::GLContextScopedLock lock(canvas->getContext());
addPipelineImpl(canvas, name, pipeline);
}
GLJobProc.resume();
}
else {
tgt::QtThreadedCanvas* canvas = CtxtMgr.createContext(name, "CAMPVis", tgt::ivec2(512, 512));
addPipelineImpl(canvas, name, pipeline);
}
_mainWindow->addVisualizationPipelineWidget("foobar", new QWidget());
s_PipelinesChanged();
}
void CampVisApplication::addPipelineImpl(tgt::QtThreadedCanvas* canvas, const std::string& name, AbstractPipeline* pipeline) {
// create canvas and painter for the pipeline and connect all together
tgt::QtThreadedCanvas* canvas = CtxtMgr.createContext(name, "CAMPVis", tgt::ivec2(512, 512));
GLJobProc.registerContext(canvas);
_mainWindow->addVisualizationPipelineWidget(name, canvas);
canvas->init();
CampVisPainter* painter = new CampVisPainter(canvas, pipeline);
......@@ -273,16 +284,21 @@ namespace campvis {
_pipelines.push_back(pipeline);
if (_initialized) {
pipeline->setEnabled(false);
LGL_ERROR;
pipeline->init();
LGL_ERROR;
painter->init();
pipeline->setEnabled(true);
GLJobProc.resume();
LGL_ERROR;
}
CtxtMgr.releaseCurrentContext();
s_PipelinesChanged();
_mainWindow->addVisualizationPipelineWidget(name, canvas);
// enable pipeline and invalidate all processors
pipeline->setEnabled(true);
for (std::vector<AbstractProcessor*>::const_iterator it = pipeline->getProcessors().begin(); it != pipeline->getProcessors().end(); ++it) {
(*it)->invalidate(AbstractProcessor::INVALID_RESULT);
}
}
void CampVisApplication::registerDockWidget(Qt::DockWidgetArea area, QDockWidget* dock) {
......
......@@ -130,6 +130,8 @@ namespace campvis {
sigslot::signal0<> s_DataContainersChanged;
private:
void addPipelineImpl(tgt::QtThreadedCanvas* canvas, const std::string& name, AbstractPipeline* pipeline);
/// All pipelines
std::vector<AbstractPipeline*> _pipelines;
/// All visualisations (i.e. Pipelines with their corresponding painters/canvases)
......
......@@ -246,7 +246,6 @@ namespace campvis {
_layout->addWidget(lblOpacityBottom, 3, 0, 1, 1, Qt::AlignRight);
_canvas = CtxtMgr.createContext("tfcanvas", "", tgt::ivec2(256, 128), tgt::GLCanvas::RGBA_BUFFER, 0, false);
_canvas->doneCurrent();
GLJobProc.registerContext(_canvas);
_canvas->setPainter(this, false);
_layout->addWidget(_canvas, 1, 1, 3, 3);
......
......@@ -232,7 +232,6 @@ namespace campvis {
_layout->addWidget(lblOpacityBottom, 3, 0, 1, 1, Qt::AlignRight);
_canvas = CtxtMgr.createContext("tfcanvas", "", tgt::ivec2(256, 128), tgt::GLCanvas::RGBA_BUFFER, 0, false);
_canvas->doneCurrent();
GLJobProc.registerContext(_canvas);
_canvas->setPainter(this, false);
_layout->addWidget(_canvas, 1, 1, 3, 3);
......
......@@ -45,6 +45,8 @@ namespace campvis {
const QString& windowTitle = QString::fromStdString(name);
_mdiSubWindow->setWindowTitle(windowTitle);
_pipelineWidget->setWindowTitle(windowTitle);
_pipelineWidget->show();
_mdiArea->tileSubWindows();
connect(_mdiSubWindow, SIGNAL(s_positionChanged(const QPoint&)),
this, SLOT(trackMdiSubWindowsPosition(const QPoint&)));
......
......@@ -130,11 +130,9 @@ namespace campvis {
ImageRepresentationLocal* toReturn = 0;
GLJobProc.pause();
try {
tbb::mutex::scoped_lock lock(CtxtMgr.getGlMutex());
context->getContext()->acquire();
tgt::GLContextScopedLock lock(context->getContext());
WeaklyTypedPointer wtp = tester->getWeaklyTypedPointer();
toReturn = convertToGenericLocal(source, wtp);
CtxtMgr.releaseCurrentContext();
}
catch (...) {
LERROR("An unknown error occured during conversion...");
......
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
......@@ -79,7 +80,7 @@ namespace campvis {
{
tgtAssert(_data != 0, "Pointer to the DataContainer for this pipeline must not be 0!");
_enabled = true;
_enabled = false;
addProperty(&_renderTargetID);
addProperty(&_canvasSize);
......
......@@ -67,7 +67,7 @@ namespace campvis {
}
void AutoEvaluationPipeline::onProcessorInvalidated(AbstractProcessor* processor) {
if (_canvas == 0)
if (_canvas == 0 || _enabled == false)
return;
tbb::concurrent_hash_map<AbstractProcessor*, bool>::const_accessor a;
......
......@@ -28,6 +28,7 @@ namespace tgt {
_contexts.insert(std::make_pair(key, toReturn));
toReturn->makeCurrent();
_currentContext = toReturn->getContext();
// Init GLEW for this context
GLenum err = glewInit();
if (err != GLEW_OK) {
......@@ -36,6 +37,7 @@ namespace tgt {
std::cerr << "glewInit failed, error: " << glewGetErrorString(err) << std::endl;
exit(EXIT_FAILURE);
}
releaseCurrentContext();
return toReturn;
}
......@@ -77,11 +79,13 @@ namespace tgt {
}
void QtContextManager::releaseCurrentContext() {
glFlush();
glFinish();
setCurrent(0);
}
QtCanvas* QtContextManager::getCurrentContext() const {
if (_currentContext == 0)
return 0;
return _currentContext->getCanvas();
}
......
......@@ -34,7 +34,8 @@ namespace tgt {
/**
* Creates a new OpenGL context in a QtThreadedCanvas with the given arguments.
* Parameters are the same as in QtThreadedCanvas() but context sharing is enables per default.
* The newly created context will be active, but the OpenGL mutex not be locked.
*
* \note Must be called with the OpenGL mutex acquired!
*
* \note The created canvas/context is owned by this ContextManager. Hence, you may not
* delete it yourself!
......
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