Carna Version 3.3.3
Loading...
Searching...
No Matches
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
23namespace Carna
24{
25
26namespace presets
27{
28
29
30
31// ----------------------------------------------------------------------------------
32// MIPStage
33// ----------------------------------------------------------------------------------
34
64class CARNA_LIB MIPStage : public VolumeRenderingStage
65{
66
67 struct Details;
68 const std::unique_ptr< Details > pimpl;
69
70public:
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
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
131
132protected:
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 Carna::presets::VolumeRenderingStage.
Defines logic for rendering frames from given scenes.
Invokes the rendering stages of the frame renderer successively.
Definition RenderTask.h:41
Represents a Geometry object that has been queued into a RenderQueue. The object's model-view transfo...
Definition Renderable.h:46
Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.
Definition Sampler.h:45
Maintains an OpenGL shader program. Realizes the RAII-idiom.
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition Viewport.h:49
Defines an intensity range and the way it is visualized by a maximum intensity projection.
Definition MIPLayer.h:44
Renders maximum intensity projections of volume geometries in the scene.
Definition MIPStage.h:65
const MIPLayer & layer(std::size_t layerIndex) const
MIPLayer * removeLayer(const MIPLayer &layer)
Removes layer from the layers list. The ownership is transferred to the caller.
void clearLayers()
Clears the layers list.
virtual ~MIPStage()
Deletes.
virtual void renderPass(const base::math::Matrix4f &viewTransform, base::RenderTask &rt, const base::Viewport &vp) override
Triggers the volume rendering.
std::size_t layersCount() const
Tells number of layers.
virtual const base::ShaderProgram & acquireShader() override
Acquires the shader from the base::ShaderManager, that is to be used for rendering the slices.
virtual const std::string & uniformName(unsigned int role) const override
Tells the name of the uniform variable, that the role texture is to be bound to. Use configureShader ...
virtual void configureShader() override
Performs custom shader configuration on a per-pass level.
MIPLayer & layer(std::size_t layerIndex)
References the layer with layerIndex.
virtual void configureShader(const base::Renderable &) override
Does nothing.
MIPStage(unsigned int geometryType)
Instantiates.
virtual void createVolumeSamplers(const std::function< void(unsigned int, base::Sampler *) > &registerSampler) override
Creates texture samplers for volume textures and uses registerSampler to assign them to the roles tha...
MIPStage * clone() const override
Returns same RenderStage implementation with same configuration.
virtual void reshape(base::FrameRenderer &fr, unsigned int width, unsigned int height) override
Orders this stage to reshape its buffers according to the specified dimensions.
void appendLayer(MIPLayer *layer)
Appends layer to the layers list and takes it's ownership.
void ascendLayer(const MIPLayer &layer)
Swaps positions of layer with it's successor in the layers list.
Defines abstract base class for rendering stages that render volume geometries in the scene.
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition math.h:193