NDEVR
API Documentation
QTDesignObject

A pointer to a DesignObject within a QTModelManager that receives and emits update signals based on the state of the object. More...

Collaboration diagram for QTDesignObject:
[legend]

Public Member Functions

void deletedSignal (UUID id)
 Emitted when this object is deleted.
void deleteModel (UUID id)
 Emits the deleted signal if this object matches the given UUID.
void deleteObject ()
 Deletes this object from the model manager.
void descendentUpdatedSignal (UUID id)
 Emitted when a descendent of this object is updated.
TranslatedString displayName () const
 Gets the user-facing display name of this object.
void exportToFile ()
 Exports this object to an external file format.
template<auto t_property>
decltype(auto) get () const
 Gets a compile-time property value from the underlying design object.
template<class t_type, class t_property_type>
decltype(auto) get (t_property_type property) const
 Gets a typed property value from the underlying design object.
template<class t_type>
t_type getAs () const
 Converts this design object to the specified type.
DesignSelection getAsSelection () const
 Gets this object as a DesignSelection.
UUID id () const
 Gets the UUID of this design object.
template<class t_type>
bool is () const
 Checks whether this object is of the specified design object type.
QTModelManager * manager () const
 Gets the model manager that owns this object.
void postCommand (const DynamicPointer< DesignCommand > &command)
 Posts a design command to the command queue for deferred execution.
template<class t_design_command_type>
void postCommand (const DynamicPointer< t_design_command_type > &command)
 Posts a typed design command to the command queue for deferred execution.
void postCommand (std::initializer_list< DynamicPointer< DesignCommand > > l)
 Posts a group of design commands to the command queue for deferred execution.
void runCommand (const DynamicPointer< DesignCommand > &command)
 Runs a design command immediately.
template<class t_design_command_type>
void runCommand (const DynamicPointer< t_design_command_type > &command)
 Runs a typed design command immediately.
void runCommand (std::initializer_list< DynamicPointer< DesignCommand > > l)
 Runs a group of design commands immediately.
void selectedSignal (UUID id)
 Emitted when this object is selected.
void setFocus (bool focus)
 Sets the UI focus to this object.
void setSelected (bool is_selected)
 Sets this object as selected in the model manager.
void showProperties (const PopupInfo &location=PopupInfo())
 Opens the properties dialog for this object.
void update ()
 Updates the design modified timestamp for this object.
void updateDescendent ()
 Emits the descendent updated signal for this object.
void updatedSignal (UUID id)
 Emitted when this object is updated.
void updateObject ()
 Emits the updated signal for this object.
void updateSelected (UUID id, bool is_selected)
 Emits the selected signal if this object matches the given UUID and is selected.
UUID uuid () const
 Gets the UUID of this design object.
void zoomToModel () const
 Zooms the viewport camera to focus on this model.

Protected Member Functions

 QTDesignObject (const QTDesignObject &object)
 Copy constructs a QTDesignObject from another.
 QTDesignObject (const UUID &object, QTModelManager *manager)
 Constructs a QTDesignObject wrapping the given UUID and manager.

Protected Attributes

UUID m_id
 The UUID of the wrapped design object.
QTModelManager * m_manager
 The model manager owning this object.

Detailed Description

A pointer to a DesignObject within a QTModelManager that receives and emits update signals based on the state of the object.


Definition at line 97 of file QTDesignObject.h.

Constructor & Destructor Documentation

◆ QTDesignObject() [1/2]

QTDesignObject::QTDesignObject ( const UUID & object,
QTModelManager * manager )
inlineprotected

Constructs a QTDesignObject wrapping the given UUID and manager.

Parameters
[in]objectThe UUID of the design object.
[in]managerThe model manager owning the object.

Definition at line 107 of file QTDesignObject.h.

References m_id, m_manager, and manager().

Referenced by QTDesignObject(), and exportToFile().

◆ QTDesignObject() [2/2]

QTDesignObject::QTDesignObject ( const QTDesignObject & object)
inlineprotected

Copy constructs a QTDesignObject from another.

Parameters
[in]objectThe QTDesignObject to copy.

Definition at line 117 of file QTDesignObject.h.

References QTDesignObject(), m_id, and m_manager.

Member Function Documentation

◆ deleteModel()

void QTDesignObject::deleteModel ( UUID id)
inline

Emits the deleted signal if this object matches the given UUID.

Parameters
[in]idThe UUID of the object being deleted.

Definition at line 278 of file QTDesignObject.h.

References deletedSignal(), and uuid().

◆ displayName()

TranslatedString QTDesignObject::displayName ( ) const
inline

Gets the user-facing display name of this object.

Returns
The translated display name.

Definition at line 181 of file QTDesignObject.h.

References get(), getAs(), and is().

◆ get() [1/2]

template<auto t_property>
decltype(auto) QTDesignObject::get ( ) const
inline

Gets a compile-time property value from the underlying design object.

Returns
The property value.

Definition at line 173 of file QTDesignObject.h.

References m_id, and m_manager.

◆ get() [2/2]

template<class t_type, class t_property_type>
decltype(auto) QTDesignObject::get ( t_property_type property) const
inline

Gets a typed property value from the underlying design object.

Parameters
[in]propertyThe property identifier to retrieve.
Returns
The property value.

Definition at line 164 of file QTDesignObject.h.

References m_id, and m_manager.

Referenced by displayName().

◆ getAs()

template<class t_type>
t_type QTDesignObject::getAs ( ) const
inline

Converts this design object to the specified type.

Returns
The object converted to the requested type, or a default-constructed instance if invalid.

Definition at line 151 of file QTDesignObject.h.

References m_id, and m_manager.

Referenced by displayName().

◆ getAsSelection()

DesignSelection QTDesignObject::getAsSelection ( ) const

Gets this object as a DesignSelection.

Returns
The DesignSelection for this object.

◆ id()

UUID QTDesignObject::id ( ) const
inline

Gets the UUID of this design object.

Returns
The UUID.

Definition at line 242 of file QTDesignObject.h.

References m_id.

◆ is()

template<class t_type>
bool QTDesignObject::is ( ) const
inline

Checks whether this object is of the specified design object type.

Returns
True if the object matches the given type.

Definition at line 133 of file QTDesignObject.h.

References IsValid(), m_id, and m_manager.

Referenced by displayName().

◆ manager()

QTModelManager * QTDesignObject::manager ( ) const
inline

Gets the model manager that owns this object.

Returns
A pointer to the QTModelManager.

Definition at line 247 of file QTDesignObject.h.

References m_manager.

Referenced by QTDesignObject().

◆ postCommand() [1/3]

void QTDesignObject::postCommand ( const DynamicPointer< DesignCommand > & command)

Posts a design command to the command queue for deferred execution.

Parameters
[in]commandThe command to post.

◆ postCommand() [2/3]

template<class t_design_command_type>
void QTDesignObject::postCommand ( const DynamicPointer< t_design_command_type > & command)
inline

Posts a typed design command to the command queue for deferred execution.

Parameters
[in]commandThe command to post.

Definition at line 199 of file QTDesignObject.h.

References postCommand().

Referenced by postCommand(), and postCommand().

◆ postCommand() [3/3]

void QTDesignObject::postCommand ( std::initializer_list< DynamicPointer< DesignCommand > > l)
inline

Posts a group of design commands to the command queue for deferred execution.

Parameters
[in]lThe initializer list of commands to post.

Definition at line 216 of file QTDesignObject.h.

References postCommand().

◆ runCommand() [1/3]

void QTDesignObject::runCommand ( const DynamicPointer< DesignCommand > & command)

Runs a design command immediately.

Parameters
[in]commandThe command to run.

◆ runCommand() [2/3]

template<class t_design_command_type>
void QTDesignObject::runCommand ( const DynamicPointer< t_design_command_type > & command)
inline

Runs a typed design command immediately.

Parameters
[in]commandThe command to run.

Definition at line 208 of file QTDesignObject.h.

References runCommand().

Referenced by runCommand(), and runCommand().

◆ runCommand() [3/3]

void QTDesignObject::runCommand ( std::initializer_list< DynamicPointer< DesignCommand > > l)
inline

Runs a group of design commands immediately.

Parameters
[in]lThe initializer list of commands to run.

Definition at line 224 of file QTDesignObject.h.

References runCommand().

◆ setFocus()

void QTDesignObject::setFocus ( bool focus)
inline

Sets the UI focus to this object.

Parameters
[in]focusWhether to set focus.

Definition at line 308 of file QTDesignObject.h.

References m_manager, and uuid().

◆ setSelected()

void QTDesignObject::setSelected ( bool is_selected)
inline

Sets this object as selected in the model manager.

Parameters
[in]is_selectedWhether to select the object.

Definition at line 317 of file QTDesignObject.h.

References is_selected, m_id, and m_manager.

◆ showProperties()

void QTDesignObject::showProperties ( const PopupInfo & location = PopupInfo())

Opens the properties dialog for this object.

Parameters
[in]locationPopup positioning information for the dialog.

◆ updateSelected()

void QTDesignObject::updateSelected ( UUID id,
bool is_selected )
inline

Emits the selected signal if this object matches the given UUID and is selected.

Parameters
[in]idThe UUID of the object being selected.
[in]is_selectedWhether the object is selected.

Definition at line 266 of file QTDesignObject.h.

References is_selected, selectedSignal(), and uuid().

◆ uuid()

UUID QTDesignObject::uuid ( ) const
inline

Gets the UUID of this design object.

Returns
The UUID.

Definition at line 142 of file QTDesignObject.h.

References m_id.

Referenced by deleteModel(), deleteObject(), setFocus(), update(), updateDescendent(), updateObject(), updateSelected(), and zoomToModel().


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