ImFusion SDK 4.3
GlOutlineRenderer Class Reference

#include <ImFusion/GL/GlOutlineRenderer.h>

Light-weight wrapper to render a colored outline around any rendered GlObject. More...

+ Inheritance diagram for GlOutlineRenderer:

Detailed Description

Light-weight wrapper to render a colored outline around any rendered GlObject.

Instantiate this class with any GlObject you want to render the outline of and then add this instance instead of the wrapped GlObject to the view. Rendering the wrapped object and rendering the contour is performed independently, thus you can setup any combination of showing object and outline.

Note
GlOutlineRenderer will only work with GlObjects that render directly to to framebuffer. It will not work if the GlObject uses OIT to render semi-transparent fragments.

Public Types

enum class  RenderMode { ObjectOnly , OutlineOnly , Both }
 Enumeration for specifying what parts to show. More...
 
- Public Types inherited from GlObject
enum  RenderingOrderGroup { RenderingGroupRest , RenderingGroupMesh , RenderingGroupManipulator }
 Enumeration to determine rendering order of GlObjects in GlSliceView and GlVolumeView. More...
 

Public Member Functions

 GlOutlineRenderer (const std::vector< GlMesh * > &meshes)
 Constructor for multiple GlMeshes.
 
 GlOutlineRenderer (GlObject &object)
 
vec4 contourColor () const
 Returns the color of the contour.
 
void setContourColor (vec4 value)
 Sets the color of the contour.
 
int contourWidthPx () const
 Returns the width of the contour in pixels.
 
void setContourWidthPx (int value)
 Sets the width of the contour in pixels.
 
RenderMode renderMode () const
 Returns the what parts to render.
 
void setRenderMode (RenderMode value)
 Sets the what parts to render.
 
bool isAlwaysOnTop () const
 Returns the flag whether the GlObject shall always be renderd on top.
 
void setAlwaysOnTop (bool value)
 Sets the flag whether the GlObject shall always be renderd on top.
 
const std::vector< GlObject * > & objects () const
 Getter for m_objects.
 
void setObjects (std::vector< GlObject * > &obj)
 Setter for m_objecsts.
 
void draw (const GlView &view) override
 Draw the object in 3D space.
 
Geometry::AlignedBox bounds () const override
 Get the axis-aligned bounding box of this GlObject in world space.
 
std::string typeName () const override
 Return unique identifier for this object class used for serialization.
 
- Public Member Functions inherited from GlObject
virtual Geometry::AlignedBox boundsSpherical () const
 Get the spherical bounds of this GlObject in world space.
 
virtual void setMatrix (const mat4 &m)
 Set the modelview matrix of this object.
 
virtual const mat4 & matrix () const
 Return the modelview matrix.
 
virtual void setVisible (bool visible)
 Set object visibility.
 
virtual bool visible () const
 Return object visibility.
 
virtual void setAlwaysVisible (bool alwaysVisible)
 Set if object is always visible.
 
virtual bool alwaysVisible () const
 Return if object is always visible.
 
RenderingOrderGroup renderingOrder () const
 Return current rendering order value for this GlObject.
 
void setRenderingOrder (RenderingOrderGroup group)
 Set rendering order value for this GlObject.
 
void setDraw3DIn2DView (bool draw3DIn2DView)
 
void configure (const Properties *p) override
 Configure this object instance by de-serializing the given Properties.
 
void configuration (Properties *p) const override
 Serialize the current object configuration into the given Properties object.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Protected Attributes inherited from GlObject
mat4 m_matrix = mat4::Identity()
 Modelview transformation matrix of this object.
 
bool m_visible = true
 Object visibility.
 
bool m_alwaysVisible = false
 Object always visible.
 
bool m_draw3DIn2DView
 Draw 3D objects in 2D views. This is to render 3D objects in projective 2D views. Property is not serialized.
 
RenderingOrderGroup m_renderingOrder = RenderingGroupRest
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Enumeration Documentation

◆ RenderMode

enum class RenderMode
strong

Enumeration for specifying what parts to show.

Enumerator
ObjectOnly 

Only render object, not the outline.

OutlineOnly 

Only render outline, not the object.

Both 

Render both object and outline.

Constructor & Destructor Documentation

◆ GlOutlineRenderer()

GlOutlineRenderer ( const std::vector< GlMesh * > & meshes)

Constructor for multiple GlMeshes.

If the GlOutlineRenderer is created for multiple GlMeshes, the outline for each mesh will be computed from the parts which pass the depth test only. The order is considered in the following way. Assuming that two meshes are passed upon construction, then the outline of meshes[1] will override mesh[0].

Member Function Documentation

◆ draw()

void draw ( const GlView & view)
overridevirtual

Draw the object in 3D space.

Implements GlObject.

◆ bounds()

Geometry::AlignedBox bounds ( ) const
overridevirtual

Get the axis-aligned bounding box of this GlObject in world space.

Return an empty (default-constructed) AlignedBox object if the GlObject does not reside in world space.

Implements GlObject.

◆ typeName()

std::string typeName ( ) const
overridevirtual

Return unique identifier for this object class used for serialization.

Implements GlObject.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close