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::MouseEvent Class Reference

The MouseEvent class is the event generated for each mouse action. More...

#include <hps.h>

Inheritance diagram for HPS::MouseEvent:
Collaboration diagram for HPS::MouseEvent:

Public Types

enum  Action : uint32_t {
  Action::ButtonUp,
  Action::ButtonDown,
  Action::Move,
  Action::Scroll,
  Action::Enter,
  Action::Leave
}
 Enumeration of various actions a mouse can undergo for a MouseEvent. 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

 MouseEvent ()
 The default constructor creates an uninitialized MouseEvent object. More...
 
 MouseEvent (Action in_action, WindowPoint in_location, MouseButtons in_button=MouseButtons(), ModifierKeys in_modifier=ModifierKeys(), size_t in_click_count=0)
 This constructor creates a MouseEvent object for a given action. More...
 
 MouseEvent (Action in_action, float in_wheel_delta, WindowPoint in_location=WindowPoint(0, 0, 0), ModifierKeys in_modifier=ModifierKeys(), size_t in_click_count=0)
 This constructor creates a MouseEvent object, most useful for a wheel action. More...
 
 MouseEvent (Event const &in_event)
 This constructor converts an Event Object to a MouseEvent object. More...
 
 ~MouseEvent ()
 
EventClone () const
 Allocates and returns a copy of this MouseEvent. More...
 
virtual bool Equals (InputEvent const &in_that) const
 Check if the source object is equivalent to this object. More...
 
virtual bool Equals (MouseEvent const &in_that) const
 Check if the source object is equivalent to this object. More...
 
virtual bool operator== (MouseEvent const &in_that) const
 Check if the source object is equivalent to this object. More...
 
virtual bool operator!= (MouseEvent 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 MouseEvent can be dropped in favor of the following mouse event. 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...
 
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...
 
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::MouseEvent::Action CurrentAction
 The action for this MouseEvent. More...
 
WindowPoint Location
 Location in window space of the mouse cursor. More...
 
HPS::MouseButtons CurrentButton
 If the action involves a button, this is the button. More...
 
float WheelDelta
 If the action involves the mouse wheel, this is the amount the wheel moved. More...
 
size_t ClickCount
 The number of clicks received. More...
 
ModifierKeys ModifierKeyState
 The modifier keys which are active for this InputEvent. More...
 

Protected Attributes

intptr_t channel
 
bool consumable
 

Detailed Description

The MouseEvent class is the event generated for each mouse action.

Member Enumeration Documentation

◆ Action

enum HPS::MouseEvent::Action : uint32_t
strong

Enumeration of various actions a mouse can undergo for a MouseEvent.

Enumerator
ButtonUp 
ButtonDown 

A mouse button has been released.

Move 

A mouse button has been pressed.

Scroll 

The mouse location has changed.

Enter 

The scroll wheel has been moved.

Leave 

The mouse cursor has moved into the active window.

The mouse cursor has moved out of the active window.

◆ 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

◆ MouseEvent() [1/4]

HPS::MouseEvent::MouseEvent ( )
inline

The default constructor creates an uninitialized MouseEvent object.

◆ MouseEvent() [2/4]

HPS::MouseEvent::MouseEvent ( Action  in_action,
WindowPoint  in_location,
MouseButtons  in_button = MouseButtons(),
ModifierKeys  in_modifier = ModifierKeys(),
size_t  in_click_count = 0 
)
inline

This constructor creates a MouseEvent object for a given action.

Parameters
in_actionAction of this MouseEvent.
in_locationThe location in window space of the mouse cursor.
in_buttonIf the action is a button event, this is the button.
in_modifierThe modifier keys for this MouseEvent.
in_click_countThe number of clicks received.

◆ MouseEvent() [3/4]

HPS::MouseEvent::MouseEvent ( Action  in_action,
float  in_wheel_delta,
WindowPoint  in_location = WindowPoint(0,0,0),
ModifierKeys  in_modifier = ModifierKeys(),
size_t  in_click_count = 0 
)
inline

This constructor creates a MouseEvent object, most useful for a wheel action.

Parameters
in_actionAction of the mouse for this MouseEvent.
in_wheel_deltaIf the action involves the mouse wheel, this is the amount the wheel moved. It is positive if the mouse wheel is moved forward (away from the user) or negative if the mouse wheel is moved downward (toward the user).
in_locationThe location in window space of the mouse cursor.
in_modifierThe modifier keys for this MouseEvent.
in_click_countThe number of clicks received.

◆ MouseEvent() [4/4]

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

This constructor converts an Event Object to a MouseEvent object.

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

◆ ~MouseEvent()

HPS::MouseEvent::~MouseEvent ( )

Member Function Documentation

◆ Clone()

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

Allocates and returns a copy of this MouseEvent.

Returns
A copy of this MouseEvent.

Reimplemented from HPS::InputEvent.

◆ Drop()

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

Determines if this MouseEvent can be dropped in favor of the following mouse event.

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

Reimplemented from HPS::Event.

◆ Equals() [1/2]

virtual bool HPS::MouseEvent::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]

virtual bool HPS::MouseEvent::Equals ( MouseEvent const &  in_that) const
inlinevirtual

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::MouseEvent::Freshen ( ) const
inlinevirtual

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 from HPS::Event.

◆ 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::MouseEvent::operator!= ( MouseEvent 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::MouseEvent::operator== ( MouseEvent 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.

Member Data Documentation

◆ channel

intptr_t HPS::Event::channel
protectedinherited

◆ ClickCount

size_t HPS::MouseEvent::ClickCount

The number of clicks received.

◆ consumable

bool HPS::Event::consumable
protectedinherited

◆ CurrentAction

HPS::MouseEvent::Action HPS::MouseEvent::CurrentAction

The action for this MouseEvent.

◆ CurrentButton

HPS::MouseButtons HPS::MouseEvent::CurrentButton

If the action involves a button, this is the button.

◆ Location

WindowPoint HPS::MouseEvent::Location

Location in window space of the mouse cursor.

◆ ModifierKeyState

ModifierKeys HPS::InputEvent::ModifierKeyState
inherited

The modifier keys which are active for this InputEvent.

◆ WheelDelta

float HPS::MouseEvent::WheelDelta

If the action involves the mouse wheel, this is the amount the wheel moved.

It is positive if the mouse wheel is moved forward (away from the user) or negative if the mouse wheel is moved downward (toward the user).


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