ofxDOM
A DOM Level 3 Events implementation for openFrameworks.
ofx::DOM::CapturedPointer Class Reference

A class for keeping track of captured pointers. More...

#include <CapturedPointer.h>

Public Member Functions

 CapturedPointer (std::size_t id)
 Create a CapturedPointer with the given id. More...
 
 ~CapturedPointer ()
 Destroy the captured pointer.
 
void update (Element *element, const PointerUIEventArgs &e)
 Update a given Captured Pointer from an Element and PointerEvent. More...
 
std::size_t id () const
 
const Position & start () const
 
const Position & offset () const
 
const Position & position () const
 
const Position & velocity () const
 
uint64_t lastUpdate () const
 
uint64_t timestamp () const
 

Friends

std::ostream & operator<< (std::ostream &os, const CapturedPointer &pointer)
 

Detailed Description

A class for keeping track of captured pointers.

Constructor & Destructor Documentation

ofx::DOM::CapturedPointer::CapturedPointer ( std::size_t  id)

Create a CapturedPointer with the given id.

Parameters
idThe id of the captured pointer.

Member Function Documentation

std::size_t ofx::DOM::CapturedPointer::id ( ) const
Returns
the captured pointer's id.
uint64_t ofx::DOM::CapturedPointer::lastUpdate ( ) const
Returns
the last update time.
const Position & ofx::DOM::CapturedPointer::offset ( ) const
Returns
the start()-position() of the captured pointer.
const Position & ofx::DOM::CapturedPointer::position ( ) const
Returns
the current position of the captured pointer.
const Position & ofx::DOM::CapturedPointer::start ( ) const
Returns
the start position of the captured pointer.
uint64_t ofx::DOM::CapturedPointer::timestamp ( ) const
Returns
the initial timestamp when the pointer was captured.
void ofx::DOM::CapturedPointer::update ( Element element,
const PointerUIEventArgs e 
)

Update a given Captured Pointer from an Element and PointerEvent.

This method updates offset, position, velocity, lastUpdate and other parameters of the CapturedPointer.

Parameters
elementThe element that is currently handling the Pointer.
eThe PointerUIEventArgs used to update the CapturedPointer's data.
const Position & ofx::DOM::CapturedPointer::velocity ( ) const
Returns
the velocity of the captured pointer (lastPosition() - position()).

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