abstractpipeline.h 2.59 KB
Newer Older
1
2
3
4
#ifndef ABSTRACTPIPELINE_H__
#define ABSTRACTPIPELINE_H__

#include "tgt/logmanager.h"
schultezub's avatar
schultezub committed
5
6
7
#include "tbb/include/tbb/spin_mutex.h"
#include "core/tools/observer.h"
#include "core/tools/invalidationlevel.h"
8
#include "core/datastructures/datacontainer.h"
9
#include "core/pipeline/abstractprocessor.h"
schultezub's avatar
schultezub committed
10
#include "core/properties/propertycollection.h"
11
12
13
14
15
16
17
18
19

#include <vector>

namespace TUMVis {

    /**
     * Abstract base class for TUMVis Pipelines.
     * 
     */
schultezub's avatar
schultezub committed
20
    class AbstractPipeline : public GenericObserver<ProcessorObserverArgs> {
21
22
23
24
    public:
        /**
         * Creates a AbstractPipeline.
         */
25
        AbstractPipeline();
26
27
28
29
30
31
32
33

        /**
         * Virtual Destructor
         **/
        virtual ~AbstractPipeline();


        /**
34
35
36
         * Initializes the OpenGL context of the pipeline and its processors.
         * 
         * \note    When overwriting this method, make sure to call the base class version first.
37
         */
38
        virtual void init();
39
40

        /**
41
42
43
         * Execute this pipeline.
         **/
        virtual void execute() = 0;
44

schultezub's avatar
schultezub committed
45
        /**
schultezub's avatar
schultezub committed
46
         * Returns the PropertyCollection of this pipeline.
schultezub's avatar
schultezub committed
47
48
49
50
         * \return _properties
         */
        PropertyCollection& getPropertyCollection();

schultezub's avatar
schultezub committed
51
52
53
54
55
56
57
58
59
60
61
62
63
64
        /**
         * Returns the DataContainer of this pipeline
         * \return _data
         */
        const DataContainer& getDataContainer() const;
        
        /**
         * Gets called when one of the observed processors changed and thus notifies its observers.
         * The default behaviour is just to set the invalidation level to invalid.
         * \sa GenericObserver::onNotify, AbstractProcessor
         * \param poa   ProcessorObserverArgs   ObserverArgument struct containing the emitting processor and its InvalidationLevel
         */
        virtual void onNotify(const ProcessorObserverArgs& poa);

65
66
67
    protected:
        DataContainer _data;                                ///< DataContainer containing local working set of data for this Pipeline

68
        std::vector<AbstractProcessor*> _processors;        ///< List of all processors of this pipeline
schultezub's avatar
   
schultezub committed
69
        PropertyCollection _properties;                     ///< PropertyCollection of this pipeline, put in here all properties you want to be publicly accessible
schultezub's avatar
schultezub committed
70
71
72
        InvalidationLevel _invalidationLevel;               ///< current invalidation level

        tbb::spin_mutex _localMutex;                        ///< mutex for altering local members
73
74
75
76
77
78
79
80

        static const std::string loggerCat_;
    };

}


#endif // ABSTRACTPIPELINE_H__