Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

SMTG.cpp File Reference

#include "SMTG.h"
#include <windows.h>
#include <math.h>
#include <stdio.h>

Data Structures

struct  tagSGParameter
struct  tagSGTouch
struct  tagSGTouchSet
struct  tagSGTouchStroke
struct  tagSGEvent
struct  tagSGEventList
struct  tagSGNFingerTap

Defines

#define SG_MAX_TOUCH   255
#define SG_MAX_STROKE   2000
#define SG_MAX_EVENT   100
#define NO_GESTURE   -1
#define RAD2DEG   (180.0f/3.141592f)
#define DEG2RAD   (3.141592f/180.0f)

Typedefs

typedef struct tagSGParameter SGParameter
typedef struct tagSGTouch SGTouch
typedef struct tagSGTouchSet SGTouchSet
typedef struct tagSGTouchStroke SGTouchStroke
typedef struct tagSGEvent SGEvent
typedef struct tagSGEventList SGEventList
typedef struct tagSGNFingerTap SGNFingerTap

Enumerations

enum  SGGesture {
  SG_ETAP, SG_EDTAP, SG_EPINCH, SG_EROTATE,
  SG_NFINGERMOVE, SG_NFINGERSWIPE, SG_NFINGERHOLD
}
enum  SGState { SG_STATE_IDLE = 0, SG_STATE_TOUCH = 1 }
enum  SGInterpreterState {
  SG_INTERPRETER_STATE_PRETOUCH = 0, SG_INTERPRETER_STATE_IDLE = 1, SG_INTERPRETER_STATE_1FINGER_MOVE = 2, SG_INTERPRETER_STATE_2FINGER_MOVE = 3,
  SG_INTERPRETER_STATE_ROTATION = 4, SG_INTERPRETER_STATE_PINCH = 5
}

Functions

void initializeSGParameter (void)
void initializeSGTouchSet (void)
void initializeSGTouchStroke (void)
void initializeSGEventLish (void)
void initializeSGNFingerTap (void)
void InitializeSMTG (void)
void sg_updatetouchset ()
void sg_blobstotouchset (int nBlobsSize, int *pid, float *pfx, float *pfy, float *pfdx, float *pfdy)
void sg_statemachine ()
void find_firstandlast_index (int &f_index, int &l_index, int max_touch)
void euclidian_distance (float &dx, float &dy, float &pd, int f_index, int l_index)
void save_nfingertap (bool _flag, float _cx, float _cy, int _ntouch)
bool judge_Nfinger_tap (float d, int f_index, int l_index, int ntouch)
bool check_Nfinger_tap ()
bool check_Nfinger_swipe ()
bool judge_Nfinger_swipe (float dx, float dy, float d, int f_index, int l_index, int ntouch)
int check_same_id (float *pdx, float *pdy)
float compute_cos_theta (float dx0, float dy0, float dx1, float dy1)
bool judge_Nfinger_move (float *pcos_theta, int nfinger, float cx, float cy, float dx, float dy)
bool check_Nfinger_move ()
bool check_pinch_and_rotation ()
int sg_scale (void)
int sg_rotate (void)
void sgRecognizeGesture (int nBlobsSize, int *pid, float *pfx, float *pfy, float *pfdx, float *pfdy)
void sgInterpreteGesture (int application)
void interpreter_magic_mt_trackpad ()
void interpreter_starcraft2 ()
void sg_mtp_interpreter_statemachine ()
void sg_mtpETAP (int index)
void sg_mtpEDTAP (int index)
void sg_mtpNFINGERMOVE (int index)
void sg_mtpNFINGERSWIPE (int index)
void sg_mtpEPINCH (int index)
void sg_mtpEROTATE (int index)
void sg_mtpNFINGERHOLD (int index)
void sg_mtp1FingerTap_move ()
void sg_mtp1FingerDTap_move ()
void sg_mtpETAP_1touch (int index)
void sg_mtpETAP_2touch (int index)
void sg_mtpETAP_3touch (int index)
void sg_mtpETAP_4touch (int index)
void sg_mtpEDTAP_1touch (int index)
void sg_mtpNFINGERSWIPE_2touch (int index)
void sg_mtpNFINGERSWIPE_3touch (int index)
void sg_mtpNFINGERSWIPE_4touch (int index)
void sg_mtp_PRETOUCH_NFINGERSWIPE_2touch ()
void sg_mtp_PRETOUCH_NFINGERSWIPE_3touch ()
void sg_mtp_PRETOUCH_NFINGERSWIPE_4touch ()
void sg_star2ETAP (int index)
void sg_star2EDTAP (int index)
void sg_star2EPINCH (int index)
void sg_star2EROTATE (int index)
void sg_star2NFINGERMOVE (int index)
void sg_star2NFINGERSWIPE (int index)
void sg_star2NFINGERHOLD (int index)
void wm_Lbutton_down (int index)
void wm_Lbutton_up (int index)
void wm_Rbutton_down (int index)
void wm_Rbutton_up (int index)
void wm_mouse_move (int index)
void wm_mouse_wheel (int index)
void wm_mtp_rotation (int index)
void scroll_up ()
void scroll_down ()
void scroll_left ()
void scroll_right ()
void middle_button_up ()
void SetCoordinateMode (int mode)

Variables

SGParameter SG_PARAMETER
SGTouchSet SG_NEW_TOUCHSET
SGTouchSet SG_OLD_TOUCHSET
SGTouchStroke SG_TOUCH_STROKE
SGEventList SG_EVENT_LIST
SGNFingerTap SG_NFINGERTAP = {false, 0.0f, 0.0f, 0, 0}
SGState SG_STATE = SG_STATE_IDLE
SGInterpreterState SG_INTERPRETER_STATE = SG_INTERPRETER_STATE_PRETOUCH
unsigned long SG_PRETOUCH_START_TIME = 0
float ABSOLUTE_COORDINATE_X = 0.0f
float ABSOLUTE_COORDINATE_Y = 0.0f
float ACCUMULATION_DEGREE = 0.0f
float ACCUMULATION_SCALE = 1.0f
int SG_ANGLE
int SG_OLD_ANGLE
float SG_SCALE
float SG_OLD_SCALE
unsigned long TWOFMOVE_OLD_T = GetTickCount()
unsigned long ONEFMOVE_START_T = 0
unsigned long TWOFMOVE_START_T = 0
bool ABSOLUTE_MODE = true
bool RELATIVE_MODE = false
int ALIVE_ETAP_NUMTOUCH = -1
int ALIVE_EDTAP_NUMTOUCH = -1
int ALIVE_SWIPE_NUMTOUCH = -1
int ALIVE_SWIPE_DEGREE = -1

Define Documentation

#define DEG2RAD   (3.141592f/180.0f)
#define NO_GESTURE   -1
#define RAD2DEG   (180.0f/3.141592f)
#define SG_MAX_EVENT   100
#define SG_MAX_STROKE   2000
#define SG_MAX_TOUCH   255

Typedef Documentation

typedef struct tagSGEvent SGEvent
typedef struct tagSGEventList SGEventList
typedef struct tagSGNFingerTap SGNFingerTap
typedef struct tagSGParameter SGParameter
typedef struct tagSGTouch SGTouch
typedef struct tagSGTouchSet SGTouchSet

Enumeration Type Documentation

enum SGGesture
Enumerator:
SG_ETAP 
SG_EDTAP 
SG_EPINCH 
SG_EROTATE 
SG_NFINGERMOVE 
SG_NFINGERSWIPE 
SG_NFINGERHOLD 
Enumerator:
SG_INTERPRETER_STATE_PRETOUCH 
SG_INTERPRETER_STATE_IDLE 
SG_INTERPRETER_STATE_1FINGER_MOVE 
SG_INTERPRETER_STATE_2FINGER_MOVE 
SG_INTERPRETER_STATE_ROTATION 
SG_INTERPRETER_STATE_PINCH 
enum SGState
Enumerator:
SG_STATE_IDLE 
SG_STATE_TOUCH 

Function Documentation

bool check_Nfinger_move (  )
bool check_Nfinger_swipe (  )
bool check_Nfinger_tap (  )
bool check_pinch_and_rotation (  )
int check_same_id ( float *  pdx,
float *  pdy 
)
float compute_cos_theta ( float  dx0,
float  dy0,
float  dx1,
float  dy1 
)
void euclidian_distance ( float &  dx,
float &  dy,
float &  pd,
int  f_index,
int  l_index 
)
void find_firstandlast_index ( int &  f_index,
int &  l_index,
int  max_touch 
)
void initializeSGEventLish ( void   )
void initializeSGNFingerTap ( void   )
void initializeSGParameter ( void   )
void initializeSGTouchSet ( void   )
void initializeSGTouchStroke ( void   )
void InitializeSMTG ( void   )
void interpreter_magic_mt_trackpad (  )
void interpreter_starcraft2 (  )
bool judge_Nfinger_move ( float *  pcos_theta,
int  nfinger,
float  cx,
float  cy,
float  dx,
float  dy 
)
bool judge_Nfinger_swipe ( float  dx,
float  dy,
float  d,
int  f_index,
int  l_index,
int  ntouch 
)
bool judge_Nfinger_tap ( float  d,
int  f_index,
int  l_index,
int  ntouch 
)
void middle_button_up (  )
void save_nfingertap ( bool  _flag,
float  _cx,
float  _cy,
int  _ntouch 
)
void scroll_down (  )
void scroll_left (  )
void scroll_right (  )
void scroll_up (  )
void SetCoordinateMode ( int  mode )
void sg_blobstotouchset ( int  nBlobsSize,
int *  pid,
float *  pfx,
float *  pfy,
float *  pfdx,
float *  pfdy 
)
void sg_mtp1FingerDTap_move (  )
void sg_mtp1FingerTap_move (  )
void sg_mtp_interpreter_statemachine (  )
void sg_mtp_PRETOUCH_NFINGERSWIPE_2touch (  )
void sg_mtp_PRETOUCH_NFINGERSWIPE_3touch (  )
void sg_mtp_PRETOUCH_NFINGERSWIPE_4touch (  )
void sg_mtpEDTAP ( int  index )
void sg_mtpEDTAP_1touch ( int  index )
void sg_mtpEPINCH ( int  index )
void sg_mtpEROTATE ( int  index )
void sg_mtpETAP ( int  index )
void sg_mtpETAP_1touch ( int  index )
void sg_mtpETAP_2touch ( int  index )
void sg_mtpETAP_3touch ( int  index )
void sg_mtpETAP_4touch ( int  index )
void sg_mtpNFINGERHOLD ( int  index )
void sg_mtpNFINGERMOVE ( int  index )
void sg_mtpNFINGERSWIPE ( int  index )
void sg_mtpNFINGERSWIPE_2touch ( int  index )
void sg_mtpNFINGERSWIPE_3touch ( int  index )
void sg_mtpNFINGERSWIPE_4touch ( int  index )
int sg_rotate ( void   )
int sg_scale ( void   )
void sg_star2EDTAP ( int  index )
void sg_star2EPINCH ( int  index )
void sg_star2EROTATE ( int  index )
void sg_star2ETAP ( int  index )
void sg_star2NFINGERHOLD ( int  index )
void sg_star2NFINGERMOVE ( int  index )
void sg_star2NFINGERSWIPE ( int  index )
void sg_statemachine (  )
void sg_updatetouchset (  )
void sgInterpreteGesture ( int  application )
void sgRecognizeGesture ( int  nBlobsSize,
int *  pid,
float *  pfx,
float *  pfy,
float *  pfdx,
float *  pfdy 
)
void wm_Lbutton_down ( int  index )
void wm_Lbutton_up ( int  index )
void wm_mouse_move ( int  index )
void wm_mouse_wheel ( int  index )
void wm_mtp_rotation ( int  index )
void wm_Rbutton_down ( int  index )
void wm_Rbutton_up ( int  index )

Variable Documentation

float ABSOLUTE_COORDINATE_X = 0.0f
float ABSOLUTE_COORDINATE_Y = 0.0f
bool ABSOLUTE_MODE = true
float ACCUMULATION_DEGREE = 0.0f
float ACCUMULATION_SCALE = 1.0f
unsigned long ONEFMOVE_START_T = 0
bool RELATIVE_MODE = false
int SG_ANGLE
SGInterpreterState SG_INTERPRETER_STATE = SG_INTERPRETER_STATE_PRETOUCH
SGNFingerTap SG_NFINGERTAP = {false, 0.0f, 0.0f, 0, 0}
float SG_OLD_SCALE
unsigned long SG_PRETOUCH_START_TIME = 0
float SG_SCALE
SGState SG_STATE = SG_STATE_IDLE
unsigned long TWOFMOVE_OLD_T = GetTickCount()
unsigned long TWOFMOVE_START_T = 0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines