public class SoTouchEvent extends SoEvent
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
Modifier and Type | Class and Description |
---|---|
static class |
SoTouchEvent.States
The different states a touch event can have.
|
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoTouchEvent()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SbVec2f |
getAcceleration()
Gets the acceleration vector (in pixels per second squared) between the previous event and the current one.
|
SbVec2f |
getDisplacement()
Gets the deplacement vector (in pixels) between the previous event and the current one.
|
SbTime |
getElapsedTimeSincePreviousEvent()
Gets the elapsed time since previous event, triggered by the same finger, in seconds.
|
SbTime |
getElapsedTimeUntilPreviousEvent()
Gets the elapsed time between the first contact and previous event, for the finger identified by
getFingerId() , in seconds. |
long |
getFingerId()
Gets the id of the finger triggering this event.
|
SbTime |
getFirstContactTime()
Gets the time of first contact in seconds of the finger identified by
getFingerId() . |
SbVec2f |
getFirstPosition()
Gets the first position (in pixels).
|
SbTime |
getPreviousEventTime()
Gets the time of previous event of the finger identified by
getFingerId() . |
SbVec2f |
getPreviousPosition()
Gets the previous position of the same finger (in pixels).
|
SbVec2f |
getPreviousSpeed()
Gets the previous speed (in pixels per second).
|
SbVec2f |
getSpeed()
Gets the speed (in pixels per second) between the previous event and the current one.
|
SoTouchEvent.States |
getState()
Gets the touch event state (Up, Down, Move or Unknown).
|
SoTouchManager |
getTouchManager()
Gets the corresponding TouchManager for this event.
|
void |
setFingerId(long idFinger)
Sets the id of the finger triggering this event.
|
void |
setFirstPosition(SbVec2f name_23844)
Sets the first position (in pixels).
|
void |
setPreviousSpeed()
Sets the previous speed in pixels per second.
|
void |
setState(SoTouchEvent.States b)
Sets the state of the touch event.
|
void |
setTouchManager(SoTouchManager manager)
Sets the TouchManager for this event.
|
getNormalizedPosition, getPosition, getPosition, getPositionFloat, getPositionFloat, getTime, setAltDown, setButton1Down, setCtrlDown, setPosition, setPosition, setShiftDown, setTime, wasAltDown, wasButton1Down, wasCtrlDown, wasShiftDown
dispose, getNativeResourceHandle
public void setFingerId(long idFinger)
public long getFingerId()
public SbVec2f getAcceleration()
public void setFirstPosition(SbVec2f name_23844)
public void setPreviousSpeed()
public SoTouchEvent.States getState()
public SbVec2f getSpeed()
public SoTouchManager getTouchManager()
public SbTime getPreviousEventTime()
getFingerId()
.
If current event is a DOWN, the function returns the current time.public SbVec2f getDisplacement()
public SbVec2f getPreviousPosition()
public SbVec2f getPreviousSpeed()
public SbTime getFirstContactTime()
getFingerId()
.
This date is set when the DOWN event occurs.public void setState(SoTouchEvent.States b)
public SbTime getElapsedTimeSincePreviousEvent()
public void setTouchManager(SoTouchManager manager)
public SbTime getElapsedTimeUntilPreviousEvent()
getFingerId()
, in seconds.public SbVec2f getFirstPosition()
Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com