abstractpipeline.cpp 2 KB
Newer Older
1
#include "abstractpipeline.h"
schultezub's avatar
schultezub committed
2

schultezub's avatar
schultezub committed
3
#include "tgt/exception.h"
schultezub's avatar
schultezub committed
4
#include "core/pipeline/abstractprocessor.h"
5
6
7
8

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

9
    AbstractPipeline::AbstractPipeline() 
schultezub's avatar
   
schultezub committed
10
11
12
13
14
15
    {
    }

    AbstractPipeline::~AbstractPipeline() {
    }

16
17
    PropertyCollection& AbstractPipeline::getPropertyCollection() {
        return _properties;
18
19
    }

20
21
    void AbstractPipeline::init() {
        // initialize all processors:
schultezub's avatar
schultezub committed
22
23
24
25
26
27
28
29
         for (std::vector<AbstractProcessor*>::iterator it = _processors.begin(); it != _processors.end(); ++it) {
             try {
                 (*it)->init();
             }
             catch (tgt::Exception& e) {
                 LERROR("Caught Exception during initialization of processor: " << e.what());
             }
         }
30
    }
schultezub's avatar
schultezub committed
31

32
33
34
35
36
37
38
39
40
41
42
43
    void AbstractPipeline::deinit() {
        // deinitialize all processors:
        for (std::vector<AbstractProcessor*>::iterator it = _processors.begin(); it != _processors.end(); ++it) {
            try {
                (*it)->deinit();
            }
            catch (tgt::Exception& e) {
                LERROR("Caught Exception during deinitialization of processor: " << e.what());
            }
        }
    }

schultezub's avatar
schultezub committed
44
    void AbstractPipeline::onNotify(const ProcessorObserverArgs& poa) {
45
        _invalidationLevel.setLevel(InvalidationLevel::INVALID_RESULT);
46
        s_PipelineInvalidated();
schultezub's avatar
schultezub committed
47
48
49
50
51
52
    }

    const DataContainer& AbstractPipeline::getDataContainer() const {
        return _data;
    }

53
54
55
56
57
58
59
60
61
62
    void AbstractPipeline::executeProcessor(AbstractProcessor& processor) {
        processor.lockProperties();
        processor.process(_data);
        processor.unlockProperties();
    }

    InvalidationLevel& AbstractPipeline::getInvalidationLevel() {
        return _invalidationLevel;
    }

63
64
65
66
    const std::vector<AbstractProcessor*>& AbstractPipeline::getProcessors() const {
        return _processors;
    }

67
}