33#include <NDEVR/Camera.h>
35#include <NDEVR/SoftwareService.h>
36#include <NDEVR/Resource.h>
37#include <NDEVR/Event.h>
38#include <NDEVR/INIInterface.h>
47 virtual bool processMouseEvent(
const MouseEvent& event, DesignObjectLookup* lookup, Camera* camera) = 0;
51 class DesignObjectLookup;
56 class MouseController final :
public INIInterface,
public MouseControllerBase,
public SoftwareServiceManager
59 enum ReferencePoint :
uint01
79 enum MouseSelectionMode
90 Resource<MouseAction> drag_action;
91 Resource<MouseAction> click_action;
92 Resource<MouseAction> double_click_action;
93 Resource<MouseSelectionMode> selection_mode;
94 Resource<ReferencePoint> prefered_reference;
95 Resource<fltp04> sensitivity;
96 Resource<Vector<2, bool>> inverted;
98 Resource<ReferencePoint> double_click_reference;
101 MouseActions(
const MouseActions& actions);
106 MouseActions center_mouse_action;
107 MouseActions left_mouse_action;
108 MouseActions right_mouse_action;
109 MouseActions wheel_mouse_action;
114 NDEVR_DESIGN_API MouseActions& getDefaultAction(MouseEvent::MouseClickType type);
115 NDEVR_DESIGN_API const MouseActions& getDefaultAction(MouseEvent::MouseClickType type)
const;
117 NDEVR_DESIGN_API bool processMouseEvent(
const MouseEvent& event, DesignObjectLookup* lookup, Camera* camera)
override;
119 NDEVR_DESIGN_API void addController(UUID
id, MouseControllerBase* controller);
121 bool contextMenuRequested()
const {
return m_request_context_menu; }
122 void resetContextMenuRequested() { m_request_context_menu =
false; }
123 bool selectionRequested()
const {
return m_request_selection; }
124 void resetSelectionRequested() { m_request_selection =
false; }
125 const MouseEvent& lastMouseEvent()
const {
return m_last_mouse_event; }
126 Resource<Buffer<UUID>> selected;
127 Resource<UUID> selected_layer;
128 Resource<UUID> focus;
129 Resource<String> cursor;
130 Resource<String> information;
131 Resource<uint04> number_of_mouse_events;
132 Resource<uint04> number_of_mouse_clicks;
134 Matrix<fltp08> m_parent_transform;
135 CameraAnimation m_original_camera;
136 Vector<2, fltp08> m_screen_percent_0;
137 fltp08 m_last_valid_distance;
139 bool m_is_mouse_scrolling;
140 bool m_is_touch_scrolling;
142 MouseEvent m_last_mouse_event;
146 void getINI(INIFactory& factory)
override;
147 void setReferencePoint(ReferencePoint ref, Camera* camera);
148 bool processGrips(
const MouseEvent& event, DesignObjectLookup* lookup, Camera* camera);
150 void updateCenterOfMouse(DesignObjectLookup* lookup, Camera* camera,
bool update_distance);
151 void setView(MouseAction act, ReferencePoint ref,
const Vector<2, fltp08>& screen_percent, Camera* camera);
152 void mouseScrolled(fltp04 scroll_distance, Camera* camera);
153 void touchScrolled(fltp04 scroll_distance, Camera* camera);
154 void mouseClicked(
const MouseEvent& e, DesignObjectLookup* lookup, Camera* camera);
155 void mouseChangeView(
const MouseEvent& e, Camera* camera);
157 bool m_request_context_menu;
158 bool m_request_selection;
159 bool m_ignore_next_event_if_click;
160 Dictionary<UUID, MouseControllerBase*> m_controller_lookup;
161 Buffer<MouseControllerBase*> m_controllers;
162 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:80
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149