Hoops Visualize HPS  version 2018-SP2
Hoops Visualize HPS 3D Rendering Engine
Looking for a senior C++ dev?
I'm looking for work. Hire me!
HPS::TouchEvent Class Reference

The TouchEvent class is the event generated for each touch action on a multi-touch device. More...

#include <hps.h>

Inheritance diagram for HPS::TouchEvent:
Collaboration diagram for HPS::TouchEvent:

Public Types

enum  Action : uint32_t {
  Action::TouchDown,
  Action::TouchUp,
  Action::Move
}
 Enumeration of various actions touches can undergo for a TouchEvent. More...
 
enum  Status : uint32_t {
  Status::InProgress,
  Status::Completed,
  Status::Failed
}
 Event Status - returned from a notifier to give the status of the event. More...
 

Public Member Functions

 TouchEvent ()
 The default constructor creates an uninitialized TouchEvent object. More...
 
 TouchEvent (Action in_action, ModifierKeys in_modifier=ModifierKeys())
 This constructor creates a TouchEvent object for a given action without an array of Touches. More...
 
 TouchEvent (Action in_action, TouchArray const &in_touches, ModifierKeys in_modifier=ModifierKeys())
 This constructor creates a TouchEvent object for a given action with an array of Touches. More...
 
 TouchEvent (Action in_action, size_t in_touch_count, Touch const in_touches[], ModifierKeys in_modifier=ModifierKeys())
 This constructor creates a TouchEvent object for a given action with an array of Touches. More...
 
 TouchEvent (Event const &in_event)
 This constructor converts an Event Object to a TouchEvent object. More...
 
 ~TouchEvent ()
 
EventClone () const
 Allocates and returns a copy of this TouchEvent. More...
 
virtual bool Equals (InputEvent const &in_that) const
 Check if the source object is equivalent to this object. More...
 
bool Equals (TouchEvent const &in_that) const
 Check if the source object is equivalent to this object. More...
 
virtual bool operator== (TouchEvent const &in_that) const
 Check if the source object is equivalent to this object. More...
 
virtual bool operator!= (TouchEvent const &in_that) const
 Check if the source object is not equivalent to this object. More...
 
virtual bool Drop (Event const *in_that_event) const
 Determines if this TouchEvent can be dropped in favor of the following touch event. More...
 
virtual bool operator== (InputEvent const &in_that) const
 Check if the source object is equivalent to this object. More...
 
virtual bool operator!= (InputEvent const &in_that) const
 Check if the source object is not equivalent to this object. More...
 
ModifierKeys GetModifierKeys () const
 Queries which modifier keys are active. More...
 
intptr_t GetClassID () const
 Returns a unique identifier that is shared by all objects of the same class. More...
 
virtual intptr_t Freshen () const
 This optional function is used to determine if the current event can be dropped in favor of newer event of the same type if one is available. More...
 
intptr_t GetChannel () const
 Returns the channel ID assigned to an event. More...
 
Time GetTimeStamp () const
 Returns the time an event was injected into the event queue. More...
 
bool IsConsumable () const
 Indicates whether an event will be consumed when it is handled or passed on to the next handler anyway. More...
 

Static Public Member Functions

static void * operator new (size_t in_size)
 
static void operator delete (void *in_ptr, size_t in_size) throw ()
 

Public Attributes

HPS::TouchEvent::Action CurrentAction
 The action for the touches of this TouchEvent. More...
 
HPS::TouchArray Touches
 Array of Touches for this TouchEvent. More...
 
ModifierKeys ModifierKeyState
 The modifier keys which are active for this InputEvent. More...
 

Protected Attributes

intptr_t channel
 
bool consumable
 

Static Private Member Functions

static bool sort_predicate (Touch const &in_a, Touch const &in_b)
 Private method used for sorting Touch objects. More...
 

Detailed Description

The TouchEvent class is the event generated for each touch action on a multi-touch device.

Member Enumeration Documentation

◆ Action

enum HPS::TouchEvent::Action : uint32_t
strong

Enumeration of various actions touches can undergo for a TouchEvent.

Enumerator
TouchDown 

A touch, or touches, has just gone down.

TouchUp 

A touch, or touches, has just gone up.

Move 

A touch, or touches, has just moved.

◆ Status

enum HPS::Event::Status : uint32_t
stronginherited

Event Status - returned from a notifier to give the status of the event.

Enumerator
InProgress 

Event is still in progress.

Completed 

Event has completed.

Failed 

Event failed.

Constructor & Destructor Documentation

◆ TouchEvent() [1/5]

HPS::TouchEvent::TouchEvent ( )
inline

The default constructor creates an uninitialized TouchEvent object.

◆ TouchEvent() [2/5]

HPS::TouchEvent::TouchEvent ( Action  in_action,
ModifierKeys  in_modifier = ModifierKeys() 
)
inline

This constructor creates a TouchEvent object for a given action without an array of Touches.

Specifying TouchUp without an array of Touches clears tracked touches.

Parameters
in_actionAction of this TouchEvent.
in_modifierThe modifier keys for this TouchEvent.

◆ TouchEvent() [3/5]

HPS::TouchEvent::TouchEvent ( Action  in_action,
TouchArray const &  in_touches,
ModifierKeys  in_modifier = ModifierKeys() 
)
inline

This constructor creates a TouchEvent object for a given action with an array of Touches.

Specifying TouchUp with an empty an array of Touches clears tracked touches.

Parameters
in_actionAction of this TouchEvent.
in_touchesAn array or touches for this TouchEvent.
in_modifierThe modifier keys for this TouchEvent.

◆ TouchEvent() [4/5]

HPS::TouchEvent::TouchEvent ( Action  in_action,
size_t  in_touch_count,
Touch const  in_touches[],
ModifierKeys  in_modifier = ModifierKeys() 
)
inline

This constructor creates a TouchEvent object for a given action with an array of Touches.

Specifying TouchUp with an empty an array of Touches clears tracked touches.

Parameters
in_actionAction of this TouchEvent.
in_touch_countthe number of Touches in the touch array.
in_touchesAn array or touches for this TouchEvent.
in_modifierThe modifier keys for this TouchEvent.

◆ TouchEvent() [5/5]

HPS::TouchEvent::TouchEvent ( Event const &  in_event)
inline

This constructor converts an Event Object to a TouchEvent object.

Parameters
in_eventThe Event Object to be converted.
Here is the call graph for this function:

◆ ~TouchEvent()

HPS::TouchEvent::~TouchEvent ( )

Member Function Documentation

◆ Clone()

Event* HPS::TouchEvent::Clone ( ) const
inlinevirtual

Allocates and returns a copy of this TouchEvent.

Returns
A copy of this TouchEvent.

Reimplemented from HPS::InputEvent.

◆ Drop()

virtual bool HPS::TouchEvent::Drop ( Event const *  in_that_event) const
inlinevirtual

Determines if this TouchEvent can be dropped in favor of the following touch event.

Parameters
in_that_eventEvent to compare with this TouchEvent.
Returns
true if this event can be dropped, false otherwise.

Reimplemented from HPS::Event.

◆ Equals() [1/2]

virtual bool HPS::TouchEvent::Equals ( InputEvent const &  in_that) const
inlinevirtual

Check if the source object is equivalent to this object.

Parameters
in_kitThe source object to compare to this object.
Returns
true if the objects are equivalent, false otherwise.

Reimplemented from HPS::InputEvent.

Here is the call graph for this function:

◆ Equals() [2/2]

bool HPS::TouchEvent::Equals ( TouchEvent const &  in_that) const
inline

Check if the source object is equivalent to this object.

Parameters
in_thatThe source object to compare to this object.
Returns
true if the objects are equivalent, false otherwise.
Here is the call graph for this function:

◆ Freshen()

virtual intptr_t HPS::Event::Freshen ( ) const
inlinevirtualinherited

This optional function is used to determine if the current event can be dropped in favor of newer event of the same type if one is available.

Returns
A cookie representing the freshen category. Zero indicates a non-freshening event.

Reimplemented in HPS::MouseEvent, HPS::TimerTickEvent, and HPS::CameraChangedEvent.

◆ GetChannel()

intptr_t HPS::Event::GetChannel ( ) const
inlineinherited

Returns the channel ID assigned to an event.

Here is the caller graph for this function:

◆ GetClassID()

intptr_t HPS::Event::GetClassID ( ) const
inherited

Returns a unique identifier that is shared by all objects of the same class.

Here is the caller graph for this function:

◆ GetModifierKeys()

ModifierKeys HPS::InputEvent::GetModifierKeys ( ) const
inlineinherited

Queries which modifier keys are active.

Returns
A ModifierKeys object, which represents which modifier keys are active

◆ GetTimeStamp()

Time HPS::Event::GetTimeStamp ( ) const
inlineinherited

Returns the time an event was injected into the event queue.

◆ IsConsumable()

bool HPS::Event::IsConsumable ( ) const
inlineinherited

Indicates whether an event will be consumed when it is handled or passed on to the next handler anyway.

◆ operator delete()

static void HPS::Event::operator delete ( void *  in_ptr,
size_t  in_size 
)
throw (
)
inlinestaticinherited
Here is the call graph for this function:

◆ operator new()

static void* HPS::Event::operator new ( size_t  in_size)
inlinestaticinherited
Here is the call graph for this function:

◆ operator!=() [1/2]

virtual bool HPS::InputEvent::operator!= ( InputEvent const &  in_that) const
inlinevirtualinherited

Check if the source object is not equivalent to this object.

Parameters
in_thatThe source object to compare to this object.
Returns
true if the objects are not equivalent, false otherwise.

◆ operator!=() [2/2]

virtual bool HPS::TouchEvent::operator!= ( TouchEvent const &  in_that) const
inlinevirtual

Check if the source object is not equivalent to this object.

Parameters
in_kitThe source object to compare to this object.
Returns
true if the objects are not equivalent, false otherwise.

◆ operator==() [1/2]

virtual bool HPS::InputEvent::operator== ( InputEvent const &  in_that) const
inlinevirtualinherited

Check if the source object is equivalent to this object.

Parameters
in_thatThe source object to compare to this object.
Returns
true if the objects are equivalent, false otherwise.

◆ operator==() [2/2]

virtual bool HPS::TouchEvent::operator== ( TouchEvent const &  in_that) const
inlinevirtual

Check if the source object is equivalent to this object.

Parameters
in_kitThe source object to compare to this object.
Returns
true if the objects are equivalent, false otherwise.

◆ sort_predicate()

static bool HPS::TouchEvent::sort_predicate ( Touch const &  in_a,
Touch const &  in_b 
)
inlinestaticprivate

Private method used for sorting Touch objects.

Parameters
in_aFirst Touch to compare with the second Touch.
in_bSecond Touch to compare with the first Touch.
Returns
true if the first Touch should be placed before the second Touch, false otherwise.

Member Data Documentation

◆ channel

intptr_t HPS::Event::channel
protectedinherited

◆ consumable

bool HPS::Event::consumable
protectedinherited

◆ CurrentAction

HPS::TouchEvent::Action HPS::TouchEvent::CurrentAction

The action for the touches of this TouchEvent.

◆ ModifierKeyState

ModifierKeys HPS::InputEvent::ModifierKeyState
inherited

The modifier keys which are active for this InputEvent.

◆ Touches

HPS::TouchArray HPS::TouchEvent::Touches

Array of Touches for this TouchEvent.


The documentation for this class was generated from the following file: