Carna  Version 3.3.2
VolumeRenderingStage.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 VOLUMERENDERINGSTAGE_H_6014714286
13 #define VOLUMERENDERINGSTAGE_H_6014714286
14 
16 #include <Carna/base/Renderable.h>
17 #include <Carna/Carna.h>
18 #include <map>
19 
24 namespace Carna
25 {
26 
27 namespace presets
28 {
29 
30 
31 
32 // ----------------------------------------------------------------------------------
33 // VolumeRenderingStage
34 // ----------------------------------------------------------------------------------
35 
316 class CARNA_LIB VolumeRenderingStage : public base::GeometryStage< base::Renderable::BackToFront >
317 {
318 
319  struct Details;
320  const std::unique_ptr< Details > pimpl;
321 
322  struct VideoResources;
323  std::unique_ptr< VideoResources > vr;
324 
325 public:
326 
330  const static unsigned int DEFAULT_SAMPLE_RATE = 200;
331 
336  explicit VolumeRenderingStage( unsigned int geometryType );
337 
341  virtual ~VolumeRenderingStage();
342 
347  void setSampleRate( unsigned int sampleRate );
348 
353  unsigned int sampleRate() const;
354 
358  virtual void renderPass
359  ( const base::math::Matrix4f& viewTransform
360  , base::RenderTask& rt
361  , const base::Viewport& vp ) override;
362 
363 protected:
364 
373  virtual unsigned int loadVideoResources();
374 
375  virtual void render( const base::Renderable& ) override;
376 
381  virtual void createVolumeSamplers( const std::function< void( unsigned int, base::Sampler* ) >& registerSampler ) = 0;
382 
387  virtual const base::ShaderProgram& acquireShader() = 0;
388 
393  virtual const std::string& uniformName( unsigned int role ) const = 0;
394 
398  virtual void configureShader() = 0;
399 
403  virtual void configureShader( const base::Renderable& ) = 0;
404 
405 }; // VolumeRenderingStage
406 
407 
408 
409 } // namespace Carna :: presets
410 
411 } // namespace Carna
412 
413 #endif // VOLUMERENDERINGSTAGE_H_6014714286
Defines Carna::base::Renderable.
Defines Carna::base::GeometryStage.
Partially implements a rendering stage that uses at least one render queue for rendering geometry fro...
Definition: GeometryStage.h:59
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
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
Represents a Geometry object that has been queued into a RenderQueue. The object&#39;s model-view transfo...
Definition: Renderable.h:45