NDEVR
API Documentation
ModelFunctionabstract

A Model function allows a user to interact with the program to perform a task on models. More...

Inheritance diagram for ModelFunction:
[legend]
Collaboration diagram for ModelFunction:
[legend]

Public Member Functions

virtual bool canAutoFinishNow () const
 Checks whether the function can automatically finish in its current state.
virtual SubSelectionMode defaultSelectionMode () const =0
 Returns the default sub-selection mode for this function.
virtual TranslatedString expandedHint () const
 Returns an expanded hint with more detailed description of the function.
virtual TranslatedString group () const
 Returns the group or category this function belongs to for UI organization.
virtual TranslatedString hint () const
 Returns a short hint or tooltip string describing the function.
virtual bool isSelecting () const =0
 Checks whether the function is currently in a selection state.
virtual void onCancel ()=0
 Called when the function's operation is cancelled.
virtual void onSelect (const Buffer< UUID > &)
 Called when objects are selected during this function's operation.
virtual bool processKeyEvent (const KeyEvent &, DesignObjectLookup *, Camera *)
 Processes a keyboard event during this function's operation.
virtual bool processMouseEvent (MouseControllerEvent &)
 Processes a mouse controller event during this function's operation.
virtual void refreshState (ModelEditController &controller)=0
 Refreshes the internal state of this function based on the current controller state.
virtual void requestCancel ()
 Requests cancellation of the current function through the controller.
virtual void requestFinish ()
 Requests that the function finishes its operation through the controller.
virtual void requestFinishSelection ()
 Requests that the selection phase of this function be completed.
virtual bool selectionModeAllowed (const SubSelectionMode &mode) const =0
 Checks whether a given sub-selection mode is valid for this function.
virtual void setupFilters (SelectionController *)
 Sets up selection filters on the given selection controller for this function.
virtual bool shouldShowInterface () const
 Checks whether this function should display a UI interface panel.

Public Attributes

String icon
 The icon identifier used for toolbar/menu display.
UUID id
 Unique identifier for this model function.
TranslatedString name
 The display name of the function shown in UI.

Protected Member Functions

virtual void setController (ModelEditController *controller)
 Sets the owning controller for this function.

Protected Attributes

ModelEditController * m_controller = nullptr
 Pointer to the owning ModelEditController.

Detailed Description

A Model function allows a user to interact with the program to perform a task on models.


ModelFunction is an abstract interface representing a user-driven operation that can be performed on models in the scene. Subclasses implement specific behaviors such as drawing, measuring, or editing model geometry. Each function manages its own selection state and can process mouse and key events.

Definition at line 49 of file ModelEditController.h.

Member Function Documentation

◆ canAutoFinishNow()

virtual bool ModelFunction::canAutoFinishNow ( ) const
inlinevirtual

Checks whether the function can automatically finish in its current state.

Returns
True if auto-finish is possible now, false otherwise.

Definition at line 110 of file ModelEditController.h.

◆ defaultSelectionMode()

virtual SubSelectionMode ModelFunction::defaultSelectionMode ( ) const
pure virtual

Returns the default sub-selection mode for this function.

Returns
The default SubSelectionMode.

Implemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

◆ expandedHint()

virtual TranslatedString ModelFunction::expandedHint ( ) const
inlinevirtual

Returns an expanded hint with more detailed description of the function.

Returns
The translated expanded hint text, or an empty string by default.

Reimplemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

Definition at line 75 of file ModelEditController.h.

◆ group()

virtual TranslatedString ModelFunction::group ( ) const
virtual

Returns the group or category this function belongs to for UI organization.

Returns
The translated group name.

Reimplemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

◆ hint()

virtual TranslatedString ModelFunction::hint ( ) const
inlinevirtual

Returns a short hint or tooltip string describing the function.

Returns
The translated hint text, or an empty string by default.

Reimplemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

Definition at line 69 of file ModelEditController.h.

◆ isSelecting()

virtual bool ModelFunction::isSelecting ( ) const
pure virtual

Checks whether the function is currently in a selection state.

Returns
True if the function is selecting, false otherwise.

Implemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

◆ onSelect()

virtual void ModelFunction::onSelect ( const Buffer< UUID > & )
inlinevirtual

Called when objects are selected during this function's operation.

Parameters
[in]selected_idsThe UUIDs of the selected objects.

Reimplemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

Definition at line 128 of file ModelEditController.h.

◆ processKeyEvent()

virtual bool ModelFunction::processKeyEvent ( const KeyEvent & ,
DesignObjectLookup * ,
Camera *  )
inlinevirtual

Processes a keyboard event during this function's operation.

Parameters
[in]eventThe key event to process.
[in]lookupThe design object lookup for scene queries.
[in]cameraThe active camera.
Returns
True if the event was handled, false otherwise.

Reimplemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

Definition at line 98 of file ModelEditController.h.

◆ processMouseEvent()

virtual bool ModelFunction::processMouseEvent ( MouseControllerEvent & )
inlinevirtual

Processes a mouse controller event during this function's operation.

Parameters
[in]eventThe mouse controller event to process.
Returns
True if the event was handled, false otherwise.

Reimplemented in PaintCommandWidget.

Definition at line 89 of file ModelEditController.h.

◆ refreshState()

virtual void ModelFunction::refreshState ( ModelEditController & controller)
pure virtual

Refreshes the internal state of this function based on the current controller state.

Parameters
[in]controllerThe model edit controller managing this function.

Implemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

◆ selectionModeAllowed()

virtual bool ModelFunction::selectionModeAllowed ( const SubSelectionMode & mode) const
pure virtual

Checks whether a given sub-selection mode is valid for this function.

Parameters
[in]modeThe sub-selection mode to check.
Returns
True if the mode is allowed, false otherwise.

Implemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

◆ setController()

virtual void ModelFunction::setController ( ModelEditController * controller)
protectedvirtual

Sets the owning controller for this function.

Parameters
[in]controllerThe model edit controller that owns this function.

◆ setupFilters()

virtual void ModelFunction::setupFilters ( SelectionController * )
inlinevirtual

Sets up selection filters on the given selection controller for this function.

Parameters
[in]controllerThe selection controller to configure.

Reimplemented in FrameOfReferenceCommandWidget, GeometrySurfacingFunction, PaintCommandWidget, and ScaleCommandWidget.

Definition at line 122 of file ModelEditController.h.

◆ shouldShowInterface()

virtual bool ModelFunction::shouldShowInterface ( ) const
inlinevirtual

Checks whether this function should display a UI interface panel.

Returns
True if the interface should be shown, false otherwise.

Reimplemented in QtModelFunction.

Definition at line 155 of file ModelEditController.h.


The documentation for this class was generated from the following file: