33#include <NDEVR/Camera.h>
35#include <NDEVR/Resource.h>
36#include <NDEVR/Event.h>
37#include <NDEVR/INIInterface.h>
43 virtual bool processMouseEvent(
const MouseEvent& event, DesignObjectLookup* lookup, Camera* camera) = 0;
47 class DesignObjectLookup;
48 class MouseController final :
public INIInterface,
public MouseControllerBase
51 enum ReferencePoint :
uint01
71 enum MuuseSelectionMode
82 Resource<MouseAction> drag_action;
83 Resource<MouseAction> click_action;
84 Resource<MouseAction> double_click_action;
85 Resource<MuuseSelectionMode> selection_mode;
86 Resource<ReferencePoint> prefered_reference;
87 Resource<fltp04> sensitivity;
88 Resource<Vector<2, bool>> inverted;
90 Resource<ReferencePoint> double_click_reference;
93 MouseActions(
const MouseActions& actions);
98 MouseActions center_mouse_action;
99 MouseActions left_mouse_action;
100 MouseActions right_mouse_action;
101 MouseActions wheel_mouse_action;
106 NDEVR_DESIGN_API MouseActions& getDefaultAction(MouseEvent::MouseClickType type);
107 NDEVR_DESIGN_API const MouseActions& getDefaultAction(MouseEvent::MouseClickType type)
const;
109 NDEVR_DESIGN_API bool processMouseEvent(
const MouseEvent& event, DesignObjectLookup* lookup, Camera* camera)
override;
111 NDEVR_DESIGN_API void addController(UUID
id, MouseControllerBase* controller);
113 bool contextMenuRequested()
const {
return m_request_context_menu; }
114 void resetContextMenuRequested() { m_request_context_menu =
false; }
115 bool selectionRequested()
const {
return m_request_selection; }
116 void resetSelectionRequested() { m_request_selection =
false; }
117 const MouseEvent& lastMouseEvent()
const {
return m_last_mouse_event; }
118 Resource<Buffer<UUID>> selected;
119 Resource<UUID> selected_layer;
120 Resource<UUID> focus;
121 Resource<String> cursor;
122 Resource<String> information;
123 Resource<uint04> number_of_mouse_events;
124 Resource<uint04> number_of_mouse_clicks;
126 Matrix<fltp08> m_parent_transform;
127 CameraAnimation m_original_camera;
128 Vector<2, fltp08> m_screen_percent_0;
129 fltp08 m_last_valid_distance;
131 bool m_is_mouse_scrolling;
132 bool m_is_touch_scrolling;
134 MouseEvent m_last_mouse_event;
138 void getINI(INIFactory& factory)
override;
139 void setReferencePoint(ReferencePoint ref, Camera* camera);
140 bool processGrips(
const MouseEvent& event, DesignObjectLookup* lookup, Camera* camera);
142 void updateCenterOfMouse(DesignObjectLookup* lookup, Camera* camera,
bool update_distance);
143 void setView(MouseAction act, ReferencePoint ref,
const Vector<2, fltp08>& screen_percent, Camera* camera);
144 void mouseScrolled(fltp04 scroll_distance, Camera* camera);
145 void touchScrolled(fltp04 scroll_distance, Camera* camera);
146 void mouseClicked(
const MouseEvent& e, DesignObjectLookup* lookup, Camera* camera);
147 void mouseChangeView(
const MouseEvent& e, Camera* camera);
149 bool m_request_context_menu;
150 bool m_request_selection;
151 bool m_ignore_next_event_if_click;
152 Dictionary<UUID, MouseControllerBase*> m_controller_lookup;
153 Buffer<MouseControllerBase*> m_controllers;
154 DynamicPointer<SnapController> m_snap_controller;
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181