Carna Version 3.3.3
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Carna::base::GeometryStage< RenderableCompare > Class Template Referenceabstract

Partially implements a rendering stage that uses at least one render queue for rendering geometry from the scene graph. More...

#include <GeometryStage.h>

+ Inheritance diagram for Carna::base::GeometryStage< RenderableCompare >:
+ Collaboration diagram for Carna::base::GeometryStage< RenderableCompare >:

Public Member Functions

 GeometryStage (unsigned int geometryType, unsigned int geometryTypeMask=RenderQueue< RenderableCompare >::EXACT_MATCH_GEOMETRY_TYPE_MASK)
 Instantiates s.t. the predefined rendering queue enqueues such Carna::base::Geometry scene graph nodes, whose geometry type AND-linked with geometryTypeMask equals the geometryType specified here.
 
virtual ~GeometryStage ()
 Releases acquired video resources.
 
virtual void prepareFrame (Node &root) override
 Called once before each frame.
 
virtual void renderPass (const math::Matrix4f &viewTransform, RenderTask &rt, const Viewport &vp) override
 Called once per pass.
 
std::size_t renderedPassesCount () const
 Tells the number of passes rendered so far since the beginning of the current frame.
 
template<typename GeometryFeatureType >
GeometryFeatureType::ManagedInterface & videoResource (GeometryFeatureType &geometryFeature) const
 Interfaces the geometryFeature video resources that were acquired by this rendering stage.
 
template<typename GeometryFeatureType >
const GeometryFeatureType::ManagedInterface & videoResource (const GeometryFeatureType &geometryFeature) const
 
- Public Member Functions inherited from Carna::base::RenderStage
 RenderStage ()
 Instantiates in enabled-state.
 
virtual ~RenderStage ()
 Deletes.
 
virtual RenderStageclone () const =0
 Returns same RenderStage implementation with same configuration.
 
void setViewTransformFixed (bool viewTransformFixed)
 Sets whether the view transform is pass-invariant for the duration of a single frame.
 
bool isViewTransformFixed () const
 Tells whether the view transform is pass-invariant for the duration of a single frame.
 
virtual void reshape (FrameRenderer &fr, unsigned int width, unsigned int height)
 Orders this stage to reshape its buffers according to the specified dimensions.
 
bool isInitialized () const
 Tells whether this stage is ready for rendering.
 
bool isEnabled () const
 Tells whether this stage is enabled. Disabled stages are not rendered by render tasks.
 
void setEnabled (bool)
 Sets whether this stage is enabled. Disabled stages are not rendered by render tasks.
 
base::FrameRendererrenderer ()
 References the renderer this stage belongs to.
 
const base::FrameRendererrenderer () const
 
void addRenderStageListener (RenderStageListener &listener)
 Adds listener to the set of listeners this instance notifies in \(\mathcal O\left(\log n\right)\).
 
void removeRenderStageListener (RenderStageListener &listener)
 Removes listener from the set of listeners this instance notifies in \(\mathcal O\left(\log n\right)\).
 

Public Attributes

const unsigned int geometryType
 Renders such geometries whose type AND-linked with geometryTypeMask equals this.
 
const unsigned int geometryTypeMask
 Renders such geometries whose type AND-linked with this equals geometryType.
 

Protected Member Functions

void activateGLContext () const
 Ensures that the OpenGL context of the hosting Carna::base::FrameRenderer is the current one.
 
virtual void buildRenderQueues (Node &root, const math::Matrix4f &viewTransform)
 Builds the rendering queues of this stage.
 
virtual void rewindRenderQueues ()
 Rewinds the rendering queues of this stage.
 
virtual void updateRenderQueues (const math::Matrix4f &viewTransform)
 Recomputes the model-view transforms of the renderables enqueued by this stage.
 
virtual void render (const Renderable &renderable)=0
 Renders the renderable.
 

Protected Attributes

RenderQueue< RenderableComparerq
 Holds the predefined rendering queue of this rendering stage.
 

Detailed Description

template<typename RenderableCompare>
class Carna::base::GeometryStage< RenderableCompare >

Partially implements a rendering stage that uses at least one render queue for rendering geometry from the scene graph.

Parameters
RenderableCompareDefines partial order of renderables that is applied to the predefined rendering queue of this stage. Set this to void if no particular order is required.

Override updateRenderQueues and rewindRenderQueues if you require further rendering queues.

See also
Refer to the documentation of the rendering process for further notes on how rendering stages operate.
Author
Leonid Kostrykin
Date
21.2.15 - 6.3.15

Definition at line 59 of file GeometryStage.h.

Constructor & Destructor Documentation

◆ GeometryStage()

Carna::base::GeometryStage< RenderableCompare >::GeometryStage ( unsigned int  geometryType,
unsigned int  geometryTypeMask = RenderQueueRenderableCompare >::EXACT_MATCH_GEOMETRY_TYPE_MASK 
)

Instantiates s.t. the predefined rendering queue enqueues such Carna::base::Geometry scene graph nodes, whose geometry type AND-linked with geometryTypeMask equals the geometryType specified here.

Definition at line 152 of file GeometryStage.h.

◆ ~GeometryStage()

Releases acquired video resources.

Definition at line 163 of file GeometryStage.h.

Member Function Documentation

◆ activateGLContext()

void Carna::base::GeometryStage< RenderableCompare >::activateGLContext ( ) const
protected

Ensures that the OpenGL context of the hosting Carna::base::FrameRenderer is the current one.

Definition at line 179 of file GeometryStage.h.

◆ buildRenderQueues()

void Carna::base::GeometryStage< RenderableCompare >::buildRenderQueues ( Node root,
const math::Matrix4f viewTransform 
)
protectedvirtual

Builds the rendering queues of this stage.

Reimplemented in Carna::presets::CuttingPlanesStage.

Definition at line 205 of file GeometryStage.h.

◆ prepareFrame()

void Carna::base::GeometryStage< RenderableCompare >::prepareFrame ( Node root)
overridevirtual

Called once before each frame.

Reimplemented from Carna::base::RenderStage.

Definition at line 189 of file GeometryStage.h.

◆ render()

virtual void Carna::base::GeometryStage< RenderableCompare >::render ( const Renderable renderable)
protectedpure virtual

◆ renderedPassesCount()

std::size_t Carna::base::GeometryStage< RenderableCompare >::renderedPassesCount ( ) const

Tells the number of passes rendered so far since the beginning of the current frame.

Definition at line 198 of file GeometryStage.h.

◆ renderPass()

void Carna::base::GeometryStage< RenderableCompare >::renderPass ( const math::Matrix4f viewTransform,
RenderTask rt,
const Viewport vp 
)
overridevirtual

Called once per pass.

If this rendering stage maintains one or more Carna::base::RenderQueue objects, than this is the right place to build them. Note that the queues need to be rebuilt only once per frame and not per pass, unless isViewTransformFixed is false. If it is true and this is not the first invocation of this method since the last time prepareFrame was called, rewinding the queue will be sufficient.

Implements Carna::base::RenderStage.

Reimplemented in Carna::presets::CuttingPlanesStage, Carna::presets::DRRStage, Carna::presets::DVRStage, Carna::presets::MaskRenderingStage, Carna::presets::MeshColorCodingStage, Carna::presets::MIPStage, Carna::presets::TransparentRenderingStage, Carna::presets::VolumeRenderingStage, Carna::base::MeshRenderingStage< RenderableCompare >, and Carna::base::MeshRenderingStage< base::Renderable::BackToFront >.

Definition at line 226 of file GeometryStage.h.

◆ rewindRenderQueues()

void Carna::base::GeometryStage< RenderableCompare >::rewindRenderQueues ( )
protectedvirtual

Rewinds the rendering queues of this stage.

Reimplemented in Carna::presets::CuttingPlanesStage.

Definition at line 212 of file GeometryStage.h.

◆ updateRenderQueues()

void Carna::base::GeometryStage< RenderableCompare >::updateRenderQueues ( const math::Matrix4f viewTransform)
protectedvirtual

Recomputes the model-view transforms of the renderables enqueued by this stage.

Reimplemented in Carna::presets::CuttingPlanesStage.

Definition at line 219 of file GeometryStage.h.

◆ videoResource() [1/2]

const GeometryFeatureType::ManagedInterface & Carna::base::GeometryStage< RenderableCompare >::videoResource ( const GeometryFeatureType geometryFeature) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 306 of file GeometryStage.h.

◆ videoResource() [2/2]

GeometryFeatureType::ManagedInterface & Carna::base::GeometryStage< RenderableCompare >::videoResource ( GeometryFeatureType geometryFeature) const

Interfaces the geometryFeature video resources that were acquired by this rendering stage.

Definition at line 295 of file GeometryStage.h.

Member Data Documentation

◆ geometryType

Renders such geometries whose type AND-linked with geometryTypeMask equals this.

Definition at line 87 of file GeometryStage.h.

◆ geometryTypeMask

Renders such geometries whose type AND-linked with this equals geometryType.

Definition at line 88 of file GeometryStage.h.

◆ rq

Holds the predefined rendering queue of this rendering stage.

Definition at line 73 of file GeometryStage.h.


The documentation for this class was generated from the following file: