public class SoTouchManager extends Inventor
SoTouchEvent
table and a finger ids table which are updated each time a finger moves. A touch manager has a list of gesture recognizers that generate events when the gesture is recognized. By default, the list is empty and recognizers must be added to generate the corresponding events. The addDefaultRecognizers()
method is provided for convenience.
Note that all registered gesture recognizers are active simultaneously. During a gesture event, events may generated for a different gesture. The application is responsible for enforcing a "one gesture at a time" policy if appropriate.
Note: Unlike mouse and keyboard events, the application must explicitly register a touch screen device (e.g. SoWinTouchScreen) in order to get touch events.
Get the touch manager from the touch device to register gesture recognizers. Not available
See also:
SoQtTouchScreen, SoWinTouchScreen, SoTouchEvent
, SoGestureEvent
, SoGestureRecognizer
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoTouchManager() |
SoTouchManager(SoSceneManager sM)
Deprecated.
As of Open Inventor 9500 See documentation for more details
|
Modifier and Type | Method and Description |
---|---|
void |
addDefaultRecognizers()
Add a default list of recognizers to the recognizer list.
|
void |
addRecognizer(SoGestureRecognizer recognizer)
Add a gesture recognizer to the recognizer list.
|
long[] |
getAllFingerIds()
Get the table with ids of all fingers touching the screen.
|
SoTouchEvent |
getEventById(long id)
Get the corresponding event for the finger id, NULL if id is incorrect.
|
SoTouchEvent |
getEventbyIndex(int index)
Get the corresponding event for the index, NULL if index is incorrect.
|
int |
getFingerNumber()
Get the current number of fingers touching the screen.
|
int |
getMaxSimultaneousFingers()
Get the maximum number of simultaneous fingers supported by the device.
|
java.util.ArrayList<SoGestureRecognizer> |
getRecognizerList()
Returns the gesture recognizers list.
|
float |
getThreshold()
Get the detection threshold (in pixels).
|
java.util.ArrayList<SoEvent> |
getTouchDownEvent(long fingerId,
SbVec2f fingerPos,
SbTime time)
Translate the given touch down event into a list of
SoEvent . |
java.util.ArrayList<SoEvent> |
getTouchMoveEvent(long fingerId,
SbVec2f fingerPos,
SbTime time)
Translate the given touch move event into a list of
SoEvent . |
java.util.ArrayList<SoEvent> |
getTouchUpEvent(long fingerId,
SbVec2f fingerPos,
SbTime time)
Translate the given touch up event into a list of
SoEvent . |
boolean |
isTouchScreenAvailable()
Returns true if the touch screen device is available, false otherwise.
|
void |
removeDefaultRecognizers()
Remove the default recognizers from the recognizer list.
|
void |
removeRecognizer(SoGestureRecognizer gesture)
Remove a gesture recognizer from the recognizer list.
|
void |
setMaxSimultaneousFingers(int fingers)
Set the maximum number of simultaneous fingers supported by the device.
|
void |
setThreshold(float t)
Set the detection threshold (0.0001 pixels by default).
|
void |
setTouchScreenAvailability(boolean available)
Set the touch screen availability.
|
SoTouchEvent |
updateAndProcessTouchEvent(long id,
SoTouchEvent.States state,
SbVec2f position,
SbTime time)
Deprecated.
As of Open Inventor 9500 See documentation for more details
|
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public SoTouchManager(SoSceneManager sM)
public SoTouchManager()
public void addRecognizer(SoGestureRecognizer recognizer)
public void removeRecognizer(SoGestureRecognizer gesture)
@Deprecated public SoTouchEvent updateAndProcessTouchEvent(long id, SoTouchEvent.States state, SbVec2f position, SbTime time)
SoRenderAreaCore
instead. public int getMaxSimultaneousFingers()
public void setMaxSimultaneousFingers(int fingers)
public int getFingerNumber()
public SoTouchEvent getEventById(long id)
public long[] getAllFingerIds()
public SoTouchEvent getEventbyIndex(int index)
getFingerNumber()
to know the number of fingers touching the screen.public void setTouchScreenAvailability(boolean available)
public java.util.ArrayList<SoEvent> getTouchDownEvent(long fingerId, SbVec2f fingerPos, SbTime time)
SoEvent
.
This list may contain some recognized SoGestureEvent
.
fingerId
- id of the finger used.
fingerPos
- position of the finger in pixels.
time
- timestamp of the touch event in seconds.public java.util.ArrayList<SoGestureRecognizer> getRecognizerList()
public void addDefaultRecognizers()
public void removeDefaultRecognizers()
addDefaultRecognizers()
.public java.util.ArrayList<SoEvent> getTouchMoveEvent(long fingerId, SbVec2f fingerPos, SbTime time)
SoEvent
.
This list may contain some recognized SoGestureEvent
.
fingerId
- id of the finger used.
fingerPos
- position of the finger in pixels.
time
- timestamp of the touch event in seconds.public void setThreshold(float t)
public float getThreshold()
public boolean isTouchScreenAvailable()
public java.util.ArrayList<SoEvent> getTouchUpEvent(long fingerId, SbVec2f fingerPos, SbTime time)
SoEvent
.
This list may contain some recognized SoGestureEvent
.
fingerId
- id of the finger used.
fingerPos
- position of the finger in pixels.
time
- timestamp of the touch event in seconds.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com