Carna Version 3.3.3
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Carna::presets::CuttingPlanesStage Class Reference

Renders cutting planes of volume geometries in the scene. More...

#include <CuttingPlanesStage.h>

+ Inheritance diagram for Carna::presets::CuttingPlanesStage:
+ Collaboration diagram for Carna::presets::CuttingPlanesStage:

Public Member Functions

 CuttingPlanesStage (unsigned int volumeGeometryType, unsigned int planeGeometryType)
 Instantiates.
 
virtual ~CuttingPlanesStage ()
 Deletes.
 
CuttingPlanesStageclone () const override
 Returns same RenderStage implementation with same configuration.
 
virtual void renderPass (const base::math::Matrix4f &viewTransform, base::RenderTask &rt, const base::Viewport &vp) override
 Called once per pass.
 
void setWindowingLevel (float windowingLevel)
 Sets windowing level to windowingLevel.
 
void setWindowingWidth (float windowingWidth)
 Sets windowing level to windowingWidth.
 
void setWindowingWidth (unsigned int windowingWidth)
 
void setRenderingInverse (bool inverse)
 Sets whether brightness shall be inversely proportional to the intensity.
 
float windowingLevel () const
 Tells the windowing level intensity.
 
float windowingWidth () const
 Tells the windowing width.
 
float minimumIntensity () const
 Tells the lower bound of the intensity window.
 
float maximumIntensity () const
 Tells the upper bound of the intensity window.
 
bool isRenderingInverse () const
 Tells whether brightness is inversely proportional to the intensity.
 
- Public Member Functions inherited from Carna::base::GeometryStage< void >
 GeometryStage (unsigned int geometryType, unsigned int geometryTypeMask=RenderQueue< void >::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.
 
std::size_t renderedPassesCount () const
 Tells the number of passes rendered so far since the beginning of the current frame.
 
GeometryFeatureType::ManagedInterface & videoResource (GeometryFeatureType &geometryFeature) const
 Interfaces the geometryFeature video resources that were acquired by this rendering stage.
 
const GeometryFeatureType::ManagedInterface & videoResource (const GeometryFeatureType &geometryFeature) const
 
- Public Member Functions inherited from Carna::base::RenderStage
 RenderStage ()
 Instantiates in enabled-state.
 
virtual ~RenderStage ()
 Deletes.
 
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)\).
 

Static Public Attributes

static const float DEFAULT_WINDOWING_WIDTH
 Holds the default value for setWindowingWidth.
 
static const float DEFAULT_WINDOWING_LEVEL
 Holds the default value for setWindowingLevel.
 
static const unsigned int ROLE_INTENSITIES
 Holds the role that intensity volume data is expected to take when attached to base::Geometry nodes.
 

Protected Member Functions

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

Additional Inherited Members

- Public Attributes inherited from Carna::base::GeometryStage< void >
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 Attributes inherited from Carna::base::GeometryStage< void >
RenderQueue< voidrq
 Holds the predefined rendering queue of this rendering stage.
 

Detailed Description

Renders cutting planes of volume geometries in the scene.

The CuttingPlanesStage constructor takes two geometry type parameters:

planes = new presets::CuttingPlanesStage( GEOMETRY_TYPE_VOLUMETRIC, GEOMETRY_TYPE_CUTTING_PLANE );
renderer->appendStage( planes );
void appendStage(RenderStage *stage)
Appends stage to the rendering stages sequence.
base::FrameRenderer & renderer()
References the renderer this stage belongs to.
Renders cutting planes of volume geometries in the scene.

The concept of geometry types is explained here.

The following example code attaches three orthogonal planes to a node named pivot:

