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

#include <inviwo/core/interaction/events/touchevent.h>

Public Member Functions

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

Protected Attributes

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

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:
  • include/inviwo/core/interaction/events/touchevent.h