31 namespace cinder {
namespace app {
39 Touch(
const Vec2f &pos,
const Vec2f &prevPos, uint32_t
id,
double time,
void *native )
40 : mPos( pos ), mPrevPos( prevPos ), mId( id ), mTime( time ), mNative( native )
44 float getX()
const {
return mPos.
x; }
46 float getY()
const {
return mPos.
y; }
56 uint32_t
getId()
const {
return mId; }
73 :
Event( win ), mTouches( touches )
77 const std::vector<Touch>&
getTouches()
const {
return mTouches; }
82 std::vector<Touch> mTouches;
94 out <<
"{" << std::endl;
95 for( std::vector<TouchEvent::Touch>::const_iterator tIt = event.
getTouches().begin(); tIt !=
event.getTouches().end(); ++tIt )
96 out <<
" " << *tIt << std::endl;
TouchEvent()
Definition: TouchEvent.h:69
std::ostream & operator<<(std::ostream &lhs, const InterfaceOrientation &rhs)
Stream InterfacefaceOrientation enum to std::ostream.
Definition: AppCocoaTouch.mm:666
TouchEvent(WindowRef win, const std::vector< Touch > &touches)
Definition: TouchEvent.h:72
float getX() const
Returns the x position of the touch measured in points.
Definition: TouchEvent.h:44
T x
Definition: Vector.h:71
GLXFBConfig Window win
Definition: GLee.h:16730
Definition: TouchEvent.h:36
std::vector< Touch > & getTouches()
Returns a std::vector of Touch descriptors associated with this event.
Definition: TouchEvent.h:79
const std::vector< Touch > & getTouches() const
Returns a std::vector of Touch descriptors associated with this event.
Definition: TouchEvent.h:77
double getTime() const
Returns the timestamp associated with the touch, measured in seconds.
Definition: TouchEvent.h:58
std::shared_ptr< Window > WindowRef
Definition: Event.h:49
Vec2f getPrevPos() const
Returns the previous position of the touch measured in points.
Definition: TouchEvent.h:54
float getPrevX() const
Returns the previous x position of the touch measured in points.
Definition: TouchEvent.h:50
Base class for all Events.
Definition: Event.h:53
Touch(const Vec2f &pos, const Vec2f &prevPos, uint32_t id, double time, void *native)
Definition: TouchEvent.h:39
float getY() const
Returns the y position of the touch measured in points.
Definition: TouchEvent.h:46
T y
Definition: Vector.h:71
Touch()
Definition: TouchEvent.h:38
Vec2f getPos() const
Returns the position of the touch measured in points.
Definition: TouchEvent.h:48
uint32_t getId() const
Returns an ID unique for the lifetime of the touch.
Definition: TouchEvent.h:56
Represents a touch event.
Definition: TouchEvent.h:34
float getPrevY() const
Returns the previous y position of the touch measured in points.
Definition: TouchEvent.h:52
const void * getNative() const
Returns a pointer to the OS-native object. This is a UITouch* on Cocoa Touch and a TOUCHPOINT* on MSW...
Definition: TouchEvent.h:60