OpendTect  6.6
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 ()
 
const GestureEventgetPinchEventInfo () const
 
bool isHandled () const
 
void setHandled (bool yn)
 
void triggerPinchEvent (const GestureEvent &pinchevnt)
 Only available during events. More...
 
- 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 detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
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 ()
 

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 )
{
mDynamicCastGet(const GestureEventHandler*,evh,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 );
}
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
Handles gesture event and triggers notifier with GestureEventInfo.
Definition: mouseevent.h:302

<>

Constructor & Destructor Documentation

◆ GestureEventHandler()

GestureEventHandler::GestureEventHandler ( )

◆ ~GestureEventHandler()

GestureEventHandler::~GestureEventHandler ( )

Member Function Documentation

◆ getPinchEventInfo()

const GestureEvent* GestureEventHandler::getPinchEventInfo ( ) const

◆ isHandled()

bool GestureEventHandler::isHandled ( ) const
inline

◆ setHandled()

void GestureEventHandler::setHandled ( bool  yn)
inline

◆ triggerPinchEvent()

void GestureEventHandler::triggerPinchEvent ( const GestureEvent pinchevnt)

Only available during events.

Member Data Documentation

◆ currentevent_

const GestureEvent* GestureEventHandler::currentevent_
private

◆ ishandled_

bool GestureEventHandler::ishandled_
private

◆ pinchnotifier

Notifier<GestureEventHandler> GestureEventHandler::pinchnotifier

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