© 2006-2007 ETH Zurich

org.ximtec.igesture.io.tuio
Class TuioReader

java.lang.Object
  extended by org.ximtec.igesture.io.AbstractGestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>
      extended by org.ximtec.igesture.io.tuio.TuioReader
All Implemented Interfaces:
Device, Gesture3DDevice<RecordedGesture3D,Point3D>, GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>, TuioListener

public class TuioReader
extends AbstractGestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>
implements TuioListener, Gesture3DDevice<RecordedGesture3D,Point3D>

Reader that initializes the TuioConnection and handles the events caused by the TuioConnection. There are three ways to use the TuioReader. 1) Manually After performing the gesture, you can get the gesture with getGesture() or getGesture3D() and do the recognition. 2) GestureEventListener interface Register with the TuioReader as a GestureEventListener, it will notify you when a gesture was performed. The recognition of the performed gesture can then be done. 3) Configure the TuioReader with a Recogniser When a gesture was performed, the recogniser will automatically try to recognise the gesture and notify GestureHandlers. General steps to use: 1. create the TuioReader 2. connect to a tuio service 3. In case of GestureEventListener : register as a listener In case of Recogniser : set this TuioReaders recogniser 4. set the modifiers/tuio messages to listen for Note that this class is not fully compatible with the workbench.

Author:
Bjorn Puype, bpuype@gmail.com
See Also:
TuioConnection

Field Summary
protected  TuioConnection connection
          TUIO Connection used
protected  GestureSample gesture
           
protected  GestureSample3D gesture3D
           
protected  org.sigtec.ink.Note lastNoteAdded
           
protected  RecordedGesture3D lastRecordedGesture3DAdded
           
 
Constructor Summary
TuioReader()
          Default Constructor
TuioReader(int port)
          Constructor
 
Method Summary
 void addTuioCursor(AbstractTuioCursor atcur)
          This callback method is invoked by the TuioClient when a new TuioCursor is added to the session.
 void addTuioMessages(Set<String> modifiers)
          Set-up the processor to listen for and act on messages of the desired profiles.
 void addTuioObject(AbstractTuioObject atobj)
          This callback method is invoked by the TuioClient when a new TuioObject is added to the session.
 void clear()
          Deletes the current gesture.
 void connect()
          Connect the device.
 void disconnect()
          Disconnect the device.
 void dispose()
          Disposes the device.
 List<org.sigtec.ink.Point> getChunks()
          Returns chunks of a gesture while drawing it.
 List<Point3D> getChunks3D()
          Returns chunks of a gesture while drawing it.
 Gesture<org.sigtec.ink.Note> getGesture()
          Returns the gestures.
 Gesture<RecordedGesture3D> getGesture3D()
          Returns the gestures.
 TuioReaderPanel getPanel()
           
 TuioReaderPanel getPanel(Dimension dimension)
           
 void init()
          Initializes the device.
 void refresh(TuioTime ftime)
          This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle.
 void removeTuioCursor(AbstractTuioCursor atcur)
          This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session.
 void removeTuioMessages(Set<String> modifiers)
          Stop the processor of listening for and act on messages of the desired profiles.
 void removeTuioObject(AbstractTuioObject atobj)
          This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session.
 void setRecogniser(Recogniser recogniser)
          Set the recogniser to use.
 void updateTuioCursor(AbstractTuioCursor atcur)
          This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session.
 void updateTuioObject(AbstractTuioObject atobj)
          This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session.
 
Methods inherited from class org.ximtec.igesture.io.AbstractGestureDevice
addGestureHandler, fireGestureEvent, getConnectionType, getDeviceClass, getDeviceID, getDeviceType, getName, isConnectable, isConnected, isDefaultDevice, isDisconnectable, removeAllGestureHandler, removeAllListener, removeGestureHandler, setConnectionType, setDefaultDevice, setDeviceID, setDeviceType, setIsConnected, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ximtec.igesture.io.Gesture3DDevice
addGestureHandler, getConnectionType, getDeviceID, getDeviceType, getName, isConnectable, isConnected, isDefaultDevice, isDisconnectable, removeGestureHandler, setConnectionType, setDefaultDevice, setDeviceID, setDeviceType, setIsConnected, setName, toString
 

Field Detail

connection

protected TuioConnection connection
TUIO Connection used


gesture

protected GestureSample gesture

lastNoteAdded

protected org.sigtec.ink.Note lastNoteAdded

gesture3D

protected GestureSample3D gesture3D

lastRecordedGesture3DAdded

protected RecordedGesture3D lastRecordedGesture3DAdded
Constructor Detail

TuioReader

public TuioReader()
Default Constructor

Parameters:
recogniser - Recogniser to use.

TuioReader

public TuioReader(int port)
Constructor

Parameters:
port - Port to listen to.
Method Detail

setRecogniser

public void setRecogniser(Recogniser recogniser)
Set the recogniser to use.

Parameters:
recogniser - Recogniser to use.

connect

public void connect()
Description copied from interface: Device
Connect the device.

Specified by:
connect in interface Device
Specified by:
connect in interface Gesture3DDevice<RecordedGesture3D,Point3D>
Specified by:
connect in class AbstractGestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

disconnect

public void disconnect()
Description copied from interface: Device
Disconnect the device.

Specified by:
disconnect in interface Device
Specified by:
disconnect in interface Gesture3DDevice<RecordedGesture3D,Point3D>
Specified by:
disconnect in class AbstractGestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

clear

public void clear()
Description copied from interface: Gesture3DDevice
Deletes the current gesture.

Specified by:
clear in interface Gesture3DDevice<RecordedGesture3D,Point3D>
Specified by:
clear in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

dispose

public void dispose()
Description copied from interface: Gesture3DDevice
Disposes the device. After executing this method, gestures are not captured anymore and all dependent resources are released.

Specified by:
dispose in interface Gesture3DDevice<RecordedGesture3D,Point3D>
Specified by:
dispose in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

getChunks

public List<org.sigtec.ink.Point> getChunks()
Description copied from interface: GestureDevice
Returns chunks of a gesture while drawing it.

Specified by:
getChunks in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>
Returns:
chunks of a gesture.

getChunks3D

public List<Point3D> getChunks3D()
Description copied from interface: Gesture3DDevice
Returns chunks of a gesture while drawing it.

Specified by:
getChunks3D in interface Gesture3DDevice<RecordedGesture3D,Point3D>
Returns:
chunks of a gesture.

getGesture

public Gesture<org.sigtec.ink.Note> getGesture()
Description copied from interface: GestureDevice
Returns the gestures. This method should block, if no gesture is available.

Specified by:
getGesture in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>
Returns:
the gesture.

getGesture3D

public Gesture<RecordedGesture3D> getGesture3D()
Description copied from interface: Gesture3DDevice
Returns the gestures. This method should block, if no gesture is available.

Specified by:
getGesture3D in interface Gesture3DDevice<RecordedGesture3D,Point3D>
Returns:
the gesture.

init

public void init()
Description copied from interface: Gesture3DDevice
Initializes the device. After executing this method, gestures can be captured.

Specified by:
init in interface Gesture3DDevice<RecordedGesture3D,Point3D>
Specified by:
init in interface GestureDevice<org.sigtec.ink.Note,org.sigtec.ink.Point>

addTuioMessages

public void addTuioMessages(Set<String> modifiers)
Set-up the processor to listen for and act on messages of the desired profiles.

Parameters:
modifiers - the desired TUIO profiles

removeTuioMessages

public void removeTuioMessages(Set<String> modifiers)
Stop the processor of listening for and act on messages of the desired profiles.

Parameters:
modifiers - the desired TUIO profiles

addTuioCursor

public void addTuioCursor(AbstractTuioCursor atcur)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when a new TuioCursor is added to the session.

Specified by:
addTuioCursor in interface TuioListener
Parameters:
atcur - the TuioCursor reference associated to the addTuioCursor event

addTuioObject

public void addTuioObject(AbstractTuioObject atobj)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when a new TuioObject is added to the session.

Specified by:
addTuioObject in interface TuioListener
Parameters:
atobj - the TuioObject reference associated to the addTuioObject event

refresh

public void refresh(TuioTime ftime)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient to mark the end of a received TUIO message bundle.

Specified by:
refresh in interface TuioListener
Parameters:
ftime - the TuioTime associated to the current TUIO message bundle

removeTuioCursor

public void removeTuioCursor(AbstractTuioCursor atcur)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when an existing TuioCursor is removed from the session.

Specified by:
removeTuioCursor in interface TuioListener
Parameters:
atcur - the TuioCursor reference associated to the removeTuioCursor event

removeTuioObject

public void removeTuioObject(AbstractTuioObject atobj)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when an existing TuioObject is removed from the session.

Specified by:
removeTuioObject in interface TuioListener
Parameters:
atobj - the TuioObject reference associated to the removeTuioObject event

updateTuioCursor

public void updateTuioCursor(AbstractTuioCursor atcur)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when an existing TuioCursor is updated during the session.

Specified by:
updateTuioCursor in interface TuioListener
Parameters:
atcur - the TuioCursor reference associated to the updateTuioCursor event

updateTuioObject

public void updateTuioObject(AbstractTuioObject atobj)
Description copied from interface: TuioListener
This callback method is invoked by the TuioClient when an existing TuioObject is updated during the session.

Specified by:
updateTuioObject in interface TuioListener
Parameters:
atobj - the TuioObject reference associated to the updateTuioObject event

getPanel

public TuioReaderPanel getPanel()

getPanel

public TuioReaderPanel getPanel(Dimension dimension)

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.