From 77d25d1f65b949db80c0bbc2b12674156c3e637a Mon Sep 17 00:00:00 2001 From: Leonid Kostrykin Date: Mon, 14 Jun 2021 20:59:55 +0200 Subject: [PATCH] several changes Makes `MaskRenderingStage` render directly to output framebuffer if `renderBorders` is not set (produces depth-consistent renderings). Also renamed `roleMask` to `maskRole` which more consistent with other role-related attributes. --- docs/html/MaskRenderingStage_8h_source.html | 6 +- ...presets_1_1MaskRenderingStage-members.html | 26 +++--- ...arna_1_1presets_1_1MaskRenderingStage.html | 28 +++--- docs/html/functions_func_m.html | 2 +- docs/html/functions_m.html | 5 +- docs/html/functions_r.html | 3 - docs/html/functions_vars_m.html | 3 + docs/html/functions_vars_r.html | 3 - docs/html/search/all_10.js | 1 - docs/html/search/all_b.js | 3 +- docs/html/search/functions_a.js | 2 +- docs/html/search/variables_9.js | 1 + docs/html/search/variables_d.js | 1 - include/Carna/presets/MaskRenderingStage.h | 10 +- src/presets/MaskRenderingStage.cpp | 93 ++++++++++--------- .../MaskRenderingStageIntegrationTest.cpp | 8 +- test/ModuleTests/MaskRenderingStageTest.cpp | 4 +- 17 files changed, 101 insertions(+), 98 deletions(-) diff --git a/docs/html/MaskRenderingStage_8h_source.html b/docs/html/MaskRenderingStage_8h_source.html index 31848913..ae246b43 100644 --- a/docs/html/MaskRenderingStage_8h_source.html +++ b/docs/html/MaskRenderingStage_8h_source.html @@ -74,21 +74,21 @@
MaskRenderingStage.h
-Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Leonid Kostrykin
3  *
4  */
5 
6 #ifndef MASKRENDERINGSTAGE_H_6014714286
7 #define MASKRENDERINGSTAGE_H_6014714286
8 
10 #include <Carna/Carna.h>
11 #include <memory>
12 
17 namespace Carna
18 {
19 
20 namespace presets
21 {
22 
23 
24 
25 // ----------------------------------------------------------------------------------
26 // MaskRenderingStage
27 // ----------------------------------------------------------------------------------
28 
59 class CARNA_LIB MaskRenderingStage : public VolumeRenderingStage
60 {
61 
62  struct Details;
63  const std::unique_ptr< Details > pimpl;
64 
65 public:
66 
67  const static base::Color DEFAULT_COLOR;
68  const static unsigned int DEFAULT_ROLE_MASK;
69 
74  const unsigned int roleMask;
75 
83  explicit MaskRenderingStage( unsigned int geometryType, unsigned int roleMask = DEFAULT_ROLE_MASK );
84 
88  virtual ~MaskRenderingStage();
89 
90  MaskRenderingStage* clone() const override;
91 
92  virtual void reshape( base::FrameRenderer& fr, unsigned int width, unsigned int height ) override;
93 
97  virtual void renderPass
98  ( const base::math::Matrix4f& viewTransform
99  , base::RenderTask& rt
100  , const base::Viewport& vp ) override;
101 
105  const base::Color& color() const;
106 
110  void setColor( const base::Color& color );
111 
115  bool renderBorders() const;
116 
120  void setRenderBorders( bool borders );
121 
122 protected:
123 
124  virtual unsigned int loadVideoResources() override;
125 
126  virtual void createVolumeSamplers( const std::function< void( unsigned int, base::Sampler* ) >& registerSampler ) override;
127 
131  virtual const base::ShaderProgram& acquireShader() override;
132 
136  virtual const std::string& uniformName( unsigned int role ) const override;
137 
141  virtual void configureShader() override;
142 
146  virtual void configureShader( const base::Renderable& ) override;
147 
148 }; // DRRStage
149 
150 
151 
152 } // namespace Carna :: presets
153 
154 } // namespace Carna
155 
156 #endif // MASKRENDERINGSTAGE_H_6014714286
Defines logic for rendering frames from given scenes.
Definition: FrameRenderer.h:69
+Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Leonid Kostrykin
3  *
4  */
5 
6 #ifndef MASKRENDERINGSTAGE_H_6014714286
7 #define MASKRENDERINGSTAGE_H_6014714286
8 
10 #include <Carna/Carna.h>
11 #include <memory>
12 
17 namespace Carna
18 {
19 
20 namespace presets
21 {
22 
23 
24 
25 // ----------------------------------------------------------------------------------
26 // MaskRenderingStage
27 // ----------------------------------------------------------------------------------
28 
59 class CARNA_LIB MaskRenderingStage : public VolumeRenderingStage
60 {
61 
62  struct Details;
63  const std::unique_ptr< Details > pimpl;
64 
65 public:
66 
67  const static base::Color DEFAULT_COLOR;
68  const static unsigned int DEFAULT_ROLE_MASK;
69 
74  const unsigned int maskRole;
75 
83  explicit MaskRenderingStage( unsigned int geometryType, unsigned int maskRole = DEFAULT_ROLE_MASK );
84 
88  virtual ~MaskRenderingStage();
89 
90  MaskRenderingStage* clone() const override;
91 
92  virtual void reshape( base::FrameRenderer& fr, unsigned int width, unsigned int height ) override;
93 
97  virtual void renderPass
98  ( const base::math::Matrix4f& viewTransform
99  , base::RenderTask& rt
100  , const base::Viewport& vp ) override;
101 
105  const base::Color& color() const;
106 
110  void setColor( const base::Color& color );
111 
115  bool renderBorders() const;
116 
120  void setRenderBorders( bool borders );
121 
122 protected:
123 
124  virtual unsigned int loadVideoResources() override;
125 
126  virtual void createVolumeSamplers( const std::function< void( unsigned int, base::Sampler* ) >& registerSampler ) override;
127 
131  virtual const base::ShaderProgram& acquireShader() override;
132 
136  virtual const std::string& uniformName( unsigned int role ) const override;
137 
141  virtual void configureShader() override;
142 
146  virtual void configureShader( const base::Renderable& ) override;
147 
148 }; // DRRStage
149 
150 
151 
152 } // namespace Carna :: presets
153 
154 } // namespace Carna
155 
156 #endif // MASKRENDERINGSTAGE_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
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...
-
const unsigned int roleMask
Holds the role that mask volume data is expected to take when attached to base::Geometry nodes...
Represents a color. Objects from this class are copyable and assignable.
Definition: Color.h:41
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition: math.h:193
static const base::Color DEFAULT_COLOR
Holds the default rendering color.
+
const unsigned int maskRole
Holds the role that mask volume data is expected to take when attached to base::Geometry nodes...
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.
-
static const unsigned int DEFAULT_ROLE_MASK
Holds the default value of roleMask.
+
static const unsigned int DEFAULT_ROLE_MASK
Holds the default value of maskRole.