pivot->localTransform = base::math::plane4f( base::math::Vector3f( 1, 1, 1 ).normalized(), 0 );
/* Create the planes.
*/
base::Geometry* planes[ 3 ];
for( unsigned int i = 0; i < 3; ++i )
{
planes[ i ] = new base::Geometry( GEOMETRY_TYPE_CUTTING_PLANE );
pivot->attachChild( planes[ i ] );
}
/* Configure the planes.
*/
planes[ 0 ]->localTransform = base::math::plane4f( base::math::Vector3f( 1, 0, 0 ), 0.f );
planes[ 1 ]->localTransform = base::math::plane4f( base::math::Vector3f( 0, 1, 0 ), 0.f );
planes[ 2 ]->localTransform = base::math::plane4f( base::math::Vector3f( 0, 0, 1 ), 0.f );
Defines scene graph leafs. Instances of this class represent visible geometry that can be rendered....
Definition Geometry.h:60
math::Matrix4f localTransform
Defines the location, rotation and scale of this spatial in relation to it's parent....
Definition Spatial.h:132
Eigen::Matrix< float, 3, 1 > Vector3f
Defines vector.
Definition math.h:196
Matrix4f plane4f(const Vector3f &normal, float distance)
Creates matrix that transforms from the tangent space of a plane with particular normal vector and or...
Definition math.h:456

This produces the rendering below.

rendering result of example code above
Author
Leonid Kostrykin
Date
22.2.15 - 20.3.15

Definition at line 56 of file CuttingPlanesStage.h.

Member Function Documentation

◆ buildRenderQueues()

virtual void Carna::presets::CuttingPlanesStage::buildRenderQueues ( base::Node root,
const base::math::Matrix4f viewTransform 
)
overrideprotectedvirtual

Builds the rendering queues of this stage.

Reimplemented from Carna::base::GeometryStage< void >.

◆ clone()

CuttingPlanesStage * Carna::presets::CuttingPlanesStage::clone ( ) const
overridevirtual

Returns same RenderStage implementation with same configuration.

The listeners and the rendering state are not copied.

Deprecated:
Do not use this method. It will be removed shortly.

Implements Carna::base::RenderStage.

◆ render()

virtual void Carna::presets::CuttingPlanesStage::render ( const base::Renderable renderable)
overrideprotectedvirtual

Renders the renderable.

Implements Carna::base::GeometryStage< void >.

◆ renderPass()

virtual void Carna::presets::CuttingPlanesStage::renderPass ( const base::math::Matrix4f viewTransform,
base::RenderTask rt,
const base::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.

Reimplemented from Carna::base::GeometryStage< void >.

◆ rewindRenderQueues()

virtual void Carna::presets::CuttingPlanesStage::rewindRenderQueues ( )
overrideprotectedvirtual

Rewinds the rendering queues of this stage.

Reimplemented from Carna::base::GeometryStage< void >.

◆ setWindowingWidth()

void Carna::presets::CuttingPlanesStage::setWindowingWidth ( unsigned int  windowingWidth)

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

◆ updateRenderQueues()

virtual void Carna::presets::CuttingPlanesStage::updateRenderQueues ( const base::math::Matrix4f viewTransform)
overrideprotectedvirtual

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

Reimplemented from Carna::base::GeometryStage< void >.

Member Data Documentation

◆ DEFAULT_WINDOWING_LEVEL

const float Carna::presets::CuttingPlanesStage::DEFAULT_WINDOWING_LEVEL
static

Holds the default value for setWindowingLevel.

Definition at line 68 of file CuttingPlanesStage.h.

◆ DEFAULT_WINDOWING_WIDTH

const float Carna::presets::CuttingPlanesStage::DEFAULT_WINDOWING_WIDTH
static

Holds the default value for setWindowingWidth.

Definition at line 67 of file CuttingPlanesStage.h.

◆ ROLE_INTENSITIES

const unsigned int Carna::presets::CuttingPlanesStage::ROLE_INTENSITIES
static

Holds the role that intensity volume data is expected to take when attached to base::Geometry nodes.

Definition at line 74 of file CuttingPlanesStage.h.


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