OpendTect-6_4  6.4
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 (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Public Attributes

Notifier< GestureEventHandlerpinchnotifier
 

Private Attributes

const GestureEventcurrentevent_
 
bool ishandled_
 

Additional Inherited Members

- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 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. 2019