![]() |
NDEVR
API Documentation
|
Contains logic for executing actions based on user mouse inputs. More...
Classes | |
| class | MouseActions |
| Holds the configurable action bindings and settings for a single mouse button. More... | |
Public Types | |
| enum | MouseAction : uint01 { e_ignore , e_select , e_inv_select , e_orbit , e_pan , e_look_around , e_zoom , e_inv_zoom , e_context_menu , e_command } |
| Defines the possible actions that can be bound to a mouse button interaction. More... | |
| enum | MouseSelectionMode { e_select_model , e_select_model_base , e_select_material , e_select_geometry , e_select_bone } |
| Defines which type of design object is targeted during mouse selection. More... | |
| enum | ReferencePoint : uint01 { e_map_center , e_mouse_center , e_screen_center } |
| Defines the reference point used for camera operations such as orbit and zoom. More... | |
Public Member Functions | |
| MouseController () | |
| Constructs a MouseController with default settings. | |
| virtual | ~MouseController () |
| Destructor. | |
| void | addController (UUID id, MouseControllerBase *controller) |
| Registers a mouse sub-controller with a given identifier. | |
| bool | contextMenuRequested () const |
| Checks whether a context menu has been requested by a recent mouse event. | |
| MouseAction | getAction (const MouseEvent &event) const |
| Determines the action to perform for a given mouse event based on current bindings. | |
| MouseActions & | getDefaultAction (MouseEvent::MouseClickType type) |
| Gets the mutable MouseActions for a given mouse click type. | |
| const MouseActions & | getDefaultAction (MouseEvent::MouseClickType type) const |
| Gets the const MouseActions for a given mouse click type. | |
| const MouseEvent & | lastMouseEvent () const |
| Returns the last mouse event that was processed. | |
| bool | processMouseEvent (MouseControllerEvent &event, SelectionInfo &info) override |
| Processes a mouse event, delegating to registered sub-controllers and handling camera manipulation, selection, and context menu requests. | |
| void | removeController (UUID id) |
| Removes a previously registered mouse sub-controller. | |
| void | resetContextMenuRequested () |
| Resets the context menu request flag to false. | |
| void | resetSelectionRequested () |
| Resets the selection request flag to false. | |
| bool | selectionRequested () const |
| Checks whether a selection has been requested by a recent mouse event. | |
| void | setNDEVRDefaults () |
| Resets all mouse action bindings to the NDEVR default configuration. | |
| Public Member Functions inherited from INIInterface | |
| INIInterface () | |
| Constructs an INIInterface with no default INI file. | |
| INIInterface (const File &default_ini) | |
| Constructs an INIInterface with the specified default INI file. | |
| virtual | ~INIInterface () |
| Virtual destructor for safe polymorphic cleanup. | |
| virtual void | finishReadingINI (INIFactory &) |
| Called after reading an INI file. | |
| virtual void | prepareForINI (INIFactory &) |
| Called before reading or writing an INI file. | |
| virtual bool | readINIOptions () |
| Reads INI options from the default INI file. | |
| virtual bool | readINIOptions (File &ini_file) |
| Reads INI options from the specified INI file. | |
| virtual bool | saveINIOptions (bool multithead=false) |
| Saves INI options to the default INI file. | |
| virtual bool | saveINIOptions (File &ini_file, bool multithead=false) |
| Saves INI options to the specified INI file. | |
| void | setDefaultINIFile (const File &file) |
| Sets the default INI file path used for reading and writing options. | |
| virtual void | writeToLog (const StringView &title, LogPtr log, uint01 log_level=2U) |
| Writes the current INI options to the specified log with a title. | |
| virtual void | writeToLog (LogPtr log, uint01 log_level=2U) |
| Writes the current INI options to the specified log. | |
Public Attributes | |
| MouseActions | center_mouse_action |
| Action bindings for the center (middle) mouse button. | |
| Resource< String > | cursor |
| The current cursor icon name. | |
| Resource< UUID > | focus |
| The UUID of the currently focused object. | |
| Resource< String > | information |
| Informational text associated with current mouse state. | |
| MouseActions | left_mouse_action |
| Action bindings for the left mouse button. | |
| Resource< uint04 > | number_of_mouse_clicks |
| Counter for total mouse clicks processed. | |
| Resource< uint04 > | number_of_mouse_events |
| Counter for total mouse events processed. | |
| MouseActions | right_mouse_action |
| Action bindings for the right mouse button. | |
| Resource< Buffer< UUID > > | selected |
| The currently selected object UUIDs. | |
| Resource< UUID > | selected_layer |
| The UUID of the currently selected layer. | |
| MouseActions | wheel_mouse_action |
| Action bindings for the mouse wheel. | |
Protected Attributes | |
| Dictionary< UUID, MouseControllerBase * > | m_controller_lookup |
| Maps controller UUIDs to their instances. | |
| Buffer< MouseControllerBase * > | m_controllers |
| Ordered list of registered sub-controllers. | |
| bool | m_ignore_next_event_if_click |
| If true, the next click event will be ignored. | |
| bool | m_request_context_menu |
| Flag indicating a context menu has been requested. | |
| bool | m_request_selection |
| Flag indicating a selection has been requested. | |
| DynamicPointer< SnapController > | m_snap_controller |
| Pointer to the snap controller for snapping behavior. | |
| Protected Attributes inherited from INIInterface | |
| File | m_default_ini |
| The default file path used for reading and writing INI options. | |
Private Member Functions | |
| void | getINI (INIFactory &factory) override |
| Serializes and deserializes mouse controller settings to/from INI configuration. | |
Contains logic for executing actions based on user mouse inputs.
Manages mouse button bindings, camera manipulation (orbit, pan, zoom), selection, context menus, and delegates to registered sub-controllers. Persists settings via INIInterface.
Definition at line 88 of file MouseController.h.
Defines the possible actions that can be bound to a mouse button interaction.
Definition at line 103 of file MouseController.h.
Defines which type of design object is targeted during mouse selection.
Definition at line 120 of file MouseController.h.
Defines the reference point used for camera operations such as orbit and zoom.
Definition at line 94 of file MouseController.h.
| MouseController::MouseController | ( | ) |
Constructs a MouseController with default settings.
|
virtual |
Destructor.
| void MouseController::addController | ( | UUID | id, |
| MouseControllerBase * | controller ) |
Registers a mouse sub-controller with a given identifier.
| [in] | id | The unique identifier for the controller. |
| [in] | controller | Pointer to the MouseControllerBase to register. |
|
inline |
Checks whether a context menu has been requested by a recent mouse event.
Definition at line 216 of file MouseController.h.
References m_request_context_menu.
| MouseAction MouseController::getAction | ( | const MouseEvent & | event | ) | const |
Determines the action to perform for a given mouse event based on current bindings.
| [in] | event | The mouse event to evaluate. |
| MouseActions & MouseController::getDefaultAction | ( | MouseEvent::MouseClickType | type | ) |
Gets the mutable MouseActions for a given mouse click type.
| [in] | type | The mouse click type (left, right, center, etc.). |
| const MouseActions & MouseController::getDefaultAction | ( | MouseEvent::MouseClickType | type | ) | const |
Gets the const MouseActions for a given mouse click type.
| [in] | type | The mouse click type (left, right, center, etc.). |
|
overrideprivatevirtual |
Serializes and deserializes mouse controller settings to/from INI configuration.
| [in] | factory | The INI factory used for reading or writing settings. |
Implements INIInterface.
|
inline |
Returns the last mouse event that was processed.
Definition at line 234 of file MouseController.h.
|
overridevirtual |
Processes a mouse event, delegating to registered sub-controllers and handling camera manipulation, selection, and context menu requests.
| [in] | event | The mouse controller event to process. |
| [in] | info | The selection info to update. |
Implements MouseControllerBase.
| void MouseController::removeController | ( | UUID | id | ) |
Removes a previously registered mouse sub-controller.
| [in] | id | The unique identifier of the controller to remove. |
|
inline |
Resets the context menu request flag to false.
Definition at line 220 of file MouseController.h.
References m_request_context_menu.
|
inline |
Resets the selection request flag to false.
Definition at line 229 of file MouseController.h.
References m_request_selection.
|
inline |
Checks whether a selection has been requested by a recent mouse event.
Definition at line 225 of file MouseController.h.
References m_request_selection.
| void MouseController::setNDEVRDefaults | ( | ) |
Resets all mouse action bindings to the NDEVR default configuration.