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 fb8b1880 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Moved AbstractJob and OpenGLJobProcessor from campvis-core to tgt and adapted...

Moved AbstractJob and OpenGLJobProcessor from campvis-core to tgt and adapted and cleaned up all necessary includes/references.
parent 58512d30
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "tgt/glcanvas.h" #include "tgt/glcanvas.h"
#include "tgt/glcontextmanager.h" #include "tgt/glcontextmanager.h"
#include "tgt/gpucapabilities.h" #include "tgt/gpucapabilities.h"
#include "tgt/opengljobprocessor.h"
#include "tgt/shadermanager.h" #include "tgt/shadermanager.h"
#include "tgt/texturereadertga.h" #include "tgt/texturereadertga.h"
#include "tgt/qt/qtapplication.h" #include "tgt/qt/qtapplication.h"
...@@ -39,8 +40,6 @@ ...@@ -39,8 +40,6 @@
#include "application/gui/mainwindow.h" #include "application/gui/mainwindow.h"
#include "application/gui/mdi/mdidockablewindow.h" #include "application/gui/mdi/mdidockablewindow.h"
#include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/simplejobprocessor.h" #include "core/tools/simplejobprocessor.h"
#include "core/tools/stringutils.h" #include "core/tools/stringutils.h"
#include "core/tools/quadrenderer.h" #include "core/tools/quadrenderer.h"
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include "core/datastructures/renderdata.h" #include "core/datastructures/renderdata.h"
#include "core/datastructures/imagerepresentationgl.h" #include "core/datastructures/imagerepresentationgl.h"
#include "core/pipeline/abstractpipeline.h" #include "core/pipeline/abstractpipeline.h"
#include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/quadrenderer.h" #include "core/tools/quadrenderer.h"
namespace campvis { namespace campvis {
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "core/datastructures/imagerepresentationgl.h" #include "core/datastructures/imagerepresentationgl.h"
#include "core/datastructures/facegeometry.h" #include "core/datastructures/facegeometry.h"
#include "core/datastructures/geometrydatafactory.h" #include "core/datastructures/geometrydatafactory.h"
#include "core/tools/job.h"
#include "core/classification/tfgeometry1d.h" #include "core/classification/tfgeometry1d.h"
#include "core/classification/geometry1dtransferfunction.h" #include "core/classification/geometry1dtransferfunction.h"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "core/properties/numericproperty.h" #include "core/properties/numericproperty.h"
#include "core/properties/propertycollection.h" #include "core/properties/propertycollection.h"
#include "core/properties/transferfunctionproperty.h" #include "core/properties/transferfunctionproperty.h"
#include "core/tools/opengljobprocessor.h"
#include "core/eventhandlers/trackballnavigationeventlistener.h" #include "core/eventhandlers/trackballnavigationeventlistener.h"
#include "modules/base/processors/lightsourceprovider.h" #include "modules/base/processors/lightsourceprovider.h"
......
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
#include <IL/ilu.h> #include <IL/ilu.h>
#endif #endif
#include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h"
#include "core/datastructures/abstractdata.h" #include "core/datastructures/abstractdata.h"
#include "core/datastructures/datacontainer.h" #include "core/datastructures/datacontainer.h"
#include "core/datastructures/facegeometry.h" #include "core/datastructures/facegeometry.h"
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "application/gui/qtdatahandle.h" #include "application/gui/qtdatahandle.h"
#include "application/gui/datacontainerinspectorcanvas.h" #include "application/gui/datacontainerinspectorcanvas.h"
#include "application/gui/properties/propertycollectionwidget.h" #include "application/gui/properties/propertycollectionwidget.h"
#include "core/tools/opengljobprocessor.h"
#include <QLabel> #include <QLabel>
#include <QWidget> #include <QWidget>
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "core/classification/tfgeometry1d.h" #include "core/classification/tfgeometry1d.h"
#include "core/datastructures/imagerepresentationlocal.h" #include "core/datastructures/imagerepresentationlocal.h"
#include "core/properties/transferfunctionproperty.h" #include "core/properties/transferfunctionproperty.h"
#include "core/tools/opengljobprocessor.h"
#include <QCheckBox> #include <QCheckBox>
#include <QGridLayout> #include <QGridLayout>
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "core/classification/tfgeometry2d.h" #include "core/classification/tfgeometry2d.h"
#include "core/datastructures/imagerepresentationlocal.h" #include "core/datastructures/imagerepresentationlocal.h"
#include "core/properties/transferfunctionproperty.h" #include "core/properties/transferfunctionproperty.h"
#include "core/tools/opengljobprocessor.h"
#include <QGridLayout> #include <QGridLayout>
#include <QLabel> #include <QLabel>
......
...@@ -28,7 +28,7 @@ namespace campvis { ...@@ -28,7 +28,7 @@ namespace campvis {
QtJobProcessor::QtJobProcessor() QtJobProcessor::QtJobProcessor()
: QWidget() : QWidget()
{ {
connect(this, SIGNAL(newJobSignal(AbstractJob *)), this, SLOT(onJobArrived(AbstractJob *))); connect(this, SIGNAL(newJobSignal(tgt::AbstractJob*)), this, SLOT(onJobArrived(tgt::AbstractJob*)));
} }
QtJobProcessor::~QtJobProcessor() QtJobProcessor::~QtJobProcessor()
...@@ -36,16 +36,16 @@ namespace campvis { ...@@ -36,16 +36,16 @@ namespace campvis {
} }
void QtJobProcessor::enqueueJob(AbstractJob * job) { void QtJobProcessor::enqueueJob(tgt::AbstractJob* job) {
emit newJobSignal(job); emit newJobSignal(job);
} }
void QtJobProcessor::enqueueJob(std::function<void(void)> fn) void QtJobProcessor::enqueueJob(std::function<void(void)> fn)
{ {
emit newJobSignal(makeJobOnHeap(fn)); emit newJobSignal(tgt::makeJobOnHeap(fn));
} }
void QtJobProcessor::onJobArrived(AbstractJob * job) void QtJobProcessor::onJobArrived(tgt::AbstractJob* job)
{ {
tgtAssert(job, "Job must not be null!"); tgtAssert(job, "Job must not be null!");
......
...@@ -25,14 +25,13 @@ ...@@ -25,14 +25,13 @@
#ifndef QTJOBPROCESSOR_H__ #ifndef QTJOBPROCESSOR_H__
#define QTJOBPROCESSOR_H__ #define QTJOBPROCESSOR_H__
#include "core/tools/job.h" #include "tgt/job.h"
#include "tgt/singleton.h" #include "tgt/singleton.h"
#include <QWidget> #include <QWidget>
#include <functional> #include <functional>
namespace campvis { namespace campvis {
/** /**
* This job processor singleton can be used to execute jobs (asynchronously) from inside the Qt GUI thread. * This job processor singleton can be used to execute jobs (asynchronously) from inside the Qt GUI thread.
* This can result in simpler and better understandable code when only a few lines of code need * This can result in simpler and better understandable code when only a few lines of code need
...@@ -58,18 +57,18 @@ namespace campvis { ...@@ -58,18 +57,18 @@ namespace campvis {
/** /**
Enqueues a new job to be processed by the job processor Enqueues a new job to be processed by the job processor
*/ */
void enqueueJob(AbstractJob * job); void enqueueJob(tgt::AbstractJob* job);
/** /**
Convenience function to simplify the code, removing the necessity for a makeJobOnHeap() call Convenience function to simplify the code, removing the necessity for a makeJobOnHeap() call
*/ */
void enqueueJob(std::function<void(void)> fn); void enqueueJob(std::function<void(void)> fn);
signals: signals:
void newJobSignal(AbstractJob * job); void newJobSignal(tgt::AbstractJob* job);
private slots: private slots:
void onJobArrived(AbstractJob * job); void onJobArrived(tgt::AbstractJob* job);
}; };
} }
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "tgt/glcontextmanager.h" #include "tgt/glcontextmanager.h"
#include "tgt/vertexarrayobject.h" #include "tgt/vertexarrayobject.h"
#include "core/tools/opengljobprocessor.h"
namespace campvis { namespace campvis {
const std::string GeometryData::loggerCat_ = "CAMPVis.core.datastructures.GeometryData";; const std::string GeometryData::loggerCat_ = "CAMPVis.core.datastructures.GeometryData";;
......
...@@ -26,10 +26,6 @@ ...@@ -26,10 +26,6 @@
#include "tgt/assert.h" #include "tgt/assert.h"
#include "tgt/logmanager.h" #include "tgt/logmanager.h"
#include "tgt/glcontextmanager.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/job.h"
namespace campvis { namespace campvis {
...@@ -46,7 +42,7 @@ namespace campvis { ...@@ -46,7 +42,7 @@ namespace campvis {
return nullptr; return nullptr;
} }
OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard; tgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard;
ImageRepresentationGL* toReturn = ImageRepresentationGL::create(const_cast<ImageData*>(tester->getParent()), wtp); ImageRepresentationGL* toReturn = ImageRepresentationGL::create(const_cast<ImageData*>(tester->getParent()), wtp);
switch (wtp._baseType) { switch (wtp._baseType) {
...@@ -79,7 +75,7 @@ namespace campvis { ...@@ -79,7 +75,7 @@ namespace campvis {
return toReturn; return toReturn;
} }
else if (const ImageRepresentationLocal* tester = dynamic_cast<const ImageRepresentationLocal*>(source)) { else if (const ImageRepresentationLocal* tester = dynamic_cast<const ImageRepresentationLocal*>(source)) {
OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard; tgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard;
ImageRepresentationGL* toReturn = ImageRepresentationGL::create(const_cast<ImageData*>(tester->getParent()), tester->getWeaklyTypedPointer()); ImageRepresentationGL* toReturn = ImageRepresentationGL::create(const_cast<ImageData*>(tester->getParent()), tester->getWeaklyTypedPointer());
return toReturn; return toReturn;
} }
...@@ -97,7 +93,7 @@ namespace campvis { ...@@ -97,7 +93,7 @@ namespace campvis {
return ImageRepresentationLocal::create(tester->getParent(), tester->getImageData()); return ImageRepresentationLocal::create(tester->getParent(), tester->getImageData());
} }
else if (const ImageRepresentationGL* tester = dynamic_cast<const ImageRepresentationGL*>(source)) { else if (const ImageRepresentationGL* tester = dynamic_cast<const ImageRepresentationGL*>(source)) {
OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard; tgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard;
WeaklyTypedPointer wtp = tester->getWeaklyTypedPointerCopy(); WeaklyTypedPointer wtp = tester->getWeaklyTypedPointerCopy();
if (wtp._pointer != nullptr) if (wtp._pointer != nullptr)
return ImageRepresentationLocal::create(source->getParent(), wtp); return ImageRepresentationLocal::create(source->getParent(), wtp);
......
...@@ -25,8 +25,9 @@ ...@@ -25,8 +25,9 @@
#ifndef IMAGEREPRESENTATIONCONVERSIONCORE_H__ #ifndef IMAGEREPRESENTATIONCONVERSIONCORE_H__
#define IMAGEREPRESENTATIONCONVERSIONCORE_H__ #define IMAGEREPRESENTATIONCONVERSIONCORE_H__
#include "tgt/opengljobprocessor.h"
#include "core/coreapi.h" #include "core/coreapi.h"
#include "core/tools/opengljobprocessor.h"
#include "core/datastructures/imagerepresentationconverter.h" #include "core/datastructures/imagerepresentationconverter.h"
#include "core/datastructures/imagerepresentationdisk.h" #include "core/datastructures/imagerepresentationdisk.h"
...@@ -95,7 +96,7 @@ namespace campvis { ...@@ -95,7 +96,7 @@ namespace campvis {
else if (const ImageRepresentationGL* tester = dynamic_cast<const ImageRepresentationGL*>(source)) { else if (const ImageRepresentationGL* tester = dynamic_cast<const ImageRepresentationGL*>(source)) {
// converting from GL representation // converting from GL representation
OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard; tgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard;
if (tester->getTexture()->getDataType() != TypeTraits<BASETYPE, NUMCHANNELS>::glDataType) if (tester->getTexture()->getDataType() != TypeTraits<BASETYPE, NUMCHANNELS>::glDataType)
LDEBUGC("CAMPVis.core.datastructures.GenericLocalConversion", "Performing conversion between data types, you may lose information or the resulting data may show other unexpected features."); LDEBUGC("CAMPVis.core.datastructures.GenericLocalConversion", "Performing conversion between data types, you may lose information or the resulting data may show other unexpected features.");
......
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
#include "core/pipeline/visualizationprocessor.h" #include "core/pipeline/visualizationprocessor.h"
#include "core/pipeline/abstractprocessor.h" #include "core/pipeline/abstractprocessor.h"
#include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/simplejobprocessor.h"
#ifdef CAMPVIS_DEBUG #ifdef CAMPVIS_DEBUG
......
...@@ -22,16 +22,12 @@ ...@@ -22,16 +22,12 @@
// //
// ================================================================================================ // ================================================================================================
#include "abstractprocessor.h"
#include "tgt/assert.h" #include "tgt/assert.h"
#include "core/properties/abstractproperty.h"
#include <ext/threading.h> #include <ext/threading.h>
#include "abstractprocessor.h"
#include "core/properties/abstractproperty.h"
#include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/simplejobprocessor.h"
namespace campvis { namespace campvis {
const std::string AbstractProcessor::loggerCat_ = "CAMPVis.core.datastructures.Processor"; const std::string AbstractProcessor::loggerCat_ = "CAMPVis.core.datastructures.Processor";
......
...@@ -23,15 +23,13 @@ ...@@ -23,15 +23,13 @@
// ================================================================================================ // ================================================================================================
#include "autoevaluationpipeline.h" #include "autoevaluationpipeline.h"
#include "tgt/tgt_gl.h" #include "tgt/tgt_gl.h"
#include "tgt/glcanvas.h" #include "tgt/glcanvas.h"
#include "core/pipeline/visualizationprocessor.h" #include "core/pipeline/visualizationprocessor.h"
#include "core/properties/datanameproperty.h" #include "core/properties/datanameproperty.h"
#include "core/properties/metaproperty.h" #include "core/properties/metaproperty.h"
#include "core/tools/job.h"
#include "core/tools/opengljobprocessor.h"
#include "core/tools/simplejobprocessor.h"
namespace campvis { namespace campvis {
const std::string AutoEvaluationPipeline::loggerCat_ = "CAMPVis.core.datastructures.AutoEvaluationPipeline"; const std::string AutoEvaluationPipeline::loggerCat_ = "CAMPVis.core.datastructures.AutoEvaluationPipeline";
......
...@@ -40,8 +40,10 @@ SET(TGT_SOURCES ...@@ -40,8 +40,10 @@ SET(TGT_SOURCES
init.cpp init.cpp
light.cpp light.cpp
logmanager.cpp logmanager.cpp
job.cpp
naturalcubicspline.cpp naturalcubicspline.cpp
openglgarbagecollector.cpp openglgarbagecollector.cpp
opengljobprocessor.cpp
painter.cpp painter.cpp
runnable.cpp runnable.cpp
shadermanager.cpp shadermanager.cpp
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
#include <memory> #include <memory>
#include <new> #include <new>
#include "core/tools/opengljobprocessor.h" #include "tgt/opengljobprocessor.h"
namespace campvis { namespace tgt {
// Implementation inspired by http://stackoverflow.com/questions/7194127/how-should-i-write-iso-c-standard-conformant-custom-new-and-delete-operators/7194149#7194149 // Implementation inspired by http://stackoverflow.com/questions/7194127/how-should-i-write-iso-c-standard-conformant-custom-new-and-delete-operators/7194149#7194149
void* AbstractJob::operator new(std::size_t size) throw(std::bad_alloc) { void* AbstractJob::operator new(std::size_t size) throw(std::bad_alloc) {
......
...@@ -26,17 +26,16 @@ ...@@ -26,17 +26,16 @@
#define JOB_H__ #define JOB_H__
#include "tgt/assert.h" #include "tgt/assert.h"
#include "tgt/types.h"
#include "core/coreapi.h"
#include <functional> #include <functional>
namespace campvis { namespace tgt {
/** /**
* Abstract base class for a job that can be executed. * Abstract base class for a job that can be executed.
*/ */
class CAMPVIS_CORE_API AbstractJob { class TGT_API AbstractJob {
public: public:
/** /**
* Pure virtual destructor. * Pure virtual destructor.
...@@ -48,6 +47,9 @@ namespace campvis { ...@@ -48,6 +47,9 @@ namespace campvis {
*/ */
virtual void execute() = 0; virtual void execute() = 0;
/**
* Executes the job, calls execute().
*/
void operator()() { void operator()() {
this->execute(); this->execute();
} }
...@@ -264,7 +266,7 @@ namespace campvis { ...@@ -264,7 +266,7 @@ namespace campvis {
/** /**
* specific job that evaluates a function object * specific job that evaluates a function object
*/ */
class CAMPVIS_CORE_API CallFunctionObjectJob : public AbstractJob{ class TGT_API CallFunctionObjectJob : public AbstractJob {
public: public:
CallFunctionObjectJob(std::function<void(void)> fn) CallFunctionObjectJob(std::function<void(void)> fn)
: _fn(fn) : _fn(fn)
......
...@@ -30,9 +30,8 @@ ...@@ -30,9 +30,8 @@
#include "tgt/logmanager.h" #include "tgt/logmanager.h"
#include "tgt/openglgarbagecollector.h" #include "tgt/openglgarbagecollector.h"
#include "tgt/glcontextmanager.h" #include "tgt/glcontextmanager.h"
#include "core/tools/job.h"
namespace campvis { namespace tgt {
OpenGLJobProcessor::ScopedSynchronousGlJobExecution::ScopedSynchronousGlJobExecution() OpenGLJobProcessor::ScopedSynchronousGlJobExecution::ScopedSynchronousGlJobExecution()
: _lock(nullptr) : _lock(nullptr)
......
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