33#include <NDEVR/QTModelManager.h>
34#include <NDEVR/LibraryManager.h>
35#include <NDEVR/ButtonGallery.h>
36#include <NDEVR/Button.h>
72 void clear(
bool keep_selection);
The equivelent of std::vector but with a bit more control.
void resizeEvent(QResizeEvent *resize_event) override
Handles resize events to reflow gallery layout.
const QTModelManager * manager()
Returns the current model manager.
void setButtonVisible(const UUID &id, bool visible)
Sets the visibility of a specific gallery button by its UUID.
SelectionMode m_selection_mode
The current selection mode.
DesignObjectGallery(QWidget *parent=nullptr)
Constructs a DesignObjectGallery.
void saveRequestedSignal(Buffer< UUID > ids)
Emitted when the user requests that the selected objects be saved.
SelectionMode selectionMode() const
Returns the current selection mode.
void clear() override
Clears all gallery items and resets the selection.
bool m_is_material_gallery
Whether this gallery displays materials.
void setLibrary(LibraryManager *manager)
Sets the library manager used for library-based galleries.
void setManager(QTModelManager *manager)
Sets the model manager used to look up design objects.
void onSelectedSignal(Buffer< UUID > ids)
Emitted when the selection changes for any reason.
Dictionary< UUID, DynamicPointer< CaptureRequest > > m_active_requests
Active thumbnail capture requests.
void setObjects(const Buffer< UUID > &objects, bool keep_selected)
Populates the gallery with the given set of objects.
void setSelectionMode(SelectionMode selection_mode)
Sets the selection mode for the gallery.
void onUserSelectedSignal(Buffer< UUID > ids)
Emitted when the user explicitly changes the selection via interaction.
TranslatedString getObjectName(const UUID &id) const
Retrieves the display name for a given object UUID.
void fillWithModels(bool keep_selected)
Populates the gallery with all available models.
void sortByName()
Sorts the gallery items alphabetically by name.
const Buffer< UUID > currentSelection() const
Returns the currently selected UUIDs.
void setIsMaterialGallery(bool is_material)
Sets whether this gallery is being used as a material gallery.
void updateFromLibrary(const UUID &id)
Updates a gallery entry from the library manager.
void updateObjectsSlot(Buffer< UUID > ids)
Slot called to update gallery buttons when objects change.
void fillWithMaterials(bool keep_selected)
Populates the gallery with all available materials.
Buffer< UUID > m_objects
The ordered list of object UUIDs in the gallery.
const Buffer< UUID > & ids() const
Returns the ordered list of object UUIDs currently in the gallery.
void setSelected(const Buffer< UUID > &id, bool scroll_to_selected=false)
Sets the selected items in the gallery.
Set< UUID > m_current_selection
The set of currently selected object UUIDs.
SelectionMode
Defines how user selection behaves in the gallery.
@ e_multi_selection
Allows multiple simultaneous selections.
@ e_no_selection
User can click on an item but it does not become selected.
@ e_single_selection
User can select a single object at a time.
LibraryManager * m_library_manager
The library manager for library-based galleries.
Dictionary< UUID, TranslatedString > m_object_names
Cached display names for objects.
void updateFromManager(const UUID &id)
Updates a gallery entry from the model manager.
void scrollToSelected()
Scrolls the gallery view to make the currently selected item visible.
UUID m_capture_id
The UUID used for thumbnail capture requests.
void clear(bool keep_selection)
Clears all gallery items, optionally preserving the current selection.
Ribbon * m_browser_ribbon
The ribbon widget used for browsing categories.
Dictionary< UUID, Button * > m_buttons
Maps each object UUID to its gallery button.
void fillWithMaterials(Model model, bool keep_selected)
Populates the gallery with materials from a specific model.
QTModelManager * m_manager
The model manager providing design objects.
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 UI ribbon is a horizontal menu bar typically located at the top of the application interface or a...
Container that stores unique elements in no particular order, and which allow for fast retrieval or i...
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.