![]() |
NDEVR
API Documentation
|
Custom model logic that manages build action definitions, providing UI integration for build actions including ribbon buttons, tree widgets, context menus, and property dialogs. More...
Public Member Functions | |
| BuildActionProgramLogic (QTWindowManager *window_manager, QTModelManager *manager) | |
| Constructs the build action program logic. | |
| bool | canBeHandledBySelectionWidget () const override |
| Returns whether this model type can be handled by the generic selection widget. | |
| Button * | createButton (const BuildActionDefinition &definition) |
| Creates a button that opens the property dialog for the given build action. | |
| void | setupUI (const BuildActionDefinition &definition) |
| Sets up ribbon and tree buttons for the given build action definition. | |
| Public Member Functions inherited from CustomModelLogic | |
| virtual const UUID & | id () const |
| Returns the unique identifier for this custom model logic instance. | |
| virtual void | registerAll () |
| Registers all callbacks (context menu, tree widgets, dialog, NDV) with the manager. | |
| const Buffer< String > & | typeNames () const |
| Returns the type names handled by this custom model logic. | |
Protected Member Functions | |
| virtual void | addMenuItems (Model &model, QTModelManager *, QMenu &menu, const Buffer< UUID > &, const SelectionInfo &) override |
| Override to add custom context menu items when a model of this type is selected. | |
| void | createAndShowChildDefinition (Model &model, PopupInfo info) |
| Creates a child build action definition under the given model and shows its editor. | |
| void | executeMenuItems (Model &model, QTModelManager *manager, QAction *action, const Buffer< UUID > &, const SelectionInfo &, PopupInfo info) override |
| Override to handle execution of custom context menu actions. | |
| virtual void | setTreeWidgetsForSelection (const Model &model, Buffer< QWidget * > &widgets, SceneTree *tree) override |
| Override to provide custom tree widgets shown when the model is selected. | |
| virtual void | setupModel (Model &model) override |
| Override to perform setup when a model of this type is read from an NDV file. | |
| virtual void | setupPropertiesDialog (DesignObjectDialog *dialog, const DynamicPointer< QTDesignObject > &object) override |
| Override to customize property dialogs when objects of this type are created. | |
| Protected Member Functions inherited from CustomModelLogic | |
| CustomModelLogic (QTModelManager *manager, const Buffer< String > &type_names) | |
| Constructs a CustomModelLogic for multiple model type names. | |
| CustomModelLogic (QTModelManager *manager, const StringView &type_name) | |
| Constructs a CustomModelLogic for a single model type name. | |
| virtual | ~CustomModelLogic () |
| Destructor. | |
| ContextMenuCallback * | contextMenuCallback () |
| Returns the context menu callback for this model logic. | |
| CustomDesignObjectDialogSetupCallback * | dialogSetupCallback () |
| Returns the dialog setup callback for this model logic. | |
| NDVSetupCallback * | ndvFileReadLogic () |
| Returns the NDV file read setup callback for this model logic. | |
| void | setSorter (const std::function< bool(const Model &a, const Model &b)> &sort_function) |
| Sets a custom sorting function for models of this type. | |
| virtual void | setupUI (WindowManager *) |
| Override to set up custom UI elements for this model type. | |
| CustomTreeWidgets * | treeWidgetCallback () |
| Returns the tree widget callback for this model logic. | |
Protected Attributes | |
| Dictionary< UUID, Buffer< QPointer< Button > > > | m_buttons |
| Maps action UUIDs to their UI buttons. | |
| QAction * | m_create_child_action = nullptr |
| Context menu action to create a child action. | |
| Button * | m_create_child_button = nullptr |
| Create-child button for the tree widget. | |
| QAction * | m_create_new_action_after = nullptr |
| Context menu action to insert an action after. | |
| QAction * | m_create_new_action_before = nullptr |
| Context menu action to insert an action before. | |
| Model | m_last_model |
| The most recently selected model. | |
| Button * | m_play_button = nullptr |
| Play button for the tree widget. | |
| QAction * | m_run_menu_action = nullptr |
| Context menu action to run the build action. | |
| QTWindowManager * | m_window_manager |
| The window manager for UI operations. | |
| Protected Attributes inherited from CustomModelLogic | |
| ContextMenuCallback * | m_custom_context_menu = nullptr |
| Callback for custom context menu actions. | |
| CustomDesignObjectDialogSetupCallback * | m_dialog_callback = nullptr |
| Callback for customizing property dialogs. | |
| UUID | m_id |
| The unique identifier for this logic instance. | |
| QTModelManager * | m_manager |
| The model manager providing data context. | |
| NDVSetupCallback * | m_ndv_setup_callback = nullptr |
| Callback for NDV file read setup. | |
| CustomModelSorter * | m_sorter = nullptr |
| Custom sorting logic for the model type. | |
| CustomTreeWidgets * | m_tree_button_menu = nullptr |
| Callback for custom tree selection widgets. | |
| Buffer< String > | m_type_names |
| The model type names handled by this logic. | |
Custom model logic that manages build action definitions, providing UI integration for build actions including ribbon buttons, tree widgets, context menus, and property dialogs.
Definition at line 23 of file BuildActionProgramLogic.h.
|
inline |
Constructs the build action program logic.
| [in] | window_manager | The window manager for UI integration. |
| [in] | manager | The model manager for data access. |
Definition at line 29 of file BuildActionProgramLogic.h.
References CustomModelLogic::CustomModelLogic(), and BuildActionDefinition::TypeName().
|
inlineoverrideprotectedvirtual |
Override to add custom context menu items when a model of this type is selected.
| [in] | model | The model that was right-clicked (unused parameter name). |
| [in] | manager | The model manager (unused parameter name). |
| [in] | menu | The context menu to populate (unused parameter name). |
| [in] | ids | The UUIDs of selected objects (unused parameter name). |
| [in] | info | The selection context information (unused parameter name). |
Reimplemented from CustomModelLogic.
Definition at line 104 of file BuildActionProgramLogic.h.
References BuildActionDefinition::action(), e_file_loop, e_index_loop, e_process_files, e_variable_loop, e_workflow, QTIconManager::GetIconResourceBlocking(), Model::getParent(), DesignObject::isValid(), m_create_child_action, m_create_new_action_after, m_create_new_action_before, and m_run_menu_action.
|
inlineoverridevirtual |
Returns whether this model type can be handled by the generic selection widget.
Reimplemented from CustomModelLogic.
Definition at line 61 of file BuildActionProgramLogic.h.
|
inlineprotected |
Creates a child build action definition under the given model and shows its editor.
| [in] | model | The parent model to add the child to. |
| [in] | info | Popup info for dialog display. |
Definition at line 220 of file BuildActionProgramLogic.h.
References BuildActionDefinition::createChildBuildDefinition(), e_object_creation, guid, and CustomModelLogic::m_manager.
Referenced by executeMenuItems(), and setTreeWidgetsForSelection().
|
inline |
Creates a button that opens the property dialog for the given build action.
| [in] | definition | The build action definition. |
Definition at line 47 of file BuildActionProgramLogic.h.
References Model::displayName(), DesignObject::get(), DesignObject::getIcon(), guid, and m_buttons.
Referenced by setupUI().
|
inlineoverrideprotectedvirtual |
Override to handle execution of custom context menu actions.
| [in] | model | The model the action applies to (unused parameter name). |
| [in] | manager | The model manager (unused parameter name). |
| [in] | action | The triggered action (unused parameter name). |
| [in] | ids | The UUIDs of selected objects (unused parameter name). |
| [in] | info | The selection context information (unused parameter name). |
| [in] | origin | The popup origin for positioning dialogs (unused parameter name). |
Reimplemented from CustomModelLogic.
Definition at line 134 of file BuildActionProgramLogic.h.
References QTModelManager::addModel(), createAndShowChildDefinition(), Model::createChild(), BuildActionDefinition::defaultLogName(), e_object_creation, BuildActionDefinition::executeThreaded(), DesignObject::get(), Model::getChildIndex(), LogManager::getLog(), Model::getParent(), guid, DesignObject::isValid(), DesignObjectLookup::lockPtr(), QTModelManager::logManager(), m_create_child_action, m_create_new_action_after, m_create_new_action_before, m_last_model, m_run_menu_action, QTModelManager::ShowProperties(), Model::updateModifiedTime(), and DesignObjectLookup::writeLock().
|
inlineoverrideprotectedvirtual |
Override to provide custom tree widgets shown when the model is selected.
| [in] | model | The selected model (unused parameter name). |
| [in] | widgets | Buffer to populate with custom widgets (unused parameter name). |
| [in] | tree | The scene tree requesting the widgets (unused parameter name). |
Reimplemented from CustomModelLogic.
Definition at line 180 of file BuildActionProgramLogic.h.
References BuildActionDefinition::action(), Buffer< t_type, t_memory_manager >::add(), createAndShowChildDefinition(), BuildActionDefinition::defaultLogName(), e_file_loop, e_index_loop, e_process_files, Button::e_small, e_variable_loop, e_workflow, BuildActionDefinition::executeThreaded(), LogManager::getLog(), DesignObjectLookup::lockPtr(), QTModelManager::logManager(), m_create_child_button, m_last_model, m_play_button, and SceneTree::manager().
|
inlineoverrideprotectedvirtual |
Override to perform setup when a model of this type is read from an NDV file.
| [in] | model | The model being set up (unused parameter name). |
Reimplemented from CustomModelLogic.
Definition at line 170 of file BuildActionProgramLogic.h.
References application_locked, DesignObject::is(), model_color, DesignObject::set(), setupUI(), type, and BuildActionDefinition::TypeName().
|
inlineoverrideprotectedvirtual |
Override to customize property dialogs when objects of this type are created.
| [in] | dialog | The design object dialog to modify (unused parameter name). |
| [in] | object | The design object being edited (unused parameter name). |
Reimplemented from CustomModelLogic.
Definition at line 163 of file BuildActionProgramLogic.h.
References DesignObjectDialog::addTabDialog().
|
inline |
Sets up ribbon and tree buttons for the given build action definition.
| [in] | definition | The build action definition to create UI for. |
Definition at line 67 of file BuildActionProgramLogic.h.
References RibbonSubGroup::addButton(), createButton(), DesignObject::get(), guid, m_buttons, m_window_manager, BuildActionUIDefinition::ribbon_group, BuildActionUIDefinition::ribbon_sub_group, BuildActionUIDefinition::show_at_bottom_of_tree, BuildActionUIDefinition::show_on_ribbon, and BuildActionDefinition::uiDefinition().
Referenced by setupModel().