SoTouchEvent Class Reference

Base class for touch events. More...

#include <Inventor/touch/events/SoTouchEvent.h>

Inheritance diagram for SoTouchEvent:
SoEvent SoTypedObject

List of all members.

Public Types

enum  State {
  UNKNOWN,
  UP,
  DOWN,
  MOVE
}

Public Member Functions

virtual SoType getTypeId () const
 SoTouchEvent ()
State getState () const
unsigned long getFingerId () const
SbTime getElapsedTimeSincePreviousEvent () const
SbTime getFirstContactTime () const
SbTime getElapsedTimeUntilPreviousEvent () const
SbTime getPreviousEventTime () const
SbVec2f getSpeed () const
SbVec2f getPreviousPosition () const
SbVec2f getDisplacement () const
SbVec2f getAcceleration () const
SbVec2f getPreviousSpeed () const
SoTouchManagergetTouchManager () const
void setTouchManager (SoTouchManager *manager)
SbVec2f getFirstPosition () const
void setState (SoTouchEvent::State b)
void setFingerId (unsigned long idFinger)
virtual void setPosition (const SbVec2f &p)
virtual void setPosition (const SbVec2s &p)
virtual void setTime (SbTime t)
void setPreviousSpeed ()
void setFirstPosition (SbVec2f)

Static Public Member Functions

static SoType getClassTypeId ()

Detailed Description

Base class for touch events.

SoTouchEvent is the base class for touch events in the Open Inventor event model. A touch event typically represents a user finger action on a touch screen input device, such as putting a finger down on the screen. SoTouchEvent is an SoEvent with touch information including the displacement and speed of the finger and the state (UP, DOWN or MOVE).

The SoTouchEvent::getTouchManager() method can be use to retrieve the corresponding touch device currently used and information about other fingers touching the screen at the same time.

Open Inventor also supports gesture events (see SoGestureEvent) such as pinch and rotate. Gesture events are generated by gesture recognizers (see SoGestureRecognizer) which analyze a series of touch events.

Note: Unlike mouse and keyboard events, the application must explicitly register a touch screen device (SoWinTouchScreen, SoQtTouchScreen, etc) in order to get touch events.

SEE ALSO

SoEvent, SoButtonEvent, SoMouseButtonEvent, SoKeyboardEvent, SoLocation2Event, SoMotion3Event, SoSpaceballButtonEvent, SoTouchManager

See related examples:

DragGestureRecognizer, FingerDraw, TouchInertia


Member Enumeration Documentation

The different states a touch event can have.

Enumerator:
UNKNOWN 

Unknown state.

UP 

Up state : The finger is off the screen.

DOWN 

Down state : The finger is on the screen.

MOVE 

Move state : The finger is moving on the screen.


Constructor & Destructor Documentation

SoTouchEvent::SoTouchEvent (  ) 

Constructor.


Member Function Documentation

SbVec2f SoTouchEvent::getAcceleration (  )  const

Gets the acceleration vector (in pixels per second squared) between the previous event and the current one.

static SoType SoTouchEvent::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoEvent.

SbVec2f SoTouchEvent::getDisplacement (  )  const

Gets the deplacement vector (in pixels) between the previous event and the current one.

SbTime SoTouchEvent::getElapsedTimeSincePreviousEvent (  )  const

Gets the elapsed time since previous event, triggered by the same finger, in seconds.

If the current event is a DOWN, the function returns 0.

SbTime SoTouchEvent::getElapsedTimeUntilPreviousEvent (  )  const

Gets the elapsed time between the first contact and previous event, for the finger identified by getFingerId(), in seconds.

unsigned long SoTouchEvent::getFingerId (  )  const

Gets the id of the finger triggering this event.

SbTime SoTouchEvent::getFirstContactTime (  )  const

Gets the time of first contact in seconds of the finger identified by getFingerId().

This date is set when the DOWN event occurs.

SbVec2f SoTouchEvent::getFirstPosition (  )  const

Gets the first position (in pixels).

This position is set when the DOWN event occurs.

SbTime SoTouchEvent::getPreviousEventTime (  )  const

Gets the time of previous event of the finger identified by getFingerId().

If current event is a DOWN, the function returns the current time.

SbVec2f SoTouchEvent::getPreviousPosition (  )  const

Gets the previous position of the same finger (in pixels).

If current event is a DOWN, the function returns the current position.

SbVec2f SoTouchEvent::getPreviousSpeed (  )  const

Gets the previous speed (in pixels per second).

SbVec2f SoTouchEvent::getSpeed (  )  const

Gets the speed (in pixels per second) between the previous event and the current one.

State SoTouchEvent::getState (  )  const

Gets the touch event state (Up, Down, Move or Unknown).

Use enum State.

SoTouchManager* SoTouchEvent::getTouchManager (  )  const

Gets the corresponding TouchManager for this event.

virtual SoType SoTouchEvent::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoEvent.

void SoTouchEvent::setFingerId ( unsigned long  idFinger  ) 

Sets the id of the finger triggering this event.

void SoTouchEvent::setFirstPosition ( SbVec2f   ) 

Sets the first position (in pixels).

virtual void SoTouchEvent::setPosition ( const SbVec2s p  )  [virtual]

Sets the window pixel location of the cursor when the event occurred.

The position is relative to the lower left corner of the window in which the event occurred.

Reimplemented from SoEvent.

virtual void SoTouchEvent::setPosition ( const SbVec2f p  )  [virtual]

Sets the current position (in pixels) and the displacement vector.

Reimplemented from SoEvent.

void SoTouchEvent::setPreviousSpeed (  ) 

Sets the previous speed in pixels per second.

void SoTouchEvent::setState ( SoTouchEvent::State  b  ) 

Sets the state of the touch event.

virtual void SoTouchEvent::setTime ( SbTime  t  )  [virtual]

Sets the time at which the event occurred.

Reimplemented from SoEvent.

void SoTouchEvent::setTouchManager ( SoTouchManager manager  ) 

Sets the TouchManager for this event.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/