ImFusion SDK 4.3
ViewOverlay Class Reference

#include <ImFusion/GUI/ViewOverlay.h>

Wraps a GlOverlay in order to display it at specific positions inside a View and handle input events. More...

+ Inheritance diagram for ViewOverlay:

Detailed Description

Wraps a GlOverlay in order to display it at specific positions inside a View and handle input events.

In contrast to a ViewObject a ViewOverlay resides in viewport space and is always rendered on top of the scene. The viewport() is automatically determined by the parent View's ViewOverlayLayouter taking all registered overlays into account so that they don't overlap. The layouting is performed based on sizeHint() and minimalSizeHint() given by the underlying GlOverlay and the configured margin().

In order to react to user input events you need to override the handleInputEvent() member function.

Public Types

enum class  Anchor {
  BottomLeft = 0 , BottomRight = 1 , TopLeft = 2 , TopRight = 3 ,
  Top = 4 , Bottom = 5 , Left = 6 , Right = 7 ,
  Fill = 8
}
 Anchor point of the overlay in the parent View. More...
 
enum class  LayoutDirection { Horizontal = 0 , Vertical = 1 }
 Layout direction when stacking multiple ViewOverlays at the same anchor.
 

Public Member Functions

 ViewOverlay (std::unique_ptr< GlOverlay > glOverlay)
 Instantiate a new ViewOverlay taking ownership of the underlying GlOverlay which must not be null.
 
virtual void render ()
 Calls GlOverlay::render() on the underlying glOverlay() using the current viewport() shrinked by margin().
 
virtual EventResult handleInputEvent (const InputEvent &event)
 Handle a user event received from the parent View.
 
const GlOverlayglOverlay () const
 Get a pointer to the underlying overlay.
 
GlOverlayglOverlay ()
 Get a pointer to the underlying overlay.
 
const GL::Viewportviewport ()
 Returns the area where this overlay is rendered.
 
bool isVisible () const
 Returns the visibility of this overlay.
 
virtual void setVisible (bool value)
 Sets the visibility of this overlay.
 
const vec2i & margin () const
 Returns the margin in pixels between the border of the drawing area and the border of the overlay content.
 
void setMargin (const vec2i &value)
 Sets the margin in pixels between the border of the drawing area and the border of the overlay content.
 
vec2i minimalSizeHint () const
 Returns the underlying GlOverlay's minimal size hint plus the configured margin().
 
vec2i sizeHint () const
 Returns the underlying GlOverlay's size hint plus the configured margin().
 
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
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Public Attributes

Signal signalUpdateRequested
 Emitted in order to notify the parent Display that it's contents have changed and need to be re-rendered.
 
Signal signalLayoutNeeded
 Emitted whenever the size hints or margin have changed to notify the parent View that it needs to perform overlay layouting.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Protected Attributes

std::unique_ptr< GlOverlaym_glOverlay
 
GL::Viewport m_viewport = {}
 
vec2i m_margin = vec2i::Zero()
 
bool m_isVisible = true
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Additional Inherited Members

- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Member Enumeration Documentation

◆ Anchor

enum class Anchor
strong

Anchor point of the overlay in the parent View.

Enumerator
BottomLeft 

Bottom left corner.

BottomRight 

Bottom right corner.

TopLeft 

Top left corner.

TopRight 

Top right corner.

Top 

Top center.

Bottom 

Bottom center.

Left 

Left center.

Right 

Right center.

Fill 

Always fills the complete view; may overlap with any number of other overlays.

Constructor & Destructor Documentation

◆ ViewOverlay()

Instantiate a new ViewOverlay taking ownership of the underlying GlOverlay which must not be null.

Exceptions
std::runtime_errorif glOverlay is nullptr

Member Function Documentation

◆ render()

virtual void render ( )
virtual

Calls GlOverlay::render() on the underlying glOverlay() using the current viewport() shrinked by margin().

Reimplemented in HistogramOverlay, InfoOverlay, and InteractiveHistogramOverlay.

◆ handleInputEvent()

virtual EventResult handleInputEvent ( const InputEvent & event)
virtual

Handle a user event received from the parent View.

The default implementation is empty.

Reimplemented in ButtonOverlay, HistogramOverlay, InfoOverlay, OffscreenIndicatorsOverlay, QualityBarOverlay, and InteractiveOverlay.

◆ setVisible()

virtual void setVisible ( bool value)
virtual

Sets the visibility of this overlay.

Reimplemented in OffscreenIndicatorsOverlay, and SliceIndexOverlay.

◆ 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