Carna  Version 3.0.1
DRRStage.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 DRRSTAGE_H_6014714286
13 #define DRRSTAGE_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 // DRRStage
33 // ----------------------------------------------------------------------------------
34 
105 class CARNA_LIB DRRStage : public VolumeRenderingStage
106 {
107 
108  struct Details;
109  const std::unique_ptr< Details > pimpl;
110 
111 public:
112 
113  const static float DEFAULT_WATER_ATTENUATION;
114  const static float DEFAULT_BASE_INTENSITY;
117  const static float DEFAULT_UPPER_MULTIPLIER;
118  const static bool DEFAULT_RENDER_INVERSE;
119 
124  const static unsigned int ROLE_HU_VOLUME = 0;
125 
130  DRRStage( unsigned int geometryType );
131 
135  virtual ~DRRStage();
136 
137  DRRStage* clone() const override;
138 
139  virtual void reshape( base::FrameRenderer& fr, unsigned int width, unsigned int height ) override;
140 
145  virtual void renderPass
146  ( const base::math::Matrix4f& viewTransform
147  , base::RenderTask& rt
148  , const base::Viewport& vp ) override;
149 
154  float waterAttenuation() const;
155 
159  float baseIntensity() const;
160 
165  base::HUV lowerThreshold() const;
166 
171  base::HUV upperThreshold() const;
172 
177  float upperMultiplier() const;
178 
183  bool isRenderingInverse() const;
184 
189  void setWaterAttenuation( float muWater );
190 
195  void setBaseIntensity( float baseIntensity );
196 
201  void setLowerThreshold( base::HUV lower );
202 
207  void setUpperThreshold( base::HUV upper );
208 
213  void setUpperMultiplier( float multiplier );
214 
226  void setRenderingInverse( bool inverse );
227 
228 protected:
229 
230  virtual unsigned int loadVideoResources() override;
231 
232  virtual void createVolumeSamplers( const std::function< void( unsigned int, base::Sampler* ) >& registerSampler ) override;
233 
237  virtual const base::ShaderProgram& acquireShader() override;
238 
242  virtual const std::string& uniformName( unsigned int role ) const override;
243 
247  virtual void configureShader() override;
248 
252  virtual void configureShader( const base::Renderable& ) override;
253 
254 }; // DRRStage
255 
256 
257 
258 } // namespace Carna :: presets
259 
260 } // namespace Carna
261 
262 #endif // DRRSTAGE_H_6014714286
Renders digital radiograph reconstructs of volume geometries in the scene.
Definition: DRRStage.h:105
static const base::HUV DEFAULT_LOWER_THRESHOLD
Holds default value for .
Definition: DRRStage.h:115
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
Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.
Definition: Sampler.h:44
static const float DEFAULT_WATER_ATTENUATION
Holds default value for .
Definition: DRRStage.h:113
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
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Definition: Viewport.h:48
static const base::HUV DEFAULT_UPPER_THRESHOLD
Holds default value for .
Definition: DRRStage.h:116
Represents a Geometry object that has been queued into a RenderQueue. The object's model-view transfo...
Definition: Renderable.h:45
static const bool DEFAULT_RENDER_INVERSE
Holds default value for inverse rendering.
Definition: DRRStage.h:118
signed short HUV
Represents values in .
Definition: Carna.h:56
static const float DEFAULT_BASE_INTENSITY
Holds default value for .
Definition: DRRStage.h:114
static const float DEFAULT_UPPER_MULTIPLIER
Holds default value for .
Definition: DRRStage.h:117
Defines Carna::presets::VolumeRenderingStage.