VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtPinchGesture Class Reference

DtPinchGesture represents a Pinch Multitouch Gesture. Instances of the DtPinchGesture class are used to manage multitouch events involving 2 touch points representing a classic 'pinch' gesture. It provides a scaleFactor based on the relative distances between touches, as well as a rotation angle based on the angle between the lines connecting subsequent touches.

Public Types

enum  PinchGestureState { PinchGestureStateUnspecified, PinchGestureStateBegin, PinchGestureStateUpdate, PinchGestureStateEnd }
 
typedef DtVector2< float32DtVector2f
 
typedef DtLine2D< float32DtLine2f
 

Public Member Functions

 DtPinchGesture ()
 
 DtPinchGesture (const DtPinchGesture &orig)
 
DtPinchGestureoperator= (const DtPinchGesture &rhs)
 
virtual ~DtPinchGesture ()
 
virtual PinchGestureState gestureState () const
 
virtual void setGestureState (PinchGestureState gestureState)
 
virtual float scaleFactor () const
 
virtual float lastScaleFactor () const
 
virtual float totalScaleFactor () const
 
virtual float rotationAngle () const
 
virtual float lastRotationAngle () const
 
virtual float totalRotationAngle () const
 
virtual DtVector2f startCenterPoint () const
 
virtual DtVector2f centerPoint () const
 
virtual DtVector2f lastCenterPoint () const
 
virtual void processTouchEvent (PinchGestureState gestureState, const DtVector2f &p0, const DtVector2f &p1)
 

Protected Member Functions

virtual void computeCurrentScaleFactor (PinchGestureState gestureState, const DtVector2f &p0, const DtVector2f &p1)
 

Protected Attributes

bool myInitialized
 
PinchGestureState myGestureState
 
DtLine2f myStartLine
 
DtLine2f myLastLine
 
float myScaleFactor
 
float myLastScaleFactor
 
float myTotalScaleFactor
 
float myRotationAngle
 
float myLastRotationAngle
 
float myTotalRotationAngle
 
DtVector2f myCenterPoint
 
DtVector2f myStartCenterPoint
 
DtVector2f myLastCenterPoint
 

Member Typedef Documentation

Typedefs for templated vectors used throughout. float32 is sufficient precision for widget coordinates.

Member Enumeration Documentation

Enumeration used to express the current pinch gesture state.

Enumerator
PinchGestureStateUnspecified 
PinchGestureStateBegin 
PinchGestureStateUpdate 
PinchGestureStateEnd 

Constructor & Destructor Documentation

makVrv::DtPinchGesture::DtPinchGesture ( )

CTOR.

makVrv::DtPinchGesture::DtPinchGesture ( const DtPinchGesture orig)

Copy CTOR.

virtual makVrv::DtPinchGesture::~DtPinchGesture ( )
virtual

DTOR.

Member Function Documentation

DtPinchGesture& makVrv::DtPinchGesture::operator= ( const DtPinchGesture rhs)

Assignment Operator.

virtual PinchGestureState makVrv::DtPinchGesture::gestureState ( ) const
virtual

Get the current gesture state.

virtual void makVrv::DtPinchGesture::setGestureState ( PinchGestureState  gestureState)
virtual

Set the gesture state; this method allows the gesture state to be modified without actually processing a touch event.

virtual float makVrv::DtPinchGesture::scaleFactor ( ) const
virtual

Get the current scale factor. This is the ratio of the distances between the last touch points and the current touch points.

virtual float makVrv::DtPinchGesture::lastScaleFactor ( ) const
virtual

Get the last scale factor. This is the scaleFactor from the previous touch event.

virtual float makVrv::DtPinchGesture::totalScaleFactor ( ) const
virtual

Get the total scale factor. This is the ratio of the distances between the first touch points and the current touch points.

virtual float makVrv::DtPinchGesture::rotationAngle ( ) const
virtual

Get the rotation angle. This is the difference between the angles of the last line between the touch points and the current line.

virtual float makVrv::DtPinchGesture::lastRotationAngle ( ) const
virtual

Get the last rotation angle. This is the value of rotationAngle from the last touch event.

virtual float makVrv::DtPinchGesture::totalRotationAngle ( ) const
virtual

Get the total rotation angle. This is the difference between the angles of the last line between the touch points and the first touch points.

virtual DtVector2f makVrv::DtPinchGesture::startCenterPoint ( ) const
virtual

Get the start center point. This is the point in between the first two touch points (in channel coordinates)

virtual DtVector2f makVrv::DtPinchGesture::centerPoint ( ) const
virtual

Get the center point. This is the point in between the two current touch points (in channel coordinates)

virtual DtVector2f makVrv::DtPinchGesture::lastCenterPoint ( ) const
virtual

Get the last center point. This is the value of centerPoint from the previous touch event (in channel coordinates)

virtual void makVrv::DtPinchGesture::processTouchEvent ( PinchGestureState  gestureState,
const DtVector2f p0,
const DtVector2f p1 
)
virtual

Process a touch event. This sets the gesture state and then calls computeCurrentScaleFactor().

virtual void makVrv::DtPinchGesture::computeCurrentScaleFactor ( PinchGestureState  gestureState,
const DtVector2f p0,
const DtVector2f p1 
)
protectedvirtual

This method initializes the gesture if it hasn't been already and then does all the actual computation.

Member Data Documentation

bool makVrv::DtPinchGesture::myInitialized
protected
PinchGestureState makVrv::DtPinchGesture::myGestureState
protected
DtLine2f makVrv::DtPinchGesture::myStartLine
protected
DtLine2f makVrv::DtPinchGesture::myLastLine
protected
float makVrv::DtPinchGesture::myScaleFactor
protected
float makVrv::DtPinchGesture::myLastScaleFactor
protected
float makVrv::DtPinchGesture::myTotalScaleFactor
protected
float makVrv::DtPinchGesture::myRotationAngle
protected
float makVrv::DtPinchGesture::myLastRotationAngle
protected
float makVrv::DtPinchGesture::myTotalRotationAngle
protected
DtVector2f makVrv::DtPinchGesture::myCenterPoint
protected
DtVector2f makVrv::DtPinchGesture::myStartCenterPoint
protected
DtVector2f makVrv::DtPinchGesture::myLastCenterPoint
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)