The IButton graph node interface. More...

#include "murl_graph_i_button.h"

Inheritance diagram for Murl::Graph::IButton:

Public Member Functions

virtual INodeGetNodeInterface ()=0
 Get the mutable Graph::INode interface. More...
 
virtual const INodeGetNodeInterface () const =0
 Get the constant Graph::INode interface. More...
 
virtual ITransformGetTransformInterface ()=0
 Get the mutable Graph::ITransform interface. More...
 
virtual const ITransformGetTransformInterface () const =0
 Get the constant Graph::ITransform interface. More...
 
virtual IFrameBufferNodeTargetGetFrameBufferNodeTarget ()=0
 Get the mutable IFrameBufferNodeTarget container. More...
 
virtual const IFrameBufferNodeTargetGetFrameBufferNodeTarget () const =0
 Get the constant IFrameBufferNodeTarget container. More...
 
virtual Bool SetEnabled (Bool enabled)=0
 Enable or disable the button. More...
 
virtual Bool IsEnabled () const =0
 Check if the button is enabled. More...
 
virtual Bool SetActiveFaces (IEnums::PolygonFaces faces)=0
 Set which faces of the button are active. More...
 
virtual IEnums::PolygonFaces GetActiveFaces () const =0
 Check which faces of the button are active. More...
 
virtual Bool SetStateNodeId (IEnums::ButtonState state, const String &nodeId)=0
 Set the button's active node ID for a given state. More...
 
virtual const StringGetStateNodeId (IEnums::ButtonState state) const =0
 Get the ID of the button's active node for a given state. More...
 
virtual Bool SetStateChildIndex (IEnums::ButtonState state, SInt32 childIndex)=0
 Set the button's active child for a given state. More...
 
virtual SInt32 GetStateChildIndex (IEnums::ButtonState state) const =0
 Get the index of the button's active child for a given state. More...
 
virtual Bool SetStateAnimationTime (IEnums::ButtonState state, Real time)=0
 Set the target time value for a given state. More...
 
virtual Real GetStateAnimationTime (IEnums::ButtonState state) const =0
 Get the target time value set for a given state. More...
 
virtual Bool ResetStateAnimationTime (IEnums::ButtonState state)=0
 Reset the target time value for a given state to 0. More...
 
virtual Bool IsStateAnimationTimeSet (IEnums::ButtonState state) const =0
 Query if a target time value was set for a given button state. More...
 
virtual Bool SetTimelineNodeId (const String &nodeId)=0
 Define a timeline node from within the current graph namespace. More...
 
virtual const StringGetTimelineNodeId () const =0
 Query the node ID of an assigned timeline child. More...
 
virtual Bool SetTimelineChildIndex (SInt32 nodeIndex)=0
 Define a timeline node among the button's children. More...
 
virtual SInt32 GetTimelineChildIndex () const =0
 Query the child index of an assigned timeline child. More...
 
virtual Bool SetShape (IEnums::TouchAreaShape shape)=0
 Set the shape of the button's touch area. More...
 
virtual IEnums::TouchAreaShape GetShape () const =0
 Get the shape of the button's touch area. More...
 
virtual Bool SetContainerAlignment (IEnums::AlignmentX alignmentX, IEnums::AlignmentY alignmentY)=0
 Set the horizontal container alignment. More...
 
virtual Bool SetContainerAlignmentX (IEnums::AlignmentX alignmentX)=0
 Set the horizontal container alignment. More...
 
virtual Bool SetContainerAlignmentY (IEnums::AlignmentY alignmentY)=0
 Set the vertical container alignment. More...
 
virtual IEnums::AlignmentX GetContainerAlignmentX () const =0
 Get the horizontal container alignment. More...
 
virtual IEnums::AlignmentY GetContainerAlignmentY () const =0
 Get the vertical container alignment. More...
 
virtual Bool SetBorder (Real borderX, Real borderY)=0
 Set the horizontal and vertical borders used for alignment. More...
 
virtual Bool SetBorderX (Real borderX)=0
 Set the horizontal border used for alignment. More...
 
virtual Bool SetBorderY (Real borderY)=0
 Set the vertical border used for alignment. More...
 
virtual Real GetBorderX () const =0
 Get the horizontal border used for alignment. More...
 
virtual Real GetBorderY () const =0
 Get the vertical border used for alignment. More...
 
virtual Bool SetOutCoordSize (Real sizeX, Real sizeY)=0
 Set the output coordinate reference size. More...
 
virtual Bool SetOutCoordSizeX (Real sizeX)=0
 Set the horizontal output coordinate reference size. More...
 
virtual Bool SetOutCoordSizeY (Real sizeY)=0
 Set the vertical output coordinate reference size. More...
 
virtual Real GetOutCoordSizeX () const =0
 Get the horizontal output coordinate reference size. More...
 
virtual Real GetOutCoordSizeY () const =0
 Get the vertical output coordinate reference size. More...
 
virtual Bool SetOutCoord (Real x1, Real y1, Real x2, Real y2)=0
 Set the button's output coordinate range. More...
 
virtual Bool SetOutCoord1 (Real x1, Real y1)=0
 Set the button's output coordinate start. More...
 
virtual Bool SetOutCoord2 (Real x2, Real y2)=0
 Set the button's output coordinate end. More...
 
virtual Bool SetOutCoordX1 (Real x1)=0
 Set the button's horizontal start output coordinate. More...
 
virtual Bool SetOutCoordY1 (Real y1)=0
 Set the button's vertical start output coordinates. More...
 
virtual Bool SetOutCoordX2 (Real x2)=0
 Set the button's horizontal end output coordinate. More...
 
virtual Bool SetOutCoordY2 (Real y2)=0
 Set the button's vertical end output coordinates. More...
 
virtual Real GetOutCoordX1 () const =0
 Get the button's horizontal start output coordinate. More...
 
virtual Real GetOutCoordY1 () const =0
 Get the button's vertical start output coordinate. More...
 
virtual Real GetOutCoordX2 () const =0
 Get the button's horizontal end output coordinate. More...
 
virtual Real GetOutCoordY2 () const =0
 Get the button's vertical end output coordinate. More...
 
virtual Bool SetOutCoordClippingEnabled (Bool enable)=0
 Enable or disable output coordinate clipping. More...
 
virtual Bool IsOutCoordClippingEnabled () const =0
 Check if output coordinate clipping is enabled. More...
 
virtual Bool SetResponseButton (IEnums::MouseButton button)=0
 Set the mouse button this button responds to. More...
 
virtual IEnums::MouseButton GetResponseButton () const =0
 Get the mouse button this button responds to. More...
 
virtual Bool SetPassEventsEnabled (Bool enable)=0
 Enable or disable event pass through. More...
 
virtual Bool IsPassEventsEnabled () const =0
 Check event pass through is enabled. More...
 
virtual Bool SetMaxNumberOfEvents (UInt32 value)=0
 Set the maximum number of simultaneous touch events. More...
 
virtual UInt32 GetMaxNumberOfEvents () const =0
 Get the maximum number of simultaneous touch events. More...
 
virtual Bool ResetEvents ()=0
 Reset the tracking of all current events. More...
 
virtual UInt32 GetNumberOfActiveEvents () const =0
 Get the total number of active events. More...
 
virtual UInt32 GetActiveEventId (UInt32 activeEventIndex) const =0
 Get the unique ID of a specific active event. More...
 
virtual UInt32 GetNumberOfTrackedEvents () const =0
 Get the number of currently tracked events. More...
 
virtual UInt32 GetTrackedEventId (UInt32 trackedEventIndex) const =0
 Get the unique ID of a specific tracked event. More...
 
virtual Bool HasEventUpdate (UInt32 id) const =0
 Check if a given event has received updates from any input device during the most recent logic tick. More...
 
virtual IEnums::InputDeviceType GetEventDeviceType (UInt32 id) const =0
 Get the type of input device that reported the event with a given ID. More...
 
virtual const VectorGetEventOutCoord (UInt32 id) const =0
 Get the output coordinate of an event with a given ID, in 2D space. More...
 
virtual const VectorGetLocalEventPosition (UInt32 id) const =0
 Get the position of an event with a given ID, in 3D object space. More...
 
virtual const VectorGetLocalEventDelta (UInt32 id) const =0
 Get the current position delta of an event with a given ID, in object space. More...
 
virtual Bool IsEventTracked (UInt32 id) const =0
 Check if a given event is in the "tracked" state. More...
 
virtual Bool IsEventInside (UInt32 id) const =0
 Check if a given event's incidence point is within the button's bounds. More...
 
virtual Bool IsEventPressed (UInt32 id) const =0
 Check if a given event is in the pressed state. More...
 
virtual Bool WasPressed () const =0
 Check if the button was pressed. More...
 
virtual Bool WasReleasedInside () const =0
 Check if the button was released inside. More...
 
virtual Bool WasReleasedOutside () const =0
 Check if the button was released outside. More...
 
virtual const VectorGetEventPosition () const =0
 Get the position of the current button event, in object space. More...
 
