ImFusion SDK 4.3
GlIcon Class Reference

#include <ImFusion/GL/GlIcon.h>

Renders an icon as a billboard in world space The icon will be rendered always looking towards the camera, without depth test The position is set with setWorldPosition or GlObject::setMatrix. More...

+ Inheritance diagram for GlIcon:

Detailed Description

Renders an icon as a billboard in world space The icon will be rendered always looking towards the camera, without depth test The position is set with setWorldPosition or GlObject::setMatrix.

A rotation is set using setRotation The size of the icon is by default the size of the image, but it can be altered with setSize. A hover state can be set using setHover, which will render the icon lighter.

Public Member Functions

 GlIcon (std::shared_ptr< GlImage > icon={})
 Constructor with optional GlImage. Image can be later set with setIcon
 
void setIcon (std::shared_ptr< GlImage > icon, bool updateSize=true)
 Sets the icon to be rendered. updateSize can be set to disable updating a previously set size with the size of the icon
 
void setSize (const vec2i &size)
 Sets the size of the image. By default the size will be the size of the given icon.
 
void setHover (bool highlighted)
 Sets the hover state of the icon. When enabled it will be rendered in a lighter color.
 
bool hover () const
 Gets the hover state of the icon.
 
void setWorldPosition (const vec3 &worldPos)
 Helper method to set the position of the icon in the world.
 
vec3 worldPosition ()
 Helper method get the position of the icon in the world.
 
void setRotation (double clockwiseRad)
 Sets a rotation on the icon. Rotates clockwise with the given radians.
 
void draw (const GlView &view) override
 Draw using a complete GlView. Renders in screen 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.
 
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 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 Types inherited from GlObject
enum  RenderingOrderGroup { RenderingGroupRest , RenderingGroupMesh , RenderingGroupManipulator }
 Enumeration to determine rendering order of GlObjects in GlSliceView and GlVolumeView. More...
 
- 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 Function Documentation

◆ draw()

void draw ( const GlView & view)
overridevirtual

Draw using a complete GlView. Renders in screen 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.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configure this object instance by de-serializing the given Properties.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configuration() for the inverse functionality

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Serialize the current object configuration into the given Properties object.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configure() for the inverse functionality

Reimplemented from Configurable.


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