Carna  Version 3.3.2
MIPStage.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 MIPSTAGE_H_6014714286
13 #define MIPSTAGE_H_6014714286
14 
16 #include <Carna/Carna.h>
17 #include <memory>
18 
23 namespace Carna
24 {
25 
26 namespace presets
27 {
28 
29 
30 
31 // ----------------------------------------------------------------------------------
32 // MIPStage
33 // ----------------------------------------------------------------------------------
34 
64 class CARNA_LIB MIPStage : public VolumeRenderingStage
65 {
66 
67  struct Details;
68  const std::unique_ptr< Details > pimpl;
69 
70 public:
71 
76  const static unsigned int ROLE_INTENSITIES = 0;
77 
81  explicit MIPStage( unsigned int geometryType );
82 
86  virtual ~MIPStage();
87 
88  MIPStage* clone() const override;
89 
90  virtual void reshape( base::FrameRenderer& fr, unsigned int width, unsigned int height ) override;
91 
92  virtual void renderPass
93  ( const base::math::Matrix4f& viewTransform
94  , base::RenderTask& rt
95  , const base::Viewport& vp ) override;
96 
100  void ascendLayer( const MIPLayer& layer );
101 
105  void appendLayer( MIPLayer* layer );
106 
111  MIPLayer* removeLayer( const MIPLayer& layer );
112 
116  std::size_t layersCount() const;
117 
121  MIPLayer& layer( std::size_t layerIndex );
122 
125  const MIPLayer& layer( std::size_t layerIndex ) const;
126 
130  void clearLayers();
131 
132 protected:
133 
134  virtual void createVolumeSamplers( const std::function< void( unsigned int, base::Sampler* ) >& registerSampler ) override;
135 
136  virtual const base::ShaderProgram& acquireShader() override;
137 
138  virtual const std::string& uniformName( unsigned int role ) const override;
139 
140  virtual void configureShader() override;
141 
145  virtual void configureShader( const base::Renderable& ) override;
146 
147 }; // MIPStage
148 
149 
150 
151 } // namespace Carna :: presets
152 
153 } // namespace Carna
154 
155 #endif // MIPSTAGE_H_6014714286
Defines logic for rendering frames from given scenes.
Definition: FrameRenderer.h:69
Maintains an OpenGL shader program. Realizes the RAII-idiom.
Definition: ShaderProgram.h:47
Invokes the rendering stages of the frame renderer successively.
Definition: RenderTask.h:40
Renders maximum intensity projections of volume geometries in the scene.
Definition: MIPStage.h:64
Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.
Definition: Sampler.h:44
Defines abstract base class for rendering stages that render volume geometries in the scene...
Defines an intensity range and the way it is visualized by a maximum intensity projection.
Definition: MIPLayer.h:43
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition: math.h:193
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition: Viewport.h:48
Represents a Geometry object that has been queued into a RenderQueue. The object&#39;s model-view transfo...
Definition: Renderable.h:45
Defines Carna::presets::VolumeRenderingStage.