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.
Afficher le fichier Open project: nuigroup/grafiti Class Usage Examples

Private Properties

Свойство Type Description
AddHandler void
GetEventInfo System.Reflection.EventInfo
OnTerminating1 void
Process1 void
RaisePendlingEvents void

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

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

Method Details

AppendEvent() protected méthode

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
Résultat void

GestureRecognizer() public méthode

public GestureRecognizer ( GRConfiguration configuration ) : System
configuration GRConfiguration
Résultat System

OnTerminating() protected méthode

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
Résultat void

Process() public abstract méthode

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.
Résultat void

Terminate() protected méthode

protected Terminate ( bool successful ) : void
successful bool
Résultat void

Terminate() protected méthode

protected Terminate ( bool successful, float confidence ) : void
successful bool
confidence float
Résultat void

ValidateGesture() protected méthode

protected ValidateGesture ( ) : void
Résultat void

ValidateGesture() protected méthode

protected ValidateGesture ( float confidence ) : void
confidence float
Résultat void