MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::MouseController Class Reference

#include <MRMouseController.h>

Classes

struct  MouseControlKey
 

Public Member Functions

 MR_ADD_CTOR_DELETE_MOVE (MouseController)
 
MRVIEWER_API void connect ()
 called in Viewer init, connects to Viewer mouse signals
 
MRVIEWER_API void setMouseControl (const MouseControlKey &key, MouseMode mode)
 
const Vector2i & getDownMousePos () const
 returns previous mouse down (if several mouse buttons are down returns position of first one)
 
const Vector2i & getMousePos () const
 returns current mouse position
 
MRVIEWER_API bool isPressed (MouseButton button) const
 returns state of mouse button
 
MRVIEWER_API bool isPressedAny () const
 returns true if any mouse btn is down
 
bool isCursorInside () const
 
bool isDropOldEventOnNewActive () const
 dropOldEventsOnNew flag - drop active mouse down state (calling mouseUp) if new mouse event happens
 
void dropOldEventsOnNew (bool on)
 
MRVIEWER_API std::optional< MouseControlKeyfindControlByMode (MouseMode mode) const
 returns nullopt if no control is present for given mode, otherwise returns associated control
 
void setTrasformModifierCb (std::function< void(AffineXf3f &)> cb)
 set callback to modify view transform before it is applied to viewport
 
void setFOVModifierCb (std::function< void(float &)> cb)
 set callback to modify new field of view before it is applied to viewport
 
int getMouseConflicts ()
 

Static Public Member Functions

static MRVIEWER_API std::string getControlString (const MouseControlKey &key)
 make string from mouse button and modifier
 
static MRVIEWER_API int mouseAndModToKey (const MouseControlKey &key)
 cast mouse button and modifier to simple int key
 
static MRVIEWER_API MouseControlKey keyToMouseAndMod (int key)
 cast simple int key to mouse button and modifier
 

Detailed Description

this class stores two maps: 1) mouse control to mouse mode 2) mouse mode to mouse control it is present as field in Viewer, and used to control scene note: default state is usually set from ViewerSetup class note: user config saves its state


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