Carna Version 3.3.3
Loading...
Searching...
No Matches
RenderStageSequence.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef RENDERSTAGESEQUENCE_H_0874895466
13#define RENDERSTAGESEQUENCE_H_0874895466
14
15#include <Carna/Carna.h>
18#include <memory>
19
24namespace Carna
25{
26
27namespace base
28{
29
30
31
32// ----------------------------------------------------------------------------------
33// RenderStageSequence
34// ----------------------------------------------------------------------------------
35
42class CARNA_LIB RenderStageSequence
43{
44
46
47 struct Details;
48 const std::unique_ptr< Details > pimpl;
49
50public:
51
56
61
65 std::size_t stages() const;
66
71
75 virtual void clearStages();
76
80 RenderStage& stageAt( std::size_t position ) const;
81
87 template< typename RenderStage >
88 Aggregation< RenderStage > findStage() const;
89
90protected:
91
97
98}; // RenderStageSequence
99
100
101template< typename RenderStage >
103{
104 for( std::size_t index = 0; index < stages(); ++index )
105 {
106 RenderStage* const rs = dynamic_cast< RenderStage* >( &stageAt( index ) );
107 if( rs != nullptr )
108 {
110 }
111 }
113}
114
115
116
117} // namespace Carna :: base
118
119} // namespace Carna
120
121#endif // RENDERSTAGESEQUENCE_H_0874895466
Defines Carna::base::Aggregation.
Represents an aggregation, i.e. a weak reference.
Definition Aggregation.h:41
Represents an association.
Definition Association.h:45
Represents a rendering stages sequence.
void appendStage(RenderStage *stage)
Appends stage to the rendering stages sequence.
RenderStage & stageAt(std::size_t position) const
References the stage at position within the rendering stages sequence.
virtual ~RenderStageSequence()
Deletes all stages contained by the sequence.
void releaseStages()
Assumes that the ownership over all stages has been taken over by someone else. Clears the stages seq...
Aggregation< RenderStage > findStage() const
References the first RenderStage within the rendering stages sequence. This method performs a linear ...
std::size_t stages() const
Tells number of stages contained by the sequence.
virtual void clearStages()
Deletes all stages from the rendering stages sequence.
Base abstract class of each rendering stage. Refer to the documentation of the rendering process.
Definition RenderStage.h:43
#define NON_COPYABLE
Features class it is placed in as non-copyable.