Touch event contains all touch points associated with the event. Touch events are usually generated by touch screens or touch pads, see TouchDevice.
More...
#include <touchevent.h>
|
| TouchEvent (const std::vector< TouchPoint > &touchPoints, const TouchDevice *source, KeyModifiers modifiers) |
|
virtual TouchEvent * | clone () const override |
|
bool | hasTouchPoints () const |
|
const std::vector< TouchPoint > & | touchPoints () const |
|
std::vector< TouchPoint > & | touchPoints () |
|
void | setTouchPoints (std::vector< TouchPoint > val) |
|
uvec2 | canvasSize () const |
|
dvec2 | centerPoint () const |
| Computes average position. Returns dvec2(0) if no touch points exist.
|
|
dvec2 | centerPointNormalized () const |
| Computes average normalized position. Returns dvec2(0) if no touch points exist.
|
|
dvec2 | prevCenterPointNormalized () const |
| Computes previous average normalized position. Returns dvec2(0) if no touch points exist.
|
|
dvec3 | centerNDC () const |
| Average of touch points in normalized device coordinates, TouchPoint::ndc() Defined in (-1,1) in a left handed coordinate system.
|
|
double | averageDepth () const |
| Average depth of touch points, TouchPoint::depth() Defined in [-1 1], where -1 is the near plane and 1 is the far plane.
|
|
const TouchDevice * | getDevice () const |
| Return TouchDevice that generated the event.
|
|
std::vector< const TouchPoint * > | findClosestTwoTouchPoints () const |
| Retrieve pointers to the two closest touch points.
|
|
virtual uint64_t | hash () const override |
|
virtual void | print (std::ostream &ss) const override |
|
| InteractionEvent (KeyModifiers modifiers=KeyModifiers(flags::empty)) |
|
| InteractionEvent (const InteractionEvent &rhs)=default |
|
InteractionEvent & | operator= (const InteractionEvent &that)=default |
|
KeyModifiers | modifiers () const |
|
void | setModifiers (KeyModifiers modifiers) |
|
std::string | modifierNames () const |
|
void | setToolTip (std::string_view tooltip) const |
|
void | setToolTipCallback (ToolTipCallback callback) |
|
const ToolTipCallback & | getToolTipCallback () const |
|
virtual bool | shouldPropagateTo (Inport *inport, Processor *processor, Outport *source) |
|
bool | markAsUsed () |
|
bool | hasBeenUsed () const |
|
bool | markAsUnused () |
|
bool | setUsed (bool isUsed) |
|
bool | markAsVisited (Processor *) |
|
void | markAsVisited (Event &) |
|
bool | hasVisitedProcessor (Processor *) const |
|
const std::vector< Processor * > & | getVisitedProcessors () const |
|
template<typename EventType > |
EventType * | getAs () |
|
template<typename EventType > |
const EventType * | getAs () const |
|
|
static PickingState | getPickingState (const std::vector< TouchPoint > &points) |
| Get PickingState by analyzing all touch points.
|
|
static constexpr uint64_t | chash () |
|
|
using | ToolTipCallback = std::function<void(std::string_view)> |
|
| Event (const Event &rhs)=default |
|
Event & | operator= (const Event &that)=default |
|
KeyModifiers | modifiers_ |
|
ToolTipCallback | tooltip_ |
|
Touch event contains all touch points associated with the event. Touch events are usually generated by touch screens or touch pads, see TouchDevice.
- See also
- TouchPoint
◆ averageDepth()
double inviwo::TouchEvent::averageDepth |
( |
| ) |
const |
Average depth of touch points, TouchPoint::depth() Defined in [-1 1], where -1 is the near plane and 1 is the far plane.
- Returns
- sum(touch points.depth()) / nPoints, or 1 if no touch points exist.
◆ centerNDC()
dvec3 inviwo::TouchEvent::centerNDC |
( |
| ) |
const |
Average of touch points in normalized device coordinates, TouchPoint::ndc() Defined in (-1,1) in a left handed coordinate system.
- Returns
- sum(touch points.ndc()) / nPoints, or dvec3(0) if no touch points exist.
◆ centerPoint()
dvec2 inviwo::TouchEvent::centerPoint |
( |
| ) |
const |
Computes average position. Returns dvec2(0) if no touch points exist.
- Returns
- dvec2 sum(touch points) / nPoints
◆ centerPointNormalized()
dvec2 inviwo::TouchEvent::centerPointNormalized |
( |
| ) |
const |
Computes average normalized position. Returns dvec2(0) if no touch points exist.
- Returns
- dvec2 sum(touch points) / nPoints
◆ clone()
virtual TouchEvent * inviwo::TouchEvent::clone |
( |
| ) |
const |
|
overridevirtual |
◆ findClosestTwoTouchPoints()
std::vector< const TouchPoint * > inviwo::TouchEvent::findClosestTwoTouchPoints |
( |
| ) |
const |
Retrieve pointers to the two closest touch points.
- Returns
- std::vector<const TouchPoint*>, pointers to the two closest touch points vector can have less then two elements, which indicate that not enough points exist
◆ getPickingState()
static PickingState inviwo::TouchEvent::getPickingState |
( |
const std::vector< TouchPoint > & | points | ) |
|
|
static |
Get PickingState by analyzing all touch points.
- Returns
- PickingState::Started or PickingState::Finished when all touch points started or finished. Return PickingState::Updated when any of the touch points updated or some started and some finished.
◆ hash()
virtual uint64_t inviwo::TouchEvent::hash |
( |
| ) |
const |
|
overridevirtual |
◆ prevCenterPointNormalized()
dvec2 inviwo::TouchEvent::prevCenterPointNormalized |
( |
| ) |
const |
Computes previous average normalized position. Returns dvec2(0) if no touch points exist.
- Returns
- dvec2 sum(touch points) / nPoints
◆ print()
virtual void inviwo::TouchEvent::print |
( |
std::ostream & | ss | ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following file: