5#include "MRMesh/MRphmap.h"
41 const Vector2i&
getMousePos()
const {
return currentMousePos_; }
75 bool preMouseDown_(
MouseButton button,
int modifier );
76 bool mouseDown_(
MouseButton button,
int modifier );
77 bool preMouseUp_(
MouseButton button,
int modifier );
78 bool preMouseMove_(
int x,
int y );
79 bool mouseScroll_(
float delta );
81 bool isCursorInside_{
false };
82 void cursorEntrance_(
bool entered );
84 bool dropOldEventsOnNew_{
false };
85 void resetAllIfNeeded_();
87 Vector3f downTranslation_;
89 Vector2i downMousePos_;
90 Vector2i prevMousePos_;
91 Vector2i currentMousePos_;
94 MouseMode currentMode_{ MouseMode::None };
98 int clickModifiers_{};
100 MouseButton clickPendingDown_{ MouseButton::NoButton };
104 using MouseModeMap = HashMap<int, MouseMode>;
105 using MouseModeBackMap = HashMap<MouseMode, int>;
108 MouseModeBackMap backMap_;
110 bool scrollActive_{
true };
112 std::function<void( AffineXf3f& )> transformModifierCb_;
113 std::function<void(
float& )> fovModifierCb_;
Definition MRMouseController.h:21
MRVIEWER_API std::optional< MouseControlKey > findControlByMode(MouseMode mode) const
MRVIEWER_API bool isPressed(MouseButton button) const
static MRVIEWER_API int mouseAndModToKey(const MouseControlKey &key)
bool isCursorInside() const
Definition MRMouseController.h:45
MRVIEWER_API void setMouseControl(const MouseControlKey &key, MouseMode mode)
MRVIEWER_API void connect()
const Vector2i & getDownMousePos() const
Definition MRMouseController.h:39
static MRVIEWER_API MouseControlKey keyToMouseAndMod(int key)
bool isDropOldEventOnNewActive() const
Definition MRMouseController.h:48
void setTrasformModifierCb(std::function< void(AffineXf3f &)> cb)
Definition MRMouseController.h:65
void dropOldEventsOnNew(bool on)
Definition MRMouseController.h:49
void setFOVModifierCb(std::function< void(float &)> cb)
Definition MRMouseController.h:68
MRVIEWER_API void setMouseScroll(bool active)
const Vector2i & getMousePos() const
Definition MRMouseController.h:41
MR_ADD_CTOR_DELETE_MOVE(MouseController)
static MRVIEWER_API std::string getControlString(const MouseControlKey &key)
Definition MRCameraOrientationPlugin.h:8
MouseMode
Definition MRMouse.h:19
MouseButton
Definition MRMouse.h:9
std::chrono::time_point< std::chrono::system_clock > Time
Definition MRAsyncTimer.h:17
Definition MRMouseController.h:25