Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Mouse Gestures for Internet Explorer

, 21 Sep 2005
Adding mouse gesture recognition to Internet Explorer.
mousegestures_inst.zip
MouseGestures.exe
mousegestures_inst_1.zip
MouseGestures.exe
mousegestures_src.zip
src
gesture.weights
images
about.bmp
ClickLeftRight.bmp
ClickRightLeft.bmp
down.bmp
downarrow.bmp
downleft.bmp
downright.bmp
downup.bmp
exclamation.bmp
left.bmp
leftarrow.bmp
leftright.bmp
none.bmp
right.bmp
rightarrow.bmp
rightleft.bmp
up.bmp
uparrow.bmp
updown.bmp
upleft.bmp
upright.bmp
wheel.bmp
MouseGestures.rgs
mousegestures_src_1.zip
MouseGestures
BrowserHelperObject.rgs
gesture.weights
images
about.bmp
ClickLeftRight.bmp
ClickRightLeft.bmp
down.bmp
downleft.bmp
downright.bmp
downup.bmp
left.bmp
none.bmp
right.bmp
up.bmp
updown.bmp
upleft.bmp
upright.bmp
wheel.bmp
MouseGestures.def
MouseGestures.dsp
MouseGesturesCfg.rgs
/*
 Copyright (c) 2001 
 Author: Konstantin Boukreev 
 E-mail: konstantin@mail.primorye.ru 

 Created: 02.11.2001 14:36:27
 Version: 1.0.0
*/

#ifndef __GESTURE_H_A6C9EAA5_57A4_4B1A_ADF6_1E5374D08908_
#define __GESTURE_H_A6C9EAA5_57A4_4B1A_ADF6_1E5374D08908_

#include <list>
#include <vector>
#include "MLNet.h"
#include "GestureData.h"

typedef std::list< POINT >      Path;
typedef std::vector< float >	VectorReal;

struct Winner
{
	unsigned m_id;				// index of pattern in pattern_data array
	float    m_probability;
};

class Gesture
{
// not defined
private:
    Gesture( const Gesture & );
    Gesture & operator = ( const Gesture & );

public:
    enum { WINNER_COUNT = 3 };

public:
    Gesture( size_t range );

public:
    int Recognize( const Path &path );

private:
    bool TransformPath( const Path &path );
    void LoadNet();

/**
 * Added stretch method (RH: 09/07/03)
 **/
    void Stretch( const Path &path );

private:
	enum Mode
	{
		untrained_mode,
		training_mode,
		trained_mode,
		recognizing_mode,
		recognized_success,
		recognized_fail,
	};

private:
    const size_t    NUMBER_OF_ANCHOR_POINTS;
    const size_t    NUMBER_OF_ANGLES;

private:
    Path            m_path;
    VectorReal      m_angles;
    VectorReal      m_cosines;
    VectorReal      m_sinuses;
    VectorReal      m_errors;
    Winner		    m_winners[ WINNER_COUNT ];
    Mode            m_mode;

    MLNet           m_net;
};

#endif // __GESTURE_H_A6C9EAA5_57A4_4B1A_ADF6_1E5374D08908_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Ralph Hare
Web Developer
United Kingdom United Kingdom
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 21 Sep 2005
Article Copyright 2003 by Ralph Hare
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid