![]() |
NDEVR
API Documentation
|
A Qt compatible ItemModel for interfacing with a DesignObjectLookup. More...
Classes | |
| struct | ModelCache |
| Cached data for a single model entry in the tree view, storing display properties to avoid repeated lookups. More... | |
Public Member Functions | |
| QTModelManagerView (QTModelManager *manager, QObject *parent=nullptr) | |
| Constructs a model manager view for the given manager. | |
| QTModelManager & | manager () |
| Retrieves the underlying model manager. | |
| const Buffer< UUID > & | rootModels () const |
| Retrieves the current root model UUIDs. | |
| void | setIsRootFilter (const std::function< bool(const Model &)> &filter) |
| Sets a filter function that determines which models are treated as roots. | |
| void | setRootModels (const Buffer< UUID > &roots) |
| Sets the root models displayed in the view. | |
Protected Member Functions | |
| void | addModel (UUID id) |
| Adds a model to the view and cache. | |
| void | clearAll () |
| Clears all cached data and resets the view. | |
| ModelCache | createCache (const Model &model, bool recursive, bool parent_visible, bool add_id) const |
| Creates a cache entry for a model. | |
| QVariant | data (const UUID &id, int role, int column) const |
| Retrieves display data for a specific model by UUID, role, and column. | |
| void | emitIndexUpdated (const UUID &id, const QList< int > &roles=QList< int >()) |
| Emits data-changed signals for a specific model index. | |
| QModelIndex | getIndex (const Model &model, int column) const |
| Retrieves the QModelIndex for a model at a specific column. | |
| QModelIndex | getIndex (const UUID &id, int column) const |
| Retrieves the QModelIndex for a model UUID at a specific column. | |
| UUID | getMaterialID (const QModelIndex &model_index) const |
| Retrieves the material UUID for a given QModelIndex. | |
| UUID | getModelID (const QModelIndex &model_index) const |
| Retrieves the model UUID for a given QModelIndex. | |
| bool | hasCached (const UUID &id) const |
| Checks whether cached data exists for a given model UUID. | |
| QIcon::Mode | iconMode (const QModelIndex &index) const |
| Determines the icon display mode for the given index. | |
| void | materialUpdatedSlot (const Buffer< UUID > &updated_ids) |
| Handles material update events. | |
| Model | model (const QModelIndex &model_index) const |
| Retrieves a Model object for a given QModelIndex. | |
| Model | model (uint04 row, const QModelIndex &parent) const |
| Retrieves a Model object by row and parent index. | |
| void | modelAdded (Buffer< UUID > id) |
| Handles model addition events. | |
| void | modelDeleted (Buffer< UUID > id) |
| Handles model deletion events. | |
| void | modelFocussed (UUID id, bool selected) |
| Handles model focus change events. | |
| void | modelUpdatedSlot (const Buffer< UUID > &updated_ids) |
| Handles model update events. | |
| void | objectSelected (Buffer< UUID > id, bool selected) |
| Handles object selection change events. | |
| void | postMaterialImageRequest (const UUID &id) const |
| Posts a request to generate a material preview image. | |
| void | projectChanged (UUID id) |
| Handles project change events. | |
| void | recursiveCacheRemove (const UUID &id) |
| Recursively removes a model and its children from the cache. | |
| void | refreshAll () |
| Refreshes the entire view by rebuilding all caches. | |
| void | setupCache (const Model &model, bool recursive, bool parent_visible, bool add_id) const |
| Populates the cache for a model and optionally its children. | |
| void | topLevelChanged (Buffer< UUID > id) |
| Handles top-level parent change events for models. | |
| void | updateModel3DVisible (const UUID &id, bool visible) |
| Updates the 3D visibility state of a cached model. | |
Protected Attributes | |
| Dictionary< UUID, QIcon > | m_cached_material_images |
| Cached material preview icons. | |
| Dictionary< UUID, Set< UUID > > | m_cached_material_indices |
| Map of materials to the models using them. | |
| Dictionary< UUID, ModelCache > | m_cached_model_indices |
| Cached display data per model. | |
| bool | m_include_materials = true |
| Whether to show materials as child items. | |
| Buffer< UUID > | m_index_ids |
| Flat list mapping cache indices to UUIDs. | |
| QTModelManager * | m_manager |
| The underlying model manager. | |
| UUID | m_project_id |
| UUID of the currently active project. | |
| std::function< bool(const Model &)> | m_root_filter |
| Optional filter for determining root models. | |
| Buffer< UUID > | m_root_models |
| UUIDs of the root models displayed in the view. | |
| UUID | m_tree_capture_id |
| UUID of the tree capture request. | |
A Qt compatible ItemModel for interfacing with a DesignObjectLookup.
Definition at line 43 of file QTModelManagerView.h.
| QTModelManagerView::QTModelManagerView | ( | QTModelManager * | manager, |
| QObject * | parent = nullptr ) |
Constructs a model manager view for the given manager.
| [in] | manager | The QTModelManager to display. |
| [in] | parent | The parent QObject. |
References manager().
Referenced by manager().
|
protected |
Adds a model to the view and cache.
| [in] | id | The UUID of the model to add. |
|
protected |
Creates a cache entry for a model.
| [in] | model | The model to cache. |
| [in] | recursive | Whether to recursively cache children. |
| [in] | parent_visible | Whether the parent model is visible. |
| [in] | add_id | Whether to add the model to the index ID list. |
References model().
|
protected |
|
protected |
Emits data-changed signals for a specific model index.
| [in] | id | The UUID of the updated model. |
| [in] | roles | The Qt roles that changed. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Determines the icon display mode for the given index.
| [in] | index | The model index to query. |
| QTModelManager & QTModelManagerView::manager | ( | ) |
Retrieves the underlying model manager.
References QTModelManagerView().
Referenced by QTModelManagerView().
Handles material update events.
| [in] | updated_ids | The UUIDs of the updated materials. |
|
protected |
Retrieves a Model object for a given QModelIndex.
| [in] | model_index | The index to query. |
Referenced by createCache(), getIndex(), and setupCache().
Handles model addition events.
| [in] | id | The UUIDs of the added models. |
Handles model deletion events.
| [in] | id | The UUIDs of the deleted models. |
|
protected |
Handles model focus change events.
| [in] | id | The UUID of the focused model. |
| [in] | selected | Whether the model gained or lost focus. |
Handles model update events.
| [in] | updated_ids | The UUIDs of the updated models. |
Handles object selection change events.
| [in] | id | The UUIDs of the affected objects. |
| [in] | selected | Whether the objects were selected or deselected. |
|
protected |
Posts a request to generate a material preview image.
| [in] | id | The UUID of the material. |
|
protected |
Handles project change events.
| [in] | id | The UUID of the new active project. |
|
protected |
Recursively removes a model and its children from the cache.
| [in] | id | The UUID of the model to remove. |
Retrieves the current root model UUIDs.
Definition at line 100 of file QTModelManagerView.h.
References m_root_models.
|
inline |
Sets a filter function that determines which models are treated as roots.
| [in] | filter | A function returning true for models that should be roots. |
Definition at line 105 of file QTModelManagerView.h.
References m_root_filter.
Sets the root models displayed in the view.
| [in] | roots | The UUIDs of the root models. |
|
protected |
Handles top-level parent change events for models.
| [in] | id | The UUIDs of the affected models. |
|
protected |
Updates the 3D visibility state of a cached model.
| [in] | id | The UUID of the model. |
| [in] | visible | The new visibility state. |