The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated 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

visualizationpipeline.cpp 2.13 KB
Newer Older
1
#include "visualizationpipeline.h"
schultezub's avatar
schultezub committed
2
#include "tgt/camera.h"
schultezub's avatar
schultezub committed
3
#include "tgt/quadrenderer.h"
schultezub's avatar
schultezub committed
4
5
#include "tgt/quadric.h"
#include "core/datastructures/imagedatarendertarget.h"
6
7
8
9

namespace TUMVis {
    const std::string VisualizationPipeline::loggerCat_ = "TUMVis.core.datastructures.VisualizationPipeline";

schultezub's avatar
schultezub committed
10
    VisualizationPipeline::VisualizationPipeline() 
schultezub's avatar
schultezub committed
11
        : AbstractPipeline()
schultezub's avatar
schultezub committed
12
13
        , tgt::EventListener()
        , _renderTargetSize("canvasSize", "Canvas Size", tgt::ivec2(128, 128))
schultezub's avatar
schultezub committed
14
        , _renderTargetID("renderTargetID", "Render Target ID", "VisualizationPipeline.renderTarget")
15
    {
schultezub's avatar
schultezub committed
16
        _data.s_dataAdded.connect(this, &VisualizationPipeline::onDataContainerDataAdded);
17
18
19
    }

    VisualizationPipeline::~VisualizationPipeline() {
schultezub's avatar
schultezub committed
20
        _data.s_dataAdded.disconnect(this);
21
22
23
24
    }

    void VisualizationPipeline::onEvent(tgt::Event* e) {
        // cycle through event handlers, ask each one if it handles the event and if so, execute it.
schultezub's avatar
schultezub committed
25
        for (std::vector<AbstractEventHandler*>::iterator it = _eventHandlers.begin(); it != _eventHandlers.end() && e->isAccepted(); ++it) {
26
27
28
29
            if ((*it)->accept(e)) {
                (*it)->execute(e);
            }
        }
schultezub's avatar
schultezub committed
30
31
32
33

        if (e->isAccepted()) {
            EventListener::onEvent(e);
        }
34
35
36
37
38
39
40
41
42
43
    }

    PropertyCollection& VisualizationPipeline::getPropertyCollection() {
        return _properties;
    }

    void VisualizationPipeline::init() {
        AbstractPipeline::init();
    }

schultezub's avatar
schultezub committed
44
45
46
    const tgt::ivec2& VisualizationPipeline::getRenderTargetSize() const {
        return _renderTargetSize.getValue();
    }
schultezub's avatar
schultezub committed
47

schultezub's avatar
schultezub committed
48
49
50
    void VisualizationPipeline::onDataContainerDataAdded(const std::string& name, const DataHandle* dh) {
        if (name == _renderTargetID.getValue()) {
            s_renderTargetChanged();
schultezub's avatar
schultezub committed
51
        }
52
53
    }

schultezub's avatar
schultezub committed
54
55
    const ImageDataRenderTarget* VisualizationPipeline::getRenderTarget() const {
        return _data.getTypedData<ImageDataRenderTarget>(_renderTargetID.getValue());
56
57
    }

schultezub's avatar
schultezub committed
58
59
    void VisualizationPipeline::setRenderTargetSize(const tgt::ivec2& size) {
        _renderTargetSize.setValue(size);
schultezub's avatar
schultezub committed
60
61
    }

62
}