Carna  Version 3.0.1
RenderTask.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 RENDERTASK_H_6014714286
13 #define RENDERTASK_H_6014714286
14 
15 #include <Carna/Carna.h>
16 #include <Carna/base/math.h>
17 
22 namespace Carna
23 {
24 
25 namespace base
26 {
27 
28 
29 
30 // ----------------------------------------------------------------------------------
31 // RenderTask
32 // ----------------------------------------------------------------------------------
33 
40 class CARNA_LIB RenderTask
41 {
42 
43  Framebuffer* myOutput;
44 
45  std::size_t nextRenderStage;
46 
47  math::Matrix4f myViewTransform;
48 
49 public:
50 
54  RenderTask( const FrameRenderer& renderer, const math::Matrix4f& projection, const math::Matrix4f& viewTransform );
55 
58  RenderTask( const FrameRenderer& renderer, const math::Matrix4f& projection, const math::Matrix4f& viewTransform, Framebuffer& output );
59 
63  RenderTask( const RenderTask& parent, Framebuffer& output );
64 
68  explicit RenderTask( const RenderTask& parent );
69 
74 
79 
83  const math::Matrix4f& viewTransform() const;
84 
88  void overrideViewTransform( const math::Matrix4f& );
89 
94  void render( const Viewport& vp, unsigned int clearBuffersMask = 0 );
95 
99  void finish();
100 
101 protected:
102 
106  virtual void renderStage( RenderStage& rs, const Viewport& viewport );
107 
108 }; // RenderTask
109 
110 
111 
112 } // namespace Carna :: base
113 
114 } // namespace Carna
115 
116 #endif // RENDERTASK_H_6014714286
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
const FrameRenderer & renderer
References the frame renderer.
Definition: RenderTask.h:73
const math::Matrix4f & projection
References the projection matrix to be used.
Definition: RenderTask.h:78
Defines logic for rendering frames from given scenes.
Definition: FrameRenderer.h:69
Invokes the rendering stages of the frame renderer successively.
Definition: RenderTask.h:40
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition: math.h:193
Base abstract class of each rendering stage. Refer to the documentation of the rendering process...
Definition: RenderStage.h:42
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition: Viewport.h:48
Maintains a framebuffer object that supports up to 8 color components simultaneously.
Definition: Framebuffer.h:49