MeshLib
 
Loading...
Searching...
No Matches
MR::TouchpadController Class Reference

#include <MRTouchpadController.h>

+ Inheritance diagram for MR::TouchpadController:

Classes

class  Handler
 

Public Member Functions

 MR_ADD_CTOR_DELETE_MOVE (TouchpadController)
 
MRVIEWER_API void initialize (GLFWwindow *window)
 initialize listening to touchpad events
 
MRVIEWER_API void reset ()
 reset event handler
 
MRVIEWER_API const TouchpadParametersgetParameters () const
 
MRVIEWER_API void setParameters (const TouchpadParameters &parameters)
 
- Public Member Functions inherited from MR::MultiListener< TouchpadRotateGestureBeginListener, TouchpadRotateGestureUpdateListener, TouchpadRotateGestureEndListener, TouchpadSwipeGestureBeginListener, TouchpadSwipeGestureUpdateListener, TouchpadSwipeGestureEndListener, TouchpadZoomGestureBeginListener, TouchpadZoomGestureUpdateListener, TouchpadZoomGestureEndListener >
virtual ~MultiListener ()=default
 
virtual void connect (Viewer *viewer, int group=0, boost::signals2::connect_position pos=boost::signals2::connect_position::at_back)
 
virtual void disconnect ()
 

Detailed Description

Class for touchpad gesture processing

The supported gestures and their default actions are:

  • pinch: zooms the camera's angle
  • rotate: rotates the camera around the scene's center along the Z axis
  • swipe: rotates the camera around the world's center along all axes (by default) or moves the camera The actions are mapped by calling the connect method; you can define your own actions by connecting to the MR::Viewer::touchpad* signals.

NOTE: on some platforms the default GLFW mouse scroll is being disabled by the touchpad event handlers because mouse scrolls and touchpad swipe gestures are a single event type there and have to be processed by a single handler. Consider it if you use this class and define your own scroll callback with glfwSetScrollCallback.

Member Function Documentation

◆ getParameters()

MRVIEWER_API const TouchpadParameters & MR::TouchpadController::getParameters ( ) const
nodiscard

◆ initialize()

MRVIEWER_API void MR::TouchpadController::initialize ( GLFWwindow * window)

initialize listening to touchpad events

◆ MR_ADD_CTOR_DELETE_MOVE()

MR::TouchpadController::MR_ADD_CTOR_DELETE_MOVE ( TouchpadController )

◆ reset()

MRVIEWER_API void MR::TouchpadController::reset ( )

reset event handler

◆ setParameters()

MRVIEWER_API void MR::TouchpadController::setParameters ( const TouchpadParameters & parameters)

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