C# Class Grafiti.GestureRecognizer

Base class of gesture recognizers (GRs). A GR, that is dynamically instantiated by Grafiti, processes data of a single instance of the class Group for the recognition of a gesture. In case of successful recognition the GR can be enabled to send gesture events to the registered listeners. A GR can be parametrized through a configuration at the time of registration of a handler.
Exibir arquivo Open project: nuigroup/grafiti Class Usage Examples

Private Properties

Property Type Description
AddHandler void
GetEventInfo System.Reflection.EventInfo
OnTerminating1 void
Process1 void
RaisePendlingEvents void

Public Methods

Method Description
GestureRecognizer ( GRConfiguration configuration ) : System
Process ( List traces ) : void

The main function that will process the user input. It will be called on every refresh of the TUIO messages.

Protected Methods

Method Description
AppendEvent ( GestureEventHandler ev, GestureEventArgs args ) : void

Use this method to send events. If the GR is not armed (e.g. it's in competition with other GRs), events will be scheduled in a queue and raised as soon as the GR will be armed. If the GR is already armed, events are raised immediately.

OnTerminating ( ) : void

Called when the GR is going to be removed from the list of active GRs and thus it won't be called anymore. Override this to handle the finalization of the GR if needed, like terminating threads, freeing resources, send terminating events... From now on, recognition state transitions will be in fact ignored. Note: at least one of the following reasons causes this method to be called: - the GR has been explicitly put in the 'terminated' state through one of the relative methods called in its Process function - the group ceased to be active i.e. all the fingers have been removed for a sufficient time, such that the traces can't be reset anymore - an exclusive GR with precedence has won In case of an LGR the following reasons are also possible: - its target has been removed from the group's LGR-list - an LGR with different target has the precedence and has won

Terminate ( bool successful ) : void
Terminate ( bool successful, float confidence ) : void
ValidateGesture ( ) : void
ValidateGesture ( float confidence ) : void

Private Methods

Method Description
AddHandler ( string ev, GestureEventHandler handler ) : void
GetEventInfo ( string ev ) : EventInfo
OnTerminating1 ( ) : void
Process1 ( List traces ) : void
RaisePendlingEvents ( ) : void

Method Details

AppendEvent() protected method

Use this method to send events. If the GR is not armed (e.g. it's in competition with other GRs), events will be scheduled in a queue and raised as soon as the GR will be armed. If the GR is already armed, events are raised immediately.
protected AppendEvent ( GestureEventHandler ev, GestureEventArgs args ) : void
ev GestureEventHandler The event
args GestureEventArgs The event's arguments
return void

GestureRecognizer() public method

public GestureRecognizer ( GRConfiguration configuration ) : System
configuration GRConfiguration
return System

OnTerminating() protected method

Called when the GR is going to be removed from the list of active GRs and thus it won't be called anymore. Override this to handle the finalization of the GR if needed, like terminating threads, freeing resources, send terminating events... From now on, recognition state transitions will be in fact ignored. Note: at least one of the following reasons causes this method to be called: - the GR has been explicitly put in the 'terminated' state through one of the relative methods called in its Process function - the group ceased to be active i.e. all the fingers have been removed for a sufficient time, such that the traces can't be reset anymore - an exclusive GR with precedence has won In case of an LGR the following reasons are also possible: - its target has been removed from the group's LGR-list - an LGR with different target has the precedence and has won
protected OnTerminating ( ) : void
return void

Process() public abstract method

The main function that will process the user input. It will be called on every refresh of the TUIO messages.
public abstract Process ( List traces ) : void
traces List The list of the updated traces, to which one element has been added to their cursor list.
return void

Terminate() protected method

protected Terminate ( bool successful ) : void
successful bool
return void

Terminate() protected method

protected Terminate ( bool successful, float confidence ) : void
successful bool
confidence float
return void

ValidateGesture() protected method

protected ValidateGesture ( ) : void
return void

ValidateGesture() protected method

protected ValidateGesture ( float confidence ) : void
confidence float
return void