![]() |
NDEVR
API Documentation
|
Provides a screen of buttons that allow the user to pick a Model for an action. More...
Public Member Functions | |
| DesignObjectChooser (LibraryManager *manager, QWidget *parent=nullptr) | |
| Constructs a DesignObjectChooser using the given library manager. | |
| DesignObjectChooser (QTModelManager *manager, QWidget *parent=nullptr) | |
| Constructs a DesignObjectChooser using the given model manager. | |
| DesignObjectChooser (QWidget *parent=nullptr) | |
| Constructs a DesignObjectChooser with no manager. | |
| LibraryManager * | activeLibrary () |
| Returns the active library manager. | |
| void | addButton (Button *button) |
| Adds a custom button to the chooser toolbar. | |
| void | addCategory (const StringView &name, const Buffer< UUID > &items) |
| Adds a named category with the specified items to the chooser. | |
| bool | assignToModel (UUID id, Model &model) |
| Assigns the design object with the given UUID to the specified model. | |
| bool | assignToSelection (Model &model) |
| Assigns the current selection to the specified model. | |
| void | clear () |
| Clears all categories and items from the chooser. | |
| void | contextMenuChangedSignal () |
| Emitted when the context menu configuration changes. | |
| Buffer< UUID > | currentSelection () const |
| Returns the UUIDs of the currently selected design objects. | |
| void | filter (const String &keyword_search) |
| Filters the displayed items by a keyword search string. | |
| void | filterFromArchive () |
| Filters the displayed items using data from the archive. | |
| void | filterFromManager () |
| Filters the displayed items using data from the model manager. | |
| void | onSelectedSignal (Buffer< UUID > id) |
| Emitted when the selection changes. | |
| void | onUserSelectedSignal (Buffer< UUID > id) |
| Emitted when the user explicitly selects objects (as opposed to programmatic selection). | |
| void | removeCategory (const StringView &name) |
| Removes a category by name from the chooser. | |
| void | setCategory (const String &category) |
| Sets the active category by name. | |
| void | setLibraryManager (LibraryManager *manager) |
| Sets the library manager used to populate archived objects. | |
| void | setModelManager (QTModelManager *manager) |
| Sets the model manager used to populate design objects. | |
| void | setSelected (const Buffer< UUID > &id) |
| Sets the currently selected items by their UUIDs. | |
| void | setSelectionMode (DesignObjectGallery::SelectionMode selection_mode) |
| Sets the selection mode for the gallery (single or multi-select). | |
| void | showActiveMaterialsCategory (bool show) |
| Sets whether the active materials category is shown. | |
| void | showActiveModelsCategory (bool show) |
| Sets whether the active models category is shown. | |
| QSize | sizeHint () const override |
| Returns the recommended size for this widget. | |
| void | updateFromArchive (bool refresh_archive_files) |
| Updates the chooser contents from the archive. | |
| 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. | |
Protected Member Functions | |
| void | exportImages () |
| Exports images of the selected design objects. | |
| void | init () |
| Initializes the UI layout and connects signals. | |
| void | initContextMenu (Button *button) |
| Initializes the context menu for a button. | |
| void | onCategoryChanged () |
| Slot called when the active category is changed by the user. | |
| void | setSaveSelection (bool multiselection) |
| Configures the chooser for save-selection mode. | |
| void | showFileMenu (bool is_save, const Buffer< UUID > &ids=Buffer< UUID >()) |
| Shows the file import/export menu. | |
Protected Attributes | |
| Dictionary< String, Buffer< UUID > > | m_categories |
| Category-to-UUID mapping for category filtering. | |
| Buffer< String > | m_category_list |
| Ordered list of category names. | |
| DesignObjectGallery::SelectionMode | m_default_mode = DesignObjectGallery::SelectionMode::e_single_selection |
| The default gallery selection mode. | |
| bool | m_is_library = false |
| Whether this chooser is sourcing from a library archive. | |
| bool | m_is_material_chooser |
| Whether this chooser is configured for materials. | |
| bool | m_is_model_chooser |
| Whether this chooser is configured for models. | |
| bool | m_is_save_selection = false |
| Whether save-selection mode is active. | |
| String | m_keyword_search |
| The current keyword search filter. | |
| Dictionary< String, Buffer< UUID > > | m_keywords |
| Keyword-to-UUID mapping for search filtering. | |
| LibraryManager * | m_library_manager |
| The library manager providing archived objects. | |
| QTModelManager * | m_manager |
| The model manager providing scene data. | |
| Ui::DesignObjectChooserUI * | ui |
| Pointer to the auto-generated UI form. | |
Provides a screen of buttons that allow the user to pick a Model for an action.
Definition at line 44 of file DesignObjectChooser.h.
| DesignObjectChooser::DesignObjectChooser | ( | QWidget * | parent = nullptr | ) |
Constructs a DesignObjectChooser with no manager.
| [in] | parent | The parent widget. |
| DesignObjectChooser::DesignObjectChooser | ( | QTModelManager * | manager, |
| QWidget * | parent = nullptr ) |
Constructs a DesignObjectChooser using the given model manager.
| [in] | manager | The model manager providing design objects. |
| [in] | parent | The parent widget. |
| DesignObjectChooser::DesignObjectChooser | ( | LibraryManager * | manager, |
| QWidget * | parent = nullptr ) |
Constructs a DesignObjectChooser using the given library manager.
| [in] | manager | The library manager providing archived objects. |
| [in] | parent | The parent widget. |
| LibraryManager * DesignObjectChooser::activeLibrary | ( | ) |
Returns the active library manager.
| void DesignObjectChooser::addButton | ( | Button * | button | ) |
Adds a custom button to the chooser toolbar.
| [in] | button | The button to add. |
| void DesignObjectChooser::addCategory | ( | const StringView & | name, |
| const Buffer< UUID > & | items ) |
Adds a named category with the specified items to the chooser.
| [in] | name | The display name of the category. |
| [in] | items | The UUIDs of design objects in this category. |
| bool DesignObjectChooser::assignToSelection | ( | Model & | model | ) |
Assigns the current selection to the specified model.
| [in] | model | The target model to receive the selection. |
Returns the UUIDs of the currently selected design objects.
| void DesignObjectChooser::filter | ( | const String & | keyword_search | ) |
Filters the displayed items by a keyword search string.
| [in] | keyword_search | The search string to filter by. |
|
protected |
Initializes the context menu for a button.
| [in] | button | The button to attach the context menu to. |
Emitted when the selection changes.
| [in] | id | The UUIDs of the newly selected objects. |
Emitted when the user explicitly selects objects (as opposed to programmatic selection).
| [in] | id | The UUIDs of the user-selected objects. |
| void DesignObjectChooser::removeCategory | ( | const StringView & | name | ) |
Removes a category by name from the chooser.
| [in] | name | The name of the category to remove. |
| void DesignObjectChooser::setCategory | ( | const String & | category | ) |
Sets the active category by name.
| [in] | category | The name of the category to display. |
| void DesignObjectChooser::setLibraryManager | ( | LibraryManager * | manager | ) |
Sets the library manager used to populate archived objects.
| [in] | manager | The library manager to use. |
| void DesignObjectChooser::setModelManager | ( | QTModelManager * | manager | ) |
Sets the model manager used to populate design objects.
| [in] | manager | The model manager to use. |
|
protected |
Configures the chooser for save-selection mode.
| [in] | multiselection | True to enable multi-selection for saving. |
Sets the currently selected items by their UUIDs.
| [in] | id | The UUIDs to select. |
| void DesignObjectChooser::setSelectionMode | ( | DesignObjectGallery::SelectionMode | selection_mode | ) |
Sets the selection mode for the gallery (single or multi-select).
| [in] | selection_mode | The selection mode to apply. |
| void DesignObjectChooser::showActiveMaterialsCategory | ( | bool | show | ) |
Sets whether the active materials category is shown.
| [in] | show | True to show the active materials category. |
| void DesignObjectChooser::showActiveModelsCategory | ( | bool | show | ) |
Sets whether the active models category is shown.
| [in] | show | True to show the active models category. |
|
protected |
Shows the file import/export menu.
| [in] | is_save | True if this is a save operation, false for load. |
| [in] | ids | The UUIDs of design objects to operate on. |
|
override |
Returns the recommended size for this widget.
| void DesignObjectChooser::updateFromArchive | ( | bool | refresh_archive_files | ) |
Updates the chooser contents from the archive.
| [in] | refresh_archive_files | Whether to reload archive files from disk. |
| void DesignObjectChooser::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.
| [in] | show_active_models | Whether to include active models from the scene. |
| [in] | show_active_materials | Whether to include active materials from the scene. |
| [in] | refresh_archive_files | Whether to reload archive files from disk. |