virtual IEnums::ButtonState GetButtonState () const =0
 Get the current button state. More...
 
- Public Member Functions inherited from Murl::Graph::IScalable
virtual Bool SetScaleFactor (const Vector &scaleFactor)=0
 Set individual scaling factors for the X, Y and Z axes. More...
 
virtual Bool SetScaleFactor (Real x, Real y, Real z)=0
 Set individual scaling factors for the X, Y and Z axes. More...
 
virtual Bool SetScaleFactor (Real s)=0
 Set a uniform scaling factor for all three axes. More...
 
virtual Bool SetScaleFactorX (Real x)=0
 Set the scaling factor for the X axis only. More...
 
virtual Bool SetScaleFactorY (Real y)=0
 Set the scaling factor for the Y axis only. More...
 
virtual Bool SetScaleFactorZ (Real z)=0
 Set the scaling factor for the Z axis only. More...
 
virtual const VectorGetScaleFactor () const =0
 Get the scaling factors for the X, Y and Z axes. More...
 
virtual Real GetScaleFactorX () const =0
 Get the scaling factor for the X axis. More...
 
virtual Real GetScaleFactorY () const =0
 Get the scaling factor for the Y axis. More...
 
virtual Real GetScaleFactorZ () const =0
 Get the scaling factor for the Z axis. More...
 

Detailed Description

The IButton graph node interface.

This interface represents a common clickable or touchable button surface. A button by itself does not actually have any renderable geometry; instead, it only holds a specific surface shape on which any pointing events are evaluated in 3D space.

In general, a button can be in one of 3 available states: "Up", "Down" or "Disabled". For devices that provide a point input method other than a touch screen, such as a mouse, there also exists an additional "Hover" state. Internally, a button node acts similar to a Graph::ISwitch node, managing visibility of a subset of its child nodes that are assigned to these states. Depending on the actual state the button is in, the respective child node gets activated, and all other ones deactivated. If a child node is not assigned to one of these states, it is left unmanaged.

In addition, it is possible to define a single child node implementing the Graph::ITimeline interface to react on state changes. The assigned timeline will then be started to run up to a given time value set for that state.

Use the button's Graph::IScalable base interface to control the actual size of the button in 3D space; by default, predefined shapes such as rectangles and ellipses have an X and Y extent of 1.

Member Function Documentation

◆ GetNodeInterface() [1/2]

virtual INode* Murl::Graph::IButton::GetNodeInterface ( )
pure virtual

Get the mutable Graph::INode interface.

This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.

Returns
The mutable Graph::INode interface, or null if not available

◆ GetNodeInterface() [2/2]

virtual const INode* Murl::Graph::IButton::GetNodeInterface ( ) const
pure virtual

Get the constant Graph::INode interface.

This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.

Returns
The constant Graph::INode interface, or null if not available

◆ GetTransformInterface() [1/2]

virtual ITransform* Murl::Graph::IButton::GetTransformInterface ( )
pure virtual

Get the mutable Graph::ITransform interface.

This method returns a mutable pointer to the node's Graph::ITransform interface, to be able to query or modify the node's transformation matrix and depth order.

Returns
The mutable Graph::ITransform interface, or null if not available

◆ GetTransformInterface() [2/2]

virtual const ITransform* Murl::Graph::IButton::GetTransformInterface ( ) const
pure virtual

Get the constant Graph::ITransform interface.

This method returns a constant pointer to the node's Graph::ITransform interface, to be able to query the node's transformation matrix and depth order.

Returns
The constant Graph::ITransform interface, or null if not available

◆ GetFrameBufferNodeTarget() [1/2]

virtual IFrameBufferNodeTarget* Murl::Graph::IButton::GetFrameBufferNodeTarget ( )
pure virtual

Get the mutable IFrameBufferNodeTarget container.

This method returns a mutable pointer to the node's IFrameBufferNodeTarget container, which allows to set or query the frame buffer object the button object delegates its input to.

Returns
The mutable IFrameBufferNodeTarget container, or null if not available

◆ GetFrameBufferNodeTarget() [2/2]

virtual const IFrameBufferNodeTarget* Murl::Graph::IButton::GetFrameBufferNodeTarget ( ) const
pure virtual

Get the constant IFrameBufferNodeTarget container.

This method returns a constant pointer to the node's IFrameBufferNodeTarget container, which allows to query the frame buffer object the button object delegates its input to.

Returns
The constant IFrameBufferNodeTarget container, or null if not available

◆ SetEnabled()

virtual Bool Murl::Graph::IButton::SetEnabled ( Bool  enabled)
pure virtual

