NDEVR
API Documentation
PaintCommandWidget

A widget that is shown when the user scales a 3D model. More...

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

Public Member Functions

 PaintCommandWidget (QTModelManager *manager)
 Constructs the paint command widget.
SelectionInfo createSelectionInfo (const MouseEvent &event, Camera *camera)
 Creates selection info from a mouse event for determining paint targets.
virtual SubSelectionMode defaultSelectionMode () const override
 Returns the default sub-selection mode for this function.
virtual QWidget * editWidget () override
 Gets the edit widget displayed to the user during painting.
virtual TranslatedString expandedHint () const override
 Gets the expanded tooltip description for this command.
virtual TranslatedString group () const override
 Gets the ribbon group name for this command.
virtual TranslatedString hint () const override
 Gets the short tooltip hint for this command.
virtual bool isSelecting () const override
 Checks whether the function is currently in a selection state.
virtual void onCancel () override
 Called when the function's operation is cancelled.
virtual void onSelect (const Buffer< UUID > &selection) override
 Called when objects are selected during this function's operation.
virtual bool processKeyEvent (const KeyEvent &event, DesignObjectLookup *lookup, Camera *camera) override
 Processes a keyboard event during this function's operation.
virtual bool processMouseEvent (MouseControllerEvent &event) override
 Processes a mouse controller event during this function's operation.
virtual void refreshState (ModelEditController &controller) override
 Refreshes the internal state of this function based on the current controller state.
virtual bool selectionModeAllowed (const SubSelectionMode &mode) const override
 Checks whether a given sub-selection mode is valid for this function.
virtual void setupFilters (SelectionController *controller) override
 Sets up selection filters on the given selection controller for this function.
Public Member Functions inherited from QtModelFunction
virtual bool shouldShowInterface () const override
 Returns whether the function should show a UI interface.
Public Member Functions inherited from ModelFunction
virtual bool canAutoFinishNow () const
 Checks whether the function can automatically finish in its current 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.
Public Member Functions inherited from QTImageEditor
 QTImageEditor (QWidget *parent=nullptr)
 Constructs a QTImageEditor widget.
virtual ~QTImageEditor ()
 Destroys this QTImageEditor widget.
void editedSignal ()
 Emitted when the image has been edited.
const StringView imageID () const
 Returns the resource identifier of the currently loaded image.
QTImageEditorViewimageView () const
 Returns the underlying image editor view widget.
bool isEditing () const
 Returns whether a drawing or text editing operation is currently in progress.
virtual void keyReleaseEvent (QKeyEvent *event) override
 Handles key release events for shortcuts such as undo and redo.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for this widget.
void mousePressLocation (const Vector< 2, fltp08 > &end_point)
 Handles a mouse press at the given normalized location.
void mouseReleaseLocation (const Vector< 2, fltp08 > &end_point)
 Handles a mouse release at the given normalized location.
void pushUpdate ()
 Pushes the current image state as a saved update to the resource system.
void refreshToImage (const StringView &image)
 Reloads the image from the given resource identifier, discarding unsaved changes.
void setEditMode (QTImageEditorView::EditMode mode)
 Sets the active editing mode for the image editor view.
void setImage (const TranslatedString title, const StringView &image)
 Sets the image to edit from a resource identifier.
void setOptimalScale ()
 Calculates and applies the optimal scale to fit the image in the view.
void setVertical (bool vertical)
 Sets the layout orientation of the editor toolbar.
void showEvent (QShowEvent *event) override
 Handles the show event to initialize the editor view.
QSize sizeHint () const override
 Returns the recommended size for this widget.
void updateCursorLocation (const Vector< 2, fltp08 > &end_point)
 Updates the cursor position during a drag operation.

Protected Attributes

UUID m_current_model = Constant<UUID>::Invalid
 The UUID of the model currently being painted.
QTModelManagerm_manager
 The model manager for accessing design data.
Protected Attributes inherited from ModelFunction
ModelEditController * m_controller = nullptr
 Pointer to the owning ModelEditController.

Additional Inherited Members

Public Attributes inherited from ModelFunction
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 inherited from ModelFunction
virtual void setController (ModelEditController *controller)
 Sets the owning controller for this function.
Protected Member Functions inherited from QTImageEditor
void colorsEdited ()
 Slot called when pen or fill colors have been changed by the user.
void editedSlot ()
 Slot called when the image has been edited, to update undo state.
void sizeChangedSlot ()
 Slot called when the image size has changed.

Detailed Description

A widget that is shown when the user scales a 3D model.


Definition at line 10 of file PaintCommandWidget.h.

Constructor & Destructor Documentation

◆ PaintCommandWidget()

PaintCommandWidget::PaintCommandWidget ( QTModelManager * manager)

Constructs the paint command widget.

Parameters
[in]managerThe model manager providing access to design data.

References PaintCommandWidget().

Referenced by PaintCommandWidget().

Member Function Documentation

◆ createSelectionInfo()

SelectionInfo PaintCommandWidget::createSelectionInfo ( const MouseEvent & event,
Camera * camera )

Creates selection info from a mouse event for determining paint targets.

Parameters
[in]eventThe mouse event to interpret.
[in]cameraThe camera providing the viewport context.
Returns
The selection info describing the paint target.

◆ defaultSelectionMode()

virtual SubSelectionMode PaintCommandWidget::defaultSelectionMode ( ) const
overridevirtual

Returns the default sub-selection mode for this function.

Returns
The default SubSelectionMode.

Implements ModelFunction.

◆ isSelecting()

virtual bool PaintCommandWidget::isSelecting ( ) const
overridevirtual

Checks whether the function is currently in a selection state.

Returns
True if the function is selecting, false otherwise.

Implements ModelFunction.

◆ onSelect()

virtual void PaintCommandWidget::onSelect ( const Buffer< UUID > & )
overridevirtual

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

Parameters
[in]selected_idsThe UUIDs of the selected objects.

Reimplemented from ModelFunction.

◆ processKeyEvent()

virtual bool PaintCommandWidget::processKeyEvent ( const KeyEvent & ,
DesignObjectLookup * ,
Camera *  )
overridevirtual

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 from ModelFunction.

◆ processMouseEvent()

virtual bool PaintCommandWidget::processMouseEvent ( MouseControllerEvent & )
overridevirtual

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 from ModelFunction.

◆ refreshState()

virtual void PaintCommandWidget::refreshState ( ModelEditController & controller)
overridevirtual

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

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

Implements ModelFunction.

◆ selectionModeAllowed()

virtual bool PaintCommandWidget::selectionModeAllowed ( const SubSelectionMode & mode) const
overridevirtual

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.

Implements ModelFunction.

◆ setupFilters()

virtual void PaintCommandWidget::setupFilters ( SelectionController * )
overridevirtual

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

Parameters
[in]controllerThe selection controller to configure.

Reimplemented from ModelFunction.


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