33#include <NDEVR/QTModelManager.h>
34#include <NDEVR/TranslatedString.h>
The equivelent of std::vector but with a bit more control.
A core class where all Design Objects including models, materials, and geometries are stored.
A hash-based key-value store, useful for quick associative lookups.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
void saveAllImagesToFolder(File folder)
Saves all library model images to the specified folder.
void pullFromArchiveFile(File file)
Imports library models from an archive file.
bool assignToModel(UUID id, Model &model)
Assigns a library model to an existing scene model.
Model findObject(const UUID &id)
Finds and returns a Model object for the given library ID.
File m_archive_path
The root folder containing library archives.
void saveToArchiveFile(const Buffer< UUID > &ids, File file)
Saves specific library models to an archive file.
void modelRemoved(UUID id)
Emitted when a model is removed from the library.
void removeFromLibrary(const Buffer< UUID > &object)
Removes multiple models from the library.
uint04 modelCount() const
Returns the total number of models in the library.
void updateFromArchive()
Reloads the library from the archive folder on disk.
void removeFromLibrary(const UUID &object)
Removes a single model from the library.
void recomputeObject(UUID)
Recomputes the cached data for a single library object.
LibraryManager(QTModelManager *manager, const File &library_folder)
Constructs a LibraryManager that loads models from the given folder.
QTModelManager * m_manager
The model manager providing scene data.
void updateFromArchive(const UUID &file)
Reloads a single library entry from its archive by UUID.
TranslatedString getSearchTerms(const UUID &id) const
Returns the search terms associated with the given library model.
Dictionary< UUID, TranslatedString > m_names
Maps model UUIDs to display names.
String getType(const UUID &id) const
Returns the type string for the given library model.
void modelAdded(UUID id)
Emitted when a model is added to the library.
TranslatedString getName(const UUID &id) const
Returns the display name for the given library model.
void updateFromArchive(const File &file)
Reloads library entries from the specified archive file.
Buffer< UUID > m_ids
All model UUIDs in the library.
Buffer< TranslatedString > getCategories() const
Returns all unique category names across library models.
Buffer< UUID > getIDsByCategory(const TranslatedString &category)
Returns all model UUIDs belonging to the given category.
void recomputeAll()
Recomputes the cached data for all library objects.
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.
void centerModel(Model &model)
Centers the given model at the origin.
Dictionary< UUID, String > m_types
Maps model UUIDs to type strings.
DesignObjectLookup m_library_lookup
Lookup table for library design objects.
void saveImagesToFolder(const Buffer< UUID > &ids, File folder)
Saves images for specific library models to the specified folder.
Dictionary< UUID, TranslatedString > m_categories
Maps model UUIDs to category names.
void recomputeObjects(const Buffer< UUID > &ids)
Recomputes the cached data for multiple library objects.
QTModelManager * manager()
Returns the model manager backing this library.
Dictionary< UUID, TranslatedString > m_search_terms
Maps model UUIDs to search terms.
std::function< bool(UUID, Model &)> getModelCallback()
Returns a callback function for resolving library models by UUID.
void saveToArchiveFile(File file)
Saves the entire library to an archive file.
bool hasID(const UUID &id) const
Returns whether the library contains a model with the given ID.
bool writeToLibrary(const UUID &object_to_write, UUID library_id)
Writes a scene object into the library storage.
void addToLibrary(const UUID &object, UUID library_object)
Adds an existing scene object to the library under the given library ID.
Buffer< String > getTypes() const
Returns all unique type strings across library models.
void addLayer(Model &model)
Adds a layer to the given model from the library.
A core class that represents a node on model hierarchy.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
The core String class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...