MeshLib C++ Docs
Loading...
Searching...
No Matches

#include <MRViewer/MRMouseController.h>

Classes

struct  MouseControlKey

Public Member Functions

 MR_ADD_CTOR_DELETE_MOVE (MouseController)
void connect ()
 called in Viewer init, connects to Viewer mouse signals
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
bool isPressed (MouseButton button) const
 returns state of mouse button
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)
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 std::string getControlString (const MouseControlKey &key)
 make string from mouse button and modifier
static int mouseAndModToKey (const MouseControlKey &key)
 cast mouse button and modifier to simple int key
static 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: