Carna  Version 3.3.2
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 <Carna/base/HUV.h>
18 #include <memory>
19 
24 namespace Carna
25 {
26 
27 namespace presets
28 {
29 
30 
31 
32 // ----------------------------------------------------------------------------------
33 // DRRStage
34 // ----------------------------------------------------------------------------------
35 
106 class CARNA_LIB DRRStage : public VolumeRenderingStage
107 {
108 
109  struct Details;
110  const std::unique_ptr< Details > pimpl;
111 
112 public:
113 
114  const static float DEFAULT_WATER_ATTENUATION;
115  const static float DEFAULT_BASE_INTENSITY;
118  const static float DEFAULT_UPPER_MULTIPLIER;
119  const static bool DEFAULT_RENDER_INVERSE;
120 
125  const static unsigned int ROLE_INTENSITIES = 0;
126 
131  explicit DRRStage( unsigned int geometryType );
132 
136  virtual ~DRRStage();
137 
138  DRRStage* clone() const override;
139 
140  virtual void reshape( base::FrameRenderer& fr, unsigned int width, unsigned int height ) override;
141 
146  virtual void renderPass
147  ( const base::math::Matrix4f& viewTransform
148  , base::RenderTask& rt
149  , const base::Viewport& vp ) override;
150 
155  float waterAttenuation() const;
156 
160  float baseIntensity() const;
161 
166  base::HUV lowerThreshold() const;
167 
172  base::HUV upperThreshold() const;
173 
178  float upperMultiplier() const;
179 
184  bool isRenderingInverse() const;
185 
190  void setWaterAttenuation( float muWater );
191 
196  void setBaseIntensity( float baseIntensity );
197 
202  void setLowerThreshold( base::HUV lower );
203 
208  void setUpperThreshold( base::HUV upper );
209 
214  void setUpperMultiplier( float multiplier );
215 
227  void setRenderingInverse( bool inverse );
228 
229 protected:
230 
231  virtual unsigned int loadVideoResources() override;
232 
233  virtual void createVolumeSamplers( const std::function< void( unsigned int, base::Sampler* ) >& registerSampler ) override;
234 
238  virtual const base::ShaderProgram& acquireShader() override;
239 
243  virtual const std::string& uniformName( unsigned int role ) const override;
244 
248  virtual void configureShader() override;
249 
253  virtual void configureShader( const base::Renderable& ) override;
254 
255 }; // DRRStage
256 
257 
258 
259 } // namespace Carna :: presets
260 
261 } // namespace Carna
262 
263 #endif // DRRSTAGE_H_6014714286
Renders digital radiograph reconstructs of volume geometries in the scene.
Definition: DRRStage.h:106
Defines Carna::base::HUV.
static const base::HUV DEFAULT_LOWER_THRESHOLD
Holds default value for .
Definition: DRRStage.h:116
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:114
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:117
Represents a Geometry object that has been queued into a RenderQueue. The object&#39;s model-view transfo...
Definition: Renderable.h:45
static const bool DEFAULT_RENDER_INVERSE
Holds default value for inverse rendering.
Definition: DRRStage.h:119
static const float DEFAULT_BASE_INTENSITY
Holds default value for .
Definition: DRRStage.h:115
Represents values in .
Definition: HUV.h:34
static const float DEFAULT_UPPER_MULTIPLIER
Holds default value for .
Definition: DRRStage.h:118
Defines Carna::presets::VolumeRenderingStage.