Enable or disable the button.

When the button is disabled, it is still being processed and drawn, but not reacting on any user input. To define the node that is active in the disabled state, use SetStateNodeId() or SetStateChildIndex() with IEnums::BUTTON_STATE_DISABLED.

Parameters
enabledIf false, the button gets disabled.
Returns
true if successful.

◆ IsEnabled()

virtual Bool Murl::Graph::IButton::IsEnabled ( ) const
pure virtual

Check if the button is enabled.

Returns
true if enabled.

◆ SetActiveFaces()

virtual Bool Murl::Graph::IButton::SetActiveFaces ( IEnums::PolygonFaces  faces)
pure virtual

Set which faces of the button are active.

Parameters
facesOne of the available IEnums::PolygonFaces enumeration values.
Returns
true if successful.

◆ GetActiveFaces()

virtual IEnums::PolygonFaces Murl::Graph::IButton::GetActiveFaces ( ) const
pure virtual

Check which faces of the button are active.

Returns
One of the available IEnums::PolygonFaces enumeration values.

◆ SetStateNodeId()

virtual Bool Murl::Graph::IButton::SetStateNodeId ( IEnums::ButtonState  state,
const String nodeId 
)
pure virtual

Set the button's active node ID for a given state.

Calling this method assigns one of the button's nodes to a given internal button state. If done so, that node will be activated whenever the button changes to this state, and deactivated when it changes to a different state.

Parameters
stateThe internal state to which the given node will be assigned.
nodeIdThe node ID of the node to assign.
Returns
true if successful.

◆ GetStateNodeId()

virtual const String& Murl::Graph::IButton::GetStateNodeId ( IEnums::ButtonState  state) const
pure virtual

Get the ID of the button's active node for a given state.

Parameters
stateThe internal state for which to query the assigned node.
Returns
The ID of the assigned node, or an empty string if there is no present assignment for the givent state.

◆ SetStateChildIndex()

virtual Bool Murl::Graph::IButton::SetStateChildIndex ( IEnums::ButtonState  state,
SInt32  childIndex 
)
pure virtual

Set the button's active child for a given state.

Calling this method assigns one of the button's children to a given internal button state. If done so, that child will be activated whenever the button changes to this state, and deactivated when it changes to a different state. All children that are not assigned to a specific button state behave normally.

As an example, a button may have four Graph::IParametersState children representing different button colors, each assigned to one of the four possible internal states, and a Graph::PlaneGeometry as an additional fifth child without state assignment. Depending on the button's current state, one of these parameter sets will be selected, and the plane geometry will be rendered in different colors.

Parameters
stateThe internal state to which the given child will be assigned.
childIndexThe zero-based index of the child node to assign.
Returns
true if successful.

◆ GetStateChildIndex()

virtual SInt32 Murl::Graph::IButton::GetStateChildIndex ( IEnums::ButtonState  state) const
pure virtual

Get the index of the button's active child for a given state.

Parameters
stateThe internal state for which to query the assigned child.
Returns
The zero-based index into the button's array of children, or -1 if there is no present assignment for the givent state.

◆ SetStateAnimationTime()

virtual Bool Murl::Graph::IButton::SetStateAnimationTime ( IEnums::ButtonState  state,
Real  time 
)
pure virtual

Set the target time value for a given state.

When a timeline child node is defined via SetTimelineNodeId() or SetTimelineChildIndex(), this method sets the target time value to run to when the button is entering the given button state.

Parameters
stateThe button state for which to set the target time value.
timeThe target time value.
Returns
true if successful.

◆ GetStateAnimationTime()

virtual Real Murl::Graph::IButton::GetStateAnimationTime ( IEnums::ButtonState  state) const
pure virtual

Get the target time value set for a given state.

Parameters
stateThe button state for which to query the target time.
Returns
The target time value.

◆ ResetStateAnimationTime()

virtual Bool Murl::Graph::IButton::ResetStateAnimationTime ( IEnums::ButtonState  state)
pure virtual

Reset the target time value for a given state to 0.

Parameters
stateThe button state for which to reset the target time value.
Returns
true if successful.

◆ IsStateAnimationTimeSet()

virtual Bool Murl::Graph::IButton::IsStateAnimationTimeSet ( IEnums::ButtonState  state) const
pure virtual

Query if a target time value was set for a given button state.

Parameters
stateThe button state to query.
Returns
true if a target time value was set for the given state.

◆ SetTimelineNodeId()

virtual Bool Murl::Graph::IButton::SetTimelineNodeId ( const String nodeId)
pure virtual

Define a timeline node from within the current graph namespace.

Parameters
nodeIdThe node ID of the timeline to assign.
Returns
true if successful.

◆ GetTimelineNodeId()

virtual const String& Murl::Graph::IButton::GetTimelineNodeId ( ) const
pure virtual

Query the node ID of an assigned timeline child.

Returns
The node id of the assigned timeline child, or an empty string if no timeline was assigned or a child was explicitly assigned by its child index.

◆ SetTimelineChildIndex()

virtual Bool Murl::Graph::IButton::SetTimelineChildIndex ( SInt32  nodeIndex)
pure virtual

Define a timeline node among the button's children.

Parameters
nodeIndexThe zero-based child index of the timeline child to assign.
Returns
true if successful.

◆ GetTimelineChildIndex()

virtual SInt32 Murl::Graph::IButton::GetTimelineChildIndex ( ) const
pure virtual

Query the child index of an assigned timeline child.

Returns
The zero-based child index of the assigned timeline child, or -1 if no explicit child was assigned or a different timeline node was used from the current namespace via SetTimelineNodeId().

◆ SetShape()

virtual Bool Murl::Graph::IButton::SetShape ( IEnums::TouchAreaShape  shape)
pure virtual

Set the shape of the button's touch area.

Parameters
shapeThe shape to use.
Returns
true if successful.

◆ GetShape()

virtual IEnums::TouchAreaShape Murl::Graph::IButton::GetShape ( ) const
pure virtual

Get the shape of the button's touch area.

Returns
The touch area's shape.

◆ SetContainerAlignment()

virtual Bool Murl::Graph::IButton::SetContainerAlignment ( IEnums::AlignmentX  alignmentX,
IEnums::AlignmentY  alignmentY 
)
pure virtual

Set the horizontal container alignment.

The given alignment values specify how the button is actually positioned with respect to the node's world position.

Parameters
alignmentXThe horizontal container alignment.
alignmentYThe vertical container alignment.
Returns
true if successful.

◆ SetContainerAlignmentX()

virtual Bool Murl::Graph::IButton::SetContainerAlignmentX ( IEnums::AlignmentX  alignmentX)
pure virtual

Set the horizontal container alignment.

See SetContainerAlignment().

Parameters
alignmentXThe horizontal container alignment.
Returns
true if successful.

◆ SetContainerAlignmentY()

virtual Bool Murl::Graph::IButton::SetContainerAlignmentY ( IEnums::AlignmentY  alignmentY)
pure virtual

Set the vertical container alignment.

See SetContainerAlignment().

Parameters
alignmentYThe vertical container alignment.
Returns
true if successful.

◆ GetContainerAlignmentX()

virtual IEnums::AlignmentX Murl::Graph::IButton::GetContainerAlignmentX ( ) const
pure virtual

Get the horizontal container alignment.

Returns
The horizontal container alignment.

◆ GetContainerAlignmentY()

virtual IEnums::AlignmentY Murl::Graph::IButton::GetContainerAlignmentY ( ) const
pure virtual

Get the vertical container alignment.

Returns
The vertical container alignment.

◆ SetBorder()

virtual Bool Murl::Graph::IButton::SetBorder ( Real  borderX,
Real  borderY 
)
pure virtual

Set the horizontal and vertical borders used for alignment.

Parameters
borderXThe horizontal border.
borderYThe vertical border.
Returns
true if successful.

◆ SetBorderX()

virtual Bool Murl::Graph::IButton::SetBorderX ( Real  borderX)
pure virtual

Set the horizontal border used for alignment.

Parameters
borderXThe horizontal border.
Returns
true if successful.

◆ SetBorderY()

virtual Bool Murl::Graph::IButton::SetBorderY ( Real  borderY)
pure virtual

Set the vertical border used for alignment.

Parameters
borderYThe vertical border.
Returns
true if successful.

◆ GetBorderX()

virtual Real Murl::Graph::IButton::GetBorderX ( ) const
pure virtual

Get the horizontal border used for alignment.

Returns
The horizontal border.

◆ GetBorderY()

virtual Real Murl::Graph::IButton::GetBorderY ( ) const
pure virtual

Get the vertical border used for alignment.

Returns
The vertical border.

◆ SetOutCoordSize()

virtual Bool Murl::Graph::IButton::SetOutCoordSize ( Real  sizeX,
Real  sizeY 
)
pure virtual

Set the output coordinate reference size.

Generally, output coordinates are represented by values ranging from -1.0 to 1.0. As a convenience, this method can be used to set an arbitrary reference size for both dimensions of the button; this way it is possible to specify integer (pixel) values instead of (quite unreadable) floats. By default, both sizeX and sizeY are set to 1.0. See also Graph::IPlaneGeometry::SetTextureSize() for a texture equivalent, and Graph::IFrameBuffer::SetInCoordSize() for the counterpart taking the button's out coordinates as input. Note that if it is desired to map button coordinates directly to texture coordinates e.g. for using a button on a frame buffer, it may be useful to call SetOutCoord()/SetOutCoordSize() and the frame buffer's SetInCoord()/SetInCoordSize() with values equivalent to the texture coordinate values of the plane displaying the frame buffer contents.

Parameters
sizeXThe horizontal coordinate reference size.
sizeYThe vertical coordinate reference size.
Returns
true if successful.

◆ SetOutCoordSizeX()

virtual Bool Murl::Graph::IButton::SetOutCoordSizeX ( Real  sizeX)
pure virtual

Set the horizontal output coordinate reference size.

See SetOutCoordSize().

Parameters
sizeXThe horizontal coordinate reference size.
Returns
true if successful.

◆ SetOutCoordSizeY()

virtual Bool Murl::Graph::IButton::SetOutCoordSizeY ( Real  sizeY)
pure virtual

Set the vertical output coordinate reference size.

See SetOutCoordSize().

Parameters
sizeYThe vertical coordinate reference size.
Returns
true if successful.

◆ GetOutCoordSizeX()

virtual Real Murl::Graph::IButton::GetOutCoordSizeX ( ) const
pure virtual

Get the horizontal output coordinate reference size.

See SetOutCoordSize().

Returns
The horizontal output coordinate reference size.

◆ GetOutCoordSizeY()

virtual Real Murl::Graph::IButton::GetOutCoordSizeY ( ) const
pure virtual

Get the vertical output coordinate reference size.

See SetOutCoordSize().

Returns
The vertical output coordinate reference size.

◆ SetOutCoord()

virtual Bool Murl::Graph::IButton::SetOutCoord ( Real  x1,
Real  y1,
Real  x2,
Real  y2 
)
pure virtual

Set the button's output coordinate range.

This method sets the button's start and end output coordinates. In contrast to a button event's local intersection point, which always represents the actual intersection in object-space 3D coordinates, an event's output coordinate represents a 2D intersection on the button's clickable surface. This can be interpreted analogously to a renderable geometry, with 3D vertex coordinates and 2D texture coordinates.

Parameters
x1The start coordinate in X direction.
y1The start coordinate in Y direction.
x2The end coordinate in X direction.
y2The end coordinate in Y direction.
Returns
true if successful.

◆ SetOutCoord1()

virtual Bool Murl::Graph::IButton::SetOutCoord1 ( Real  x1,
Real  y1 
)
pure virtual

Set the button's output coordinate start.

See SetOutCoord().

Parameters
x1The start coordinate in X direction.
y1The start coordinate in Y direction.
Returns
true if successful.

◆ SetOutCoord2()

virtual Bool Murl::Graph::IButton::SetOutCoord2 ( Real  x2,
Real  y2 
)
pure virtual

Set the button's output coordinate end.

See SetOutCoord().

Parameters
x2The end coordinate in X direction.
y2The end coordinate in Y direction.
Returns
true if successful.

◆ SetOutCoordX1()

virtual Bool Murl::Graph::IButton::SetOutCoordX1 ( Real  x1)
pure virtual

Set the button's horizontal start output coordinate.

See SetOutCoord().

Parameters
x1The start coordinate in X direction.
Returns
true if successful.

◆ SetOutCoordY1()

virtual Bool Murl::Graph::IButton::SetOutCoordY1 ( Real  y1)
pure virtual

Set the button's vertical start output coordinates.

See SetOutCoord().

Parameters
y1The start coordinate in Y direction.
Returns
true if successful.

◆ SetOutCoordX2()

virtual Bool Murl::Graph::IButton::SetOutCoordX2 ( Real  x2)
pure virtual

Set the button's horizontal end output coordinate.

See SetOutCoord().

Parameters
x2The end coordinate in X direction.
Returns
true if successful.

◆ SetOutCoordY2()

virtual Bool Murl::Graph::IButton::SetOutCoordY2 ( Real  y2)
pure virtual

Set the button's vertical end output coordinates.

See SetOutCoord().

Parameters
y2The end coordinate in Y direction.
Returns
true if successful.

◆ GetOutCoordX1()

virtual Real Murl::Graph::IButton::GetOutCoordX1 ( ) const
pure virtual

Get the button's horizontal start output coordinate.

See SetOutCoord().

Returns
The start coordinate in X direction.

◆ GetOutCoordY1()

virtual Real Murl::Graph::IButton::GetOutCoordY1 ( ) const
pure virtual

Get the button's vertical start output coordinate.

See SetOutCoord().

Returns
The start coordinate in Y direction.

◆ GetOutCoordX2()

virtual Real Murl::Graph::IButton::GetOutCoordX2 ( ) const
pure virtual

Get the button's horizontal end output coordinate.

See SetOutCoord().

Returns
The end coordinate in X direction.

◆ GetOutCoordY2()

virtual Real Murl::Graph::IButton::GetOutCoordY2 ( ) const
pure virtual

Get the button's vertical end output coordinate.

See SetOutCoord().

Returns
The end coordinate in Y direction.

◆ SetOutCoordClippingEnabled()

virtual Bool Murl::Graph::IButton::SetOutCoordClippingEnabled ( Bool  enable)
pure virtual

Enable or disable output coordinate clipping.

By default, clipping is disabled. If the button delegates its events to a given frame buffer (see GetFrameBufferNodeTarget()), this means that other buttons defined in the frame buffer also receive events even if they are actually outside this buttons range. Set enabled to true to restrict the frame buffer's input event area to this button's bounds.

Parameters
enableIf true, output coordinates are being clipped.
Returns
true if successful.

◆ IsOutCoordClippingEnabled()

virtual Bool Murl::Graph::IButton::IsOutCoordClippingEnabled ( ) const
pure virtual

Check if output coordinate clipping is enabled.

Returns
true if enabled.

◆ SetResponseButton()

virtual Bool Murl::Graph::IButton::SetResponseButton ( IEnums::MouseButton  button)
pure virtual

Set the mouse button this button responds to.

Parameters
buttonThe mouse button used for input.
Returns
true if successful.

◆ GetResponseButton()

virtual IEnums::MouseButton Murl::Graph::IButton::GetResponseButton ( ) const
pure virtual

Get the mouse button this button responds to.

Returns
The mouse button used for input.

◆ SetPassEventsEnabled()

virtual Bool Murl::Graph::IButton::SetPassEventsEnabled ( Bool  enable)
pure virtual

Enable or disable event pass through.

Parameters
enableIf true events are passed through underlying buttons.
Returns
true if successful.

◆ IsPassEventsEnabled()

virtual Bool Murl::Graph::IButton::IsPassEventsEnabled ( ) const
pure virtual

Check event pass through is enabled.

Returns
true if events are passed through underlying buttons.

◆ SetMaxNumberOfEvents()

virtual Bool Murl::Graph::IButton::SetMaxNumberOfEvents ( UInt32  value)
pure virtual

Set the maximum number of simultaneous touch events.

Parameters
valueThe maximum number of touch events that are evaluated simultaneously.
Returns
true if successful.

◆ GetMaxNumberOfEvents()

virtual UInt32 Murl::Graph::IButton::GetMaxNumberOfEvents ( ) const
pure virtual

Get the maximum number of simultaneous touch events.

Returns
The maximum number of touch events that are evaluated simultaneously.

◆ ResetEvents()

virtual Bool Murl::Graph::IButton::ResetEvents ( )
pure virtual

Reset the tracking of all current events.

Set the button state to IEnums::BUTTON_STATE_UP if enabled otherwise to IEnums::BUTTON_STATE_DISABLED.

Returns
true if successful.

◆ GetNumberOfActiveEvents()

virtual UInt32 Murl::Graph::IButton::GetNumberOfActiveEvents ( ) const
pure virtual

Get the total number of active events.

This method returns the total number of active input events, including any non-tracked events and events that are already in the "up" state. For mouse-like devices, this simply means move events without any button pressed. For touch screen-like devices, there is no actual move event in the "up" state, so any active event retains the state immediately before the finger was lifted.

Returns
The total number of active events.

◆ GetActiveEventId()

virtual UInt32 Murl::Graph::IButton::GetActiveEventId ( UInt32  activeEventIndex) const
pure virtual

Get the unique ID of a specific active event.

Parameters
activeEventIndexThe event's index, in the range from 0 to GetNumberOfActiveEvents() - 1.
Returns
The active event's ID.

◆ GetNumberOfTrackedEvents()

virtual UInt32 Murl::Graph::IButton::GetNumberOfTrackedEvents ( ) const
pure virtual

Get the number of currently tracked events.

This method returns the number of currently tracked events, i.e. all those events that began with a "down" action inside the button's bounds.

Returns
The number of currently tracked events.

◆ GetTrackedEventId()

virtual UInt32 Murl::Graph::IButton::GetTrackedEventId ( UInt32  trackedEventIndex) const
pure virtual

Get the unique ID of a specific tracked event.

Parameters
trackedEventIndexThe event's index, in the range from 0 to GetNumberOfTrackedEvents() - 1.
Returns
The tracked event's ID.

◆ HasEventUpdate()

virtual Bool Murl::Graph::IButton::HasEventUpdate ( UInt32  id) const
pure virtual

Check if a given event has received updates from any input device during the most recent logic tick.

Has to be considered when using GetLocalEventDelta().

Parameters
idThe ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
Returns
true if the event has received updates.

◆ GetEventDeviceType()

virtual IEnums::InputDeviceType Murl::Graph::IButton::GetEventDeviceType ( UInt32  id) const
pure virtual

Get the type of input device that reported the event with a given ID.

Parameters
idThe ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
Returns
The input device type.

◆ GetEventOutCoord()

virtual const Vector& Murl::Graph::IButton::GetEventOutCoord ( UInt32  id) const
pure virtual

Get the output coordinate of an event with a given ID, in 2D space.

Parameters
idThe ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
Returns
A const reference to the event's current out coordinate.

◆ GetLocalEventPosition()

virtual const Vector& Murl::Graph::IButton::GetLocalEventPosition ( UInt32  id) const
pure virtual

Get the position of an event with a given ID, in 3D object space.

Parameters
idThe ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
Returns
A const reference to the event's current local position.

◆ GetLocalEventDelta()

virtual const Vector& Murl::Graph::IButton::GetLocalEventDelta ( UInt32  id) const
pure virtual

Get the current position delta of an event with a given ID, in object space.

If HasEventUpdate() returns false the delta is zero and should be ignored.

Parameters
idThe ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
Returns
A const reference to the event's current local position delta.

◆ IsEventTracked()

virtual Bool Murl::Graph::IButton::IsEventTracked ( UInt32  id) const
pure virtual

Check if a given event is in the "tracked" state.

Parameters
idThe ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
Returns
true if the event is currently tracked.

◆ IsEventInside()

virtual Bool Murl::Graph::IButton::IsEventInside ( UInt32  id) const
pure virtual

Check if a given event's incidence point is within the button's bounds.

As an example, for a rectangular button (SetShape(IEnums::TOUCH_AREA_SHAPE_RECTANGLE)) without additional scale factor, this method returns true whenever the event's local X and Y coordinates are both in the range from -0.5 to +0.5.

Parameters
idThe ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
Returns
true if the event is inside.

◆ IsEventPressed()

virtual Bool Murl::Graph::IButton::IsEventPressed ( UInt32  id) const
pure virtual

Check if a given event is in the pressed state.

Parameters
idThe ID of the event to query, retrieved from GetActiveEventId() or GetTrackedEventId().
Returns
true if the event is currently in the pressed state.

◆ WasPressed()

virtual Bool Murl::Graph::IButton::WasPressed ( ) const
pure virtual

Check if the button was pressed.

This method returns true when a "down" action occurred during the most recent logic tick at a coordinate within the button's bounds, and the button was not already in the "down" state.

Returns
true if the button was pressed.

◆ WasReleasedInside()

virtual Bool Murl::Graph::IButton::WasReleasedInside ( ) const
pure virtual

Check if the button was released inside.

This method returns true when the button was actually released during the most recent logic tick, i.e. when first a "down" action occurred on that button, and later on the corresponding "up" action occurred at a coordinate within the button's bounds.

Returns
true if the button was clicked.

◆ WasReleasedOutside()

virtual Bool Murl::Graph::IButton::WasReleasedOutside ( ) const
pure virtual

Check if the button was released outside.

This method returns true when a pending click action on the button was actually dismissed during the most recent logic tick, i.e. when first a "down" action occurred on that button, and later on the corresponding "up" action occurred at a coordinate outside the button's bounds.

Returns
true if the button was released.

◆ GetEventPosition()

virtual const Vector& Murl::Graph::IButton::GetEventPosition ( ) const
pure virtual

Get the position of the current button event, in object space.

This method returns the current position of the last WasReleasedInside(), WasPressed() or WasReleased() event.

Returns
A const reference to the event's current local position.

◆ GetButtonState()

virtual IEnums::ButtonState Murl::Graph::IButton::GetButtonState ( ) const
pure virtual

Get the current button state.

Returns
The current button state.

The documentation for this interface was generated from the following file:
  • murl_graph_i_button.h


Copyright © 2011-2024 Spraylight GmbH.