Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::TouchPoint Class Reference

#include <touchevent.h>

Public Member Functions

 TouchPoint (int id, TouchState touchState, dvec2 posNormalized, dvec2 prevPosNormalized, dvec2 pressedPosNormalized, uvec2 canvasSize, double pressure, double depth=1.0)
 
bool operator== (const TouchPoint &b) const
 
bool operator!= (const TouchPoint &b) const
 
TouchState state () const
 
int id () const
 Retrieve touch point id.
 
void setId (int id)
 
dvec2 pos () const
 Retrieve position in screen coordinates [0 dim-1]^2.
 
void setPos (dvec2 val)
 
dvec2 posNormalized () const
 Retrieve position normalized to the size of the screen [0 1]^2.
 
void setPosNormalized (dvec2 val)
 
dvec2 prevPos () const
 Retrieve the previous event position in screen coordinates [0 dim-1]^2.
 
void setPrevPos (dvec2 val)
 
dvec2 prevPosNormalized () const
 Retrieve the previous position normalized to the size of the screen [0 1]^2.
 
void setPrevPosNormalized (dvec2 val)
 
dvec2 pressedPos () const
 Retrieve the pressed event position in screen coordinates [0 dim-1]^2.
 
void setPressedPos (dvec2 val)
 
dvec2 pressedPosNormalized () const
 Retrieve the pressed position normalized to the size of the screen [0 1]^2.
 
void setPressedPosNormalized (dvec2 val)
 
double depth () const
 
void setDepth (double val)
 
double pressure () const
 
void setPressure (double val)
 
uvec2 canvasSize () const
 
void setCanvasSize (uvec2 size)
 
dvec3 ndc () const
 

Protected Attributes

int id_
 
TouchState state_
 
dvec2 posNormalized_
 
dvec2 prevPosNormalized_
 
dvec2 pressedPosNormalized_
 
double pressure_
 
uvec2 canvasSize_
 
double depth_
 

Detailed Description

Point at which a finger touches a screen or touch pad. Several touch points are contained within a TouchEvent

See also
TouchEvent

Constructor & Destructor Documentation

◆ TouchPoint()

inviwo::TouchPoint::TouchPoint ( int id,
TouchState touchState,
dvec2 posNormalized,
dvec2 prevPosNormalized,
dvec2 pressedPosNormalized,
uvec2 canvasSize,
double pressure,
double depth = 1.0 )
Parameters
idTouch point id that distinguishes a particular touch point
touchStateState of the touch point.
posNormalizedPosition normalized to the size of the screen [0 1]^2.
prevPosNormalizedPrevious position normalized to the size of the screen [0 1]^2.
pressedPosNormalizedPosition that was pressed normalized to the size of the screen [0 * 1]^2.
canvasSizesize of the canvas from where the event originates
pressurethe pressure of the touch
depthDepth value in normalized device coordinates ([-1 1]) at touch point, 1 if no depth is available.

Member Function Documentation

◆ depth()

double inviwo::TouchPoint::depth ( ) const

Retrieve depth value in normalized device coordinates at touch point. Defined in [-1 1], where -1 is the near plane and 1 is the far plane. Will be 1 if no depth value is available.

◆ id()

int inviwo::TouchPoint::id ( ) const

Retrieve touch point id.

Returns
int

◆ ndc()

dvec3 inviwo::TouchPoint::ndc ( ) const

Returns the normalized device coordinates. Position and depth normalized to the range of (-1,1) in a left handed coordinate system. The lower left near will be (-1,-1,-1) And the upper right far (1,1,1)

◆ operator!=()

bool inviwo::TouchPoint::operator!= ( const TouchPoint & b) const

Return true if any positions or state is eifferent, false otherwise.

◆ operator==()

bool inviwo::TouchPoint::operator== ( const TouchPoint & b) const

Return true if all positions and state are the same, false otherwise.

◆ pressure()

double inviwo::TouchPoint::pressure ( ) const

Return how hard the touch point is being pressed.


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