VR-Forces 4.10 Class Documentation
 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. More...

Public Types

enum  PinchGestureState { PinchGestureStateUnspecified, PinchGestureStateBegin, PinchGestureStateUpdate, PinchGestureStateEnd }
 Enumeration used to express the current pinch gesture state. More...
 
typedef DtVector2< float32DtVector2f
 Typedefs for templated vectors used throughout. More...
 
typedef DtLine2D< float32DtLine2f
 

Public Member Functions

 DtPinchGesture ()
 CTOR. More...
 
 DtPinchGesture (const DtPinchGesture &orig)
 Copy CTOR. More...
 
DtPinchGestureoperator= (const DtPinchGesture &rhs)
 Assignment Operator. More...
 
virtual ~DtPinchGesture ()
 DTOR. More...
 
virtual PinchGestureState gestureState () const
 Get the current gesture state. More...
 
virtual void setGestureState (PinchGestureState gestureState)
 Set the gesture state; this method allows the gesture state to be modified without actually processing a touch event. More...
 
virtual float scaleFactor () const
 Get the current scale factor. More...
 
virtual float lastScaleFactor () const
 Get the last scale factor. More...
 
virtual float totalScaleFactor () const
 Get the total scale factor. More...
 
virtual float rotationAngle () const
 Get the rotation angle. More...
 
virtual float lastRotationAngle () const
 Get the last rotation angle. More...
 
virtual float totalRotationAngle () const
 Get the total rotation angle. More...
 
virtual DtVector2f startCenterPoint () const
 Get the start center point. More...
 
virtual DtVector2f centerPoint () const
 Get the center point. More...
 
virtual DtVector2f lastCenterPoint () const
 Get the last center point. More...
 
virtual void processTouchEvent (PinchGestureState gestureState, const DtVector2f &p0, const DtVector2f &p1)
 Process a touch event. More...
 

Protected Member Functions

virtual void computeCurrentScaleFactor (PinchGestureState gestureState, const DtVector2f &p0, const DtVector2f &p1)
 This method initializes the gesture if it hasn't been already and then does all the actual computation. More...
 

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
 

Detailed Description

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

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 Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)