OpendTect  6.3
Public Member Functions | Public Attributes | Private Attributes | List of all members
GestureEventHandler Class Reference

Handles gesture event and triggers notifier with GestureEventInfo. More...

Inheritance diagram for GestureEventHandler:
[legend]

Public Member Functions

 GestureEventHandler ()
 
 ~GestureEventHandler ()
 
void triggerPinchEvent (const GestureEvent &pinchevnt)
 Only available during events. More...
 
const GestureEventgetPinchEventInfo () const
 
bool isHandled () const
 
void setHandled (bool yn)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
virtual bool isCapsule () const
 
void stopReceivingNotifications () const
 

Public Attributes

Notifier< GestureEventHandlerpinchnotifier
 

Private Attributes

const GestureEventcurrentevent_
 
bool ishandled_
 

Additional Inherited Members

- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 

Detailed Description

Handles gesture event and triggers notifier with GestureEventInfo.

The callback function should look like this. It also has isHandled() and setHandled() functions similar to the mouse events, to explicitly handle the callback which prevents other objects in the chain to use it.

void MyClass::handlePinchEventCB( CallBacker* cb )
{
if ( !evh || evh->isHandled() )
return;
const GestureEventInfo* gevinfo = evh->getPinchEventInfo();
if ( !gevinfo )
return;
Geom::Point2D<int> pos = gevinfo->pos();
// do some work
evh->setHandled( true );
}

Constructor & Destructor Documentation

GestureEventHandler::GestureEventHandler ( )
GestureEventHandler::~GestureEventHandler ( )

Member Function Documentation

const GestureEvent* GestureEventHandler::getPinchEventInfo ( ) const
bool GestureEventHandler::isHandled ( ) const
inline
void GestureEventHandler::setHandled ( bool  yn)
inline
void GestureEventHandler::triggerPinchEvent ( const GestureEvent pinchevnt)

Only available during events.

Member Data Documentation

const GestureEvent* GestureEventHandler::currentevent_
private
bool GestureEventHandler::ishandled_
private
Notifier<GestureEventHandler> GestureEventHandler::pinchnotifier

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017