![]() |
NDEVR
API Documentation
|
A specified type of DesignCommand that can make objects visible or invisible in a 3D space such as a viewport. More...
Public Member Functions | |
| VisibleCommand (bool make_visible) | |
| Constructs a VisibleCommand that will either show or hide target objects. | |
| virtual bool | addTarget (UUID target_id) override |
| Adds a target object UUID to the list of objects this command will affect. | |
| virtual void | execute (DesignObjectLookup *lookup) override |
| Executes the visibility command on the given design lookup. | |
| StringView | icon () const override |
| Returns the icon name representing the current visibility state. | |
| TranslatedString | name () const override |
| Returns the translated display name for this command. | |
| Public Member Functions inherited from DesignCommand | |
| DesignCommand () | |
| Default constructor. | |
| DesignCommand (const DesignCommand &command)=default | |
| Default copy constructor. | |
| virtual | ~DesignCommand () |
| Virtual destructor. | |
| virtual bool | canCombineWith (const DynamicPointer< DesignCommand > &) |
| Checks whether this command can be combined with another command into a single operation. | |
| virtual bool | canGroupWith (const DynamicPointer< DesignCommand > &) |
| Checks whether this command can be grouped with another command for batch execution. | |
| virtual void | combineWith (const DynamicPointer< DesignCommand > &command) |
| Combines this command with another compatible command, merging their operations. | |
| virtual bool | isAsyncExecution () const |
| Whether this command should be executed asynchronously. | |
| void | setUndoRedoID (UUID undo_redo_group) |
| Sets the undo-redo group identifier for this command. | |
| UUID | undoRedoID () const |
| Gets the undo-redo group identifier for this command. | |
Public Attributes | |
| Buffer< UUID > | targets |
| The list of target object UUIDs whose visibility will be changed. | |
| Public Attributes inherited from DesignCommand | |
| bool | can_undo = true |
| Whether this command supports being undone. | |
| bool | has_executed = false |
| Whether this command has already been executed. | |
| UUID | id |
| Unique identifier for this command instance. | |
| bool | is_undo = false |
| Whether this command represents an undo operation. | |
| LogPtr | log |
| Log pipe for reporting command progress and errors. | |
| Time | time = Constant<Time>::Invalid |
| Timestamp of when the command was created or executed. | |
| bool | update_project_modified = true |
| Whether executing this command should mark the project as modified. | |
Protected Attributes | |
| bool | m_make_visible |
| Whether this command makes objects visible (true) or invisible (false). | |
| Buffer< UUID > | m_models_to_toggle |
| Tracks UUIDs of all models actually toggled during execution, used for undo. | |
| Protected Attributes inherited from DesignCommand | |
| UUID | m_undo_redo_group |
| The undo-redo group this command belongs to, for batch undo/redo. | |
A specified type of DesignCommand that can make objects visible or invisible in a 3D space such as a viewport.
Definition at line 15 of file VisibleCommand.h.
|
inline |
Constructs a VisibleCommand that will either show or hide target objects.
| [in] | make_visible | Whether this command makes objects visible (true) or invisible (false). |
Definition at line 22 of file VisibleCommand.h.
References DesignCommand::DesignCommand(), and m_make_visible.
|
inlineoverridevirtual |
Adds a target object UUID to the list of objects this command will affect.
| [in] | target_id | The UUID of the model or layer to add as a target. |
Reimplemented from DesignCommand.
Definition at line 107 of file VisibleCommand.h.
References targets.
|
inlineoverridevirtual |
Executes the visibility command on the given design lookup.
When executed normally, iterates through all targets and sets their spacial_visible property to the desired state. When making objects visible, also walks up the parent hierarchy to ensure ancestor layers are visible. Tracks all toggled models so the operation can be undone.
When undoing, reverts the spacial_visible property of all previously toggled models.
| [in] | lookup | The design object lookup providing access to models and layers. |
Reimplemented from DesignCommand.
Definition at line 37 of file VisibleCommand.h.
References DesignObject::get(), Model::getLayer(), Model::getParent(), guid, Model::hasDirectLayer(), DesignCommand::is_undo, DesignObject::isValid(), Model::isVisible(), DesignObjectLookup::lockPtr(), m_make_visible, m_models_to_toggle, DesignObjectLookup::modelOrLayer(), spacial_visible, targets, and DesignObject::update().
|
inlineoverridevirtual |
Returns the icon name representing the current visibility state.
Implements DesignCommand.
Definition at line 84 of file VisibleCommand.h.
References m_make_visible.
|
inlineoverridevirtual |
Returns the translated display name for this command.
Implements DesignCommand.
Definition at line 95 of file VisibleCommand.h.
References m_make_visible.