33#include <NDEVR/DesignObjectGallery.h>
34#include <NDEVR/Dictionary.h>
37 class DesignObjectChooserUI;
119 void updateFromArchive(
bool show_active_models,
bool show_active_materials,
bool refresh_archive_files);
230 Ui::DesignObjectChooserUI*
ui;
The equivelent of std::vector but with a bit more control.
void clear()
Clears all categories and items from the chooser.
void onCategoryChanged()
Slot called when the active category is changed by the user.
bool m_is_material_chooser
Whether this chooser is configured for materials.
QTModelManager * m_manager
The model manager providing scene data.
void addButton(Button *button)
Adds a custom button to the chooser toolbar.
void updateFromArchive(bool show_active_models, bool show_active_materials, bool refresh_archive_files)
Updates the chooser contents from the archive with full control over categories.
void setModelManager(QTModelManager *manager)
Sets the model manager used to populate design objects.
void updateFromArchive(bool refresh_archive_files)
Updates the chooser contents from the archive.
void setLibraryManager(LibraryManager *manager)
Sets the library manager used to populate archived objects.
void filter(const String &keyword_search)
Filters the displayed items by a keyword search string.
void init()
Initializes the UI layout and connects signals.
bool m_is_library
Whether this chooser is sourcing from a library archive.
DesignObjectChooser(QWidget *parent=nullptr)
Constructs a DesignObjectChooser with no manager.
void setCategory(const String &category)
Sets the active category by name.
void showActiveModelsCategory(bool show)
Sets whether the active models category is shown.
bool m_is_model_chooser
Whether this chooser is configured for models.
Buffer< String > m_category_list
Ordered list of category names.
void exportImages()
Exports images of the selected design objects.
Dictionary< String, Buffer< UUID > > m_keywords
Keyword-to-UUID mapping for search filtering.
DesignObjectGallery::SelectionMode m_default_mode
The default gallery selection mode.
void filterFromManager()
Filters the displayed items using data from the model manager.
void setSaveSelection(bool multiselection)
Configures the chooser for save-selection mode.
void removeCategory(const StringView &name)
Removes a category by name from the chooser.
void onSelectedSignal(Buffer< UUID > id)
Emitted when the selection changes.
void setSelectionMode(DesignObjectGallery::SelectionMode selection_mode)
Sets the selection mode for the gallery (single or multi-select).
void setSelected(const Buffer< UUID > &id)
Sets the currently selected items by their UUIDs.
QSize sizeHint() const override
Returns the recommended size for this widget.
void addCategory(const StringView &name, const Buffer< UUID > &items)
Adds a named category with the specified items to the chooser.
LibraryManager * m_library_manager
The library manager providing archived objects.
bool assignToSelection(Model &model)
Assigns the current selection to the specified model.
void onUserSelectedSignal(Buffer< UUID > id)
Emitted when the user explicitly selects objects (as opposed to programmatic selection).
void showFileMenu(bool is_save, const Buffer< UUID > &ids=Buffer< UUID >())
Shows the file import/export menu.
Ui::DesignObjectChooserUI * ui
Pointer to the auto-generated UI form.
bool assignToModel(UUID id, Model &model)
Assigns the design object with the given UUID to the specified model.
void initContextMenu(Button *button)
Initializes the context menu for a button.
void showActiveMaterialsCategory(bool show)
Sets whether the active materials category is shown.
Buffer< UUID > currentSelection() const
Returns the UUIDs of the currently selected design objects.
String m_keyword_search
The current keyword search filter.
bool m_is_save_selection
Whether save-selection mode is active.
DesignObjectChooser(QTModelManager *manager, QWidget *parent=nullptr)
Constructs a DesignObjectChooser using the given model manager.
void contextMenuChangedSignal()
Emitted when the context menu configuration changes.
void filterFromArchive()
Filters the displayed items using data from the archive.
LibraryManager * activeLibrary()
Returns the active library manager.
DesignObjectChooser(LibraryManager *manager, QWidget *parent=nullptr)
Constructs a DesignObjectChooser using the given library manager.
Dictionary< String, Buffer< UUID > > m_categories
Category-to-UUID mapping for category filtering.
SelectionMode
Defines how user selection behaves in the gallery.
@ e_single_selection
User can select a single object at a time.
A hash-based key-value store, useful for quick associative lookups.
Manages loading Models from a group that is stored either on a remote server or locally on the disk i...
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 View class for the NDEVR API.
The core String class for the NDEVR API.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.