ImFusion SDK 4.3
InteractiveOverlay Class Reference

#include <ImFusion/GUI/InteractiveOverlay.h>

Wraps a GlOverlay in order to display it at specific positions in an InteractiveView. More...

+ Inheritance diagram for InteractiveOverlay:

Detailed Description

Wraps a GlOverlay in order to display it at specific positions in an InteractiveView.

Note
The size hint of an InteractiveOverlay is managed/defined by the underlying GlOverlay. Thus, the corresponding functions of this class are only a forwarding convenience API.
See also
GlOverlay, OverlayInteraction

Public Types

enum  AnchorPoint {
  BottomLeft = int(Anchor::BottomLeft) , BottomRight = int(Anchor::BottomRight) , TopLeft = int(Anchor::TopLeft) , TopRight = int(Anchor::TopRight) ,
  Top = int(Anchor::Top) , Bottom = int(Anchor::Bottom) , Left = int(Anchor::Left) , Right = int(Anchor::Right) ,
  Fill = int(Anchor::Fill)
}
 Anchor point of the overlay in the hosting InteractiveView. More...
 
- Public Types inherited from ViewOverlay
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.
 

Signals

void anchorPointChanged (InteractiveOverlay::AnchorPoint anchorPoint)
 

Public Member Functions

 InteractiveOverlay (std::unique_ptr< GlOverlay > overlay, AnchorPoint anchor)
 Instantiate a new InteractiveOverlay taking ownership of the underlying GlOverlay.
 
 InteractiveOverlay (GlOverlay &overlay, AnchorPoint anchor)
 Instantiate a new InteractiveOverlay referencing the given overlay.
 
 InteractiveOverlay (GlOverlay *overlay, AnchorPoint anchor, bool ownOverlay=true)
 
const GlOverlayoverlay () const
 Get a pointer to the underlying overlay.
 
GlOverlayoverlay ()
 Get a pointer to the underlying overlay.
 
virtual void setInteraction (std::unique_ptr< OverlayInteraction > interaction)
 Set an interaction event handler for this overlay.
 
QRect rect () const
 Get position and actual size (including margins) of overlay in viewport coordinates.
 
void setMargin (int horizontal, int vertical)
 Sets the margin in pixels between the border of the drawing area and the border of the overlay content.
 
int horizontalMargin () const
 Gets the horizontal margin in pixels between the border of the drawing area and the border of the overlay content. Default is 2.
 
int verticalMargin () const
 Gets the vertical margin in pixels between the border of the drawing area and the border of the overlay content. Default is 2.
 
virtual void setSizeHint (int width, int height)
 Sets the preferred size of the overlay for a DPI scaling of 1.0.
 
virtual int sizeHintWidth () const
 Gets the preferred width of the overlay.
 
virtual int sizeHintHeight () const
 Gets the preferred height of the overlay.
 
virtual void setMinimalSizeHint (int width, int height)
 Sets the minimal size of the overlay for a DPI scaling of 1.0.
 
virtual int minimalSizeHintWidth () const
 Gets the minimal width of the overlay.
 
virtual int minimalSizeHintHeight () const
 Gets the minimal height of the overlay.
 
void setAnchorPoint (AnchorPoint anchorPoint)
 Set the anchor point of overlay.
 
AnchorPoint anchorPoint () const
 Get the anchor point of overlay.
 
virtual bool sceneEvent (QEvent *event)
 Called by the hosting InteractiveView, default implementation forwards it to the set OverlayInteraction.
 
GUI::EventResult handleInputEvent (const GUI::InputEvent &event) override
 Calls the base interface's version and then continues propagation to sceneEvent().
 
- Public Member Functions inherited from ViewOverlay
 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().
 
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.
 

Protected Member Functions

void setOverlay (GlOverlay *overlay, bool ownOverlay)
 Update the internal GlOverlay.
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Protected Attributes

GlOverlaym_overlay = nullptr
 Underlying GlOverlay.
 
std::unique_ptr< OverlayInteractionm_interaction
 Interaction class to handle overlay events.
 
AnchorPoint m_anchorPoint
 Anchor point within parent view.
 
bool m_ownOverlay = true
 Flag whether m_overlay is owned by this instance.
 
- Protected Attributes inherited from ViewOverlay
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.
 

Properties

InteractiveOverlay::AnchorPoint anchorPoint
 

Additional Inherited Members

- Public Attributes inherited from ViewOverlay
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.
 

Member Enumeration Documentation

◆ AnchorPoint

Anchor point of the overlay in the hosting InteractiveView.

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.

Constructor & Destructor Documentation

◆ InteractiveOverlay()

InteractiveOverlay ( GlOverlay * overlay,
AnchorPoint anchor,
bool ownOverlay = true )
Deprecated
"Unclear ownership semantics: use one of the other ctor overloads."

Member Function Documentation

◆ setSizeHint()

virtual void setSizeHint ( int width,
int height )
virtual

Sets the preferred size of the overlay for a DPI scaling of 1.0.

The size hint should be the optimal size of the overlay to display all its information. If the overlay does not have a preferred size, the size hint should be set to to the minimalSizeHint.

◆ sizeHintWidth()

virtual int sizeHintWidth ( ) const
virtual

Gets the preferred width of the overlay.

◆ sizeHintHeight()

virtual int sizeHintHeight ( ) const
virtual

Gets the preferred height of the overlay.

◆ setMinimalSizeHint()

virtual void setMinimalSizeHint ( int width,
int height )
virtual

Sets the minimal size of the overlay for a DPI scaling of 1.0.

The minimal size should reflect the size to display the content in an undistorted way. The actual size of the overlay can still be lower than this, in which case the overlay should scale its content.

◆ minimalSizeHintWidth()

virtual int minimalSizeHintWidth ( ) const
virtual

Gets the minimal width of the overlay.

◆ minimalSizeHintHeight()

virtual int minimalSizeHintHeight ( ) const
virtual

Gets the minimal height of the overlay.

◆ setAnchorPoint()

void setAnchorPoint ( AnchorPoint anchorPoint)

Set the anchor point of overlay.

If several overlays use the same anchor point the will be rendered above/below (depending on Bottom or Top) the previous overlays.

◆ sceneEvent()

virtual bool sceneEvent ( QEvent * event)
virtual

Called by the hosting InteractiveView, default implementation forwards it to the set OverlayInteraction.

Returns
true if the event has been handled and should no longer be passed to other objects.

◆ handleInputEvent()

GUI::EventResult handleInputEvent ( const GUI::InputEvent & event)
overridevirtual

Calls the base interface's version and then continues propagation to sceneEvent().

Reimplemented from ViewOverlay.


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