abstractpipeline.cpp 1.17 KB
Newer Older
1
2
3
4
5
#include "abstractpipeline.h"

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

schultezub's avatar
   
schultezub committed
6
7
8
9
10
11
12
13
    AbstractPipeline::AbstractPipeline(tgt::GLCanvas* canvas /*= 0*/) 
        : _canvas(canvas)
    {
    }

    AbstractPipeline::~AbstractPipeline() {
    }

14
15
16
17
18
19
20
21
22
23
    void AbstractPipeline::onEvent(tgt::Event* e) {
        // cycle through event handlers, ask each one if it handles the event and if so, execute it.
        for (std::vector<AbstractEventHandler*>::iterator it = _eventHandlers.begin(); it != _eventHandlers.end() && !e->isAccepted(); ++it) {
            if ((*it)->accept(e)) {
                (*it)->execute(e);
            }
        }
    }

    void AbstractPipeline::setCanvas(tgt::GLCanvas* canvas) {
24
25
26
        if (_canvas != 0 && _canvas->getEventHandler() != 0) {
            _canvas->getEventHandler()->removeListener(this);
        }
27
        _canvas = canvas;
28
29
30
        if (_canvas->getEventHandler() != 0) {
            _canvas->getEventHandler()->addListenerToFront(this);
        }
31
    }
schultezub's avatar
schultezub committed
32
33
34
35

    PropertyCollection& AbstractPipeline::getPropertyCollection() {
        return _properties;
    }
36
}