![]() |
NDEVR
API Documentation
|
Manages loading Models from a group that is stored either on a remote server or locally on the disk in a compressed or uncompressed folder. More...
Public Member Functions | |
| LibraryManager (QTModelManager *manager, const File &library_folder) | |
| Constructs a LibraryManager that loads models from the given folder. | |
| void | addLayer (Model &model) |
| Adds a layer to the given model from the library. | |
| void | addToLibrary (const UUID &object, UUID library_object) |
| Adds an existing scene object to the library under the given library ID. | |
| bool | assignToModel (UUID id, Model &model) |
| Assigns a library model to an existing scene model. | |
| void | centerModel (Model &model) |
| Centers the given model at the origin. | |
| Model | findObject (const UUID &id) |
| Finds and returns a Model object for the given library ID. | |
| Buffer< TranslatedString > | getCategories () const |
| Returns all unique category names across library models. | |
| String | getIcon (const UUID &id) const |
| Returns the icon name for the given library model. | |
| Buffer< UUID > | getIDs () const |
| Returns all model UUIDs in the library. | |
| Buffer< UUID > | getIDsByCategory (const TranslatedString &category) |
| Returns all model UUIDs belonging to the given category. | |
| std::function< bool(UUID, Model &)> | getModelCallback () |
| Returns a callback function for resolving library models by UUID. | |
| TranslatedString | getName (const UUID &id) const |
| Returns the display name for the given library model. | |
| TranslatedString | getSearchTerms (const UUID &id) const |
| Returns the search terms associated with the given library model. | |
| String | getType (const UUID &id) const |
| Returns the type string for the given library model. | |
| Buffer< String > | getTypes () const |
| Returns all unique type strings across library models. | |
| bool | hasID (const UUID &id) const |
| Returns whether the library contains a model with the given ID. | |
| QTModelManager * | manager () |
| Returns the model manager backing this library. | |
| void | modelAdded (UUID id) |
| Emitted when a model is added to the library. | |
| uint04 | modelCount () const |
| Returns the total number of models in the library. | |
| void | modelRemoved (UUID id) |
| Emitted when a model is removed from the library. | |
| void | pullFromArchiveFile (File file) |
| Imports library models from an archive file. | |
| void | recomputeAll () |
| Recomputes the cached data for all library objects. | |
| void | recomputeObject (UUID) |
| Recomputes the cached data for a single library object. | |
| void | recomputeObjects (const Buffer< UUID > &ids) |
| Recomputes the cached data for multiple library objects. | |
| void | removeFromLibrary (const Buffer< UUID > &object) |
| Removes multiple models from the library. | |
| void | removeFromLibrary (const UUID &object) |
| Removes a single model from the library. | |
| void | saveAllImagesToFolder (File folder) |
| Saves all library model images to the specified folder. | |
| void | saveImagesToFolder (const Buffer< UUID > &ids, File folder) |
| Saves images for specific library models to the specified folder. | |
| void | saveToArchiveFile (const Buffer< UUID > &ids, File file) |
| Saves specific library models to an archive file. | |
| void | saveToArchiveFile (File file) |
| Saves the entire library to an archive file. | |
| void | updateFromArchive () |
| Reloads the library from the archive folder on disk. | |
Protected Member Functions | |
| void | updateFromArchive (const File &file) |
| Reloads library entries from the specified archive file. | |
| void | updateFromArchive (const UUID &file) |
| Reloads a single library entry from its archive by UUID. | |
| bool | writeToLibrary (const UUID &object_to_write, UUID library_id) |
| Writes a scene object into the library storage. | |
Protected Attributes | |
| File | m_archive_path |
| The root folder containing library archives. | |
| Dictionary< UUID, TranslatedString > | m_categories |
| Maps model UUIDs to category names. | |
| Buffer< UUID > | m_ids |
| All model UUIDs in the library. | |
| DesignObjectLookup | m_library_lookup |
| Lookup table for library design objects. | |
| QTModelManager * | m_manager |
| The model manager providing scene data. | |
| Dictionary< UUID, TranslatedString > | m_names |
| Maps model UUIDs to display names. | |
| Dictionary< UUID, TranslatedString > | m_search_terms |
| Maps model UUIDs to search terms. | |
| Dictionary< UUID, String > | m_types |
| Maps model UUIDs to type strings. | |
Manages loading Models from a group that is stored either on a remote server or locally on the disk in a compressed or uncompressed folder.
Definition at line 41 of file LibraryManager.h.
| LibraryManager::LibraryManager | ( | QTModelManager * | manager, |
| const File & | library_folder ) |
Constructs a LibraryManager that loads models from the given folder.
| [in] | manager | The model manager providing scene data. |
| [in] | library_folder | The folder containing library model archives. |
References manager().
| void LibraryManager::addLayer | ( | Model & | model | ) |
Adds a layer to the given model from the library.
| [in] | model | The model to add a layer to. |
Assigns a library model to an existing scene model.
| [in] | id | The UUID of the library model. |
| [in] | model | The scene model to assign to. |
| void LibraryManager::centerModel | ( | Model & | model | ) |
Centers the given model at the origin.
| [in] | model | The model to center. |
| Buffer< TranslatedString > LibraryManager::getCategories | ( | ) | const |
Returns all unique category names across library models.
Returns the icon name for the given library model.
| [in] | id | The UUID of the library model. |
Returns all model UUIDs in the library.
Definition at line 110 of file LibraryManager.h.
References m_ids.
| Buffer< UUID > LibraryManager::getIDsByCategory | ( | const TranslatedString & | category | ) |
Returns all model UUIDs belonging to the given category.
| [in] | category | The category to filter by. |
|
inline |
Returns the display name for the given library model.
| [in] | id | The UUID of the library model. |
Definition at line 62 of file LibraryManager.h.
References m_names.
|
inline |
Returns the search terms associated with the given library model.
| [in] | id | The UUID of the library model. |
Definition at line 80 of file LibraryManager.h.
References m_search_terms.
Returns the type string for the given library model.
| [in] | id | The UUID of the library model. |
Definition at line 71 of file LibraryManager.h.
References m_types.
Returns all unique type strings across library models.
| bool LibraryManager::hasID | ( | const UUID & | id | ) | const |
Returns whether the library contains a model with the given ID.
| [in] | id | The UUID to check. |
|
inline |
Returns the model manager backing this library.
Definition at line 195 of file LibraryManager.h.
References m_manager.
Referenced by LibraryManager().
| void LibraryManager::modelAdded | ( | UUID | id | ) |
Emitted when a model is added to the library.
| [in] | id | The UUID of the added model. |
| uint04 LibraryManager::modelCount | ( | ) | const |
Returns the total number of models in the library.
| void LibraryManager::modelRemoved | ( | UUID | id | ) |
Emitted when a model is removed from the library.
| [in] | id | The UUID of the removed model. |
| void LibraryManager::pullFromArchiveFile | ( | File | file | ) |
Imports library models from an archive file.
| [in] | file | The archive file to import from. |
| void LibraryManager::recomputeObject | ( | UUID | ) |
Recomputes the cached data for a single library object.
| [in] | id | The UUID of the object to recompute (unnamed parameter). |
Recomputes the cached data for multiple library objects.
| [in] | ids | The UUIDs of objects to recompute. |
Removes multiple models from the library.
| [in] | object | The UUIDs of models to remove. |
| void LibraryManager::removeFromLibrary | ( | const UUID & | object | ) |
Removes a single model from the library.
| [in] | object | The UUID of the model to remove. |
| void LibraryManager::saveAllImagesToFolder | ( | File | folder | ) |
Saves all library model images to the specified folder.
| [in] | folder | The destination folder for images. |
Saves images for specific library models to the specified folder.
| [in] | ids | The UUIDs of models whose images to save. |
| [in] | folder | The destination folder for images. |
Saves specific library models to an archive file.
| [in] | ids | The UUIDs of models to include. |
| [in] | file | The destination archive file. |
| void LibraryManager::saveToArchiveFile | ( | File | file | ) |
Saves the entire library to an archive file.
| [in] | file | The destination archive file. |
|
protected |
Reloads library entries from the specified archive file.
| [in] | file | The archive file to reload from. |
|
protected |