An easy interface for adding common SoftwareInterfaces relating to a Model to the program logic.
More...
|
| 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.
|
|
| | 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.
|
| virtual void | addMenuItems (Model &, QTModelManager *, QMenu &, const Buffer< UUID > &, const SelectionInfo &) |
| | Override to add custom context menu items when a model of this type is selected.
|
| virtual bool | canBeHandledBySelectionWidget () const |
| | Returns whether this model type can be handled by the generic selection widget.
|
| ContextMenuCallback * | contextMenuCallback () |
| | Returns the context menu callback for this model logic.
|
| CustomDesignObjectDialogSetupCallback * | dialogSetupCallback () |
| | Returns the dialog setup callback for this model logic.
|
| virtual void | executeMenuItems (Model &, QTModelManager *, QAction *, const Buffer< UUID > &, const SelectionInfo &, PopupInfo) |
| | Override to handle execution of custom context menu actions.
|
| 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 | setTreeWidgetsForSelection (const Model &, Buffer< QWidget * > &, SceneTree *) |
| | Override to provide custom tree widgets shown when the model is selected.
|
| virtual void | setupModel (Model &) |
| | Override to perform setup when a model of this type is read from an NDV file.
|
| virtual void | setupPropertiesDialog (DesignObjectDialog *, const DynamicPointer< QTDesignObject > &) |
| | Override to customize property dialogs when objects of this type are created.
|
| 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.
|
|
|
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.
|
An easy interface for adding common SoftwareInterfaces relating to a Model to the program logic.
Can be used to easily change program behavior for a particular Model.
Definition at line 23 of file CustomModelLogic.h.
◆ CustomModelLogic() [1/2]
◆ CustomModelLogic() [2/2]
Constructs a CustomModelLogic for multiple model type names.
- Parameters
-
| [in] | manager | The model manager providing data context. |
| [in] | type_names | The buffer of type name strings to handle. |
◆ ~CustomModelLogic()
| virtual CustomModelLogic::~CustomModelLogic |
( |
| ) |
|
|
protectedvirtual |
Destructor.
Unregisters all callbacks.
◆ addMenuItems()
Override to add custom context menu items when a model of this type is selected.
- Parameters
-
| [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 in BuildActionProgramLogic.
Definition at line 40 of file CustomModelLogic.h.
◆ canBeHandledBySelectionWidget()
| virtual bool CustomModelLogic::canBeHandledBySelectionWidget |
( |
| ) |
const |
|
inlineprotectedvirtual |
◆ contextMenuCallback()
Returns the context menu callback for this model logic.
- Returns
- The ContextMenuCallback instance.
◆ dialogSetupCallback()
| CustomDesignObjectDialogSetupCallback * CustomModelLogic::dialogSetupCallback |
( |
| ) |
|
|
protected |
Returns the dialog setup callback for this model logic.
- Returns
- The CustomDesignObjectDialogSetupCallback instance.
◆ executeMenuItems()
Override to handle execution of custom context menu actions.
- Parameters
-
| [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 in BuildActionProgramLogic.
Definition at line 50 of file CustomModelLogic.h.
◆ id()
| virtual const UUID & CustomModelLogic::id |
( |
| ) |
const |
|
virtual |
Returns the unique identifier for this custom model logic instance.
- Returns
- The UUID of this logic.
◆ ndvFileReadLogic()
Returns the NDV file read setup callback for this model logic.
- Returns
- The NDVSetupCallback instance.
◆ setSorter()
| void CustomModelLogic::setSorter |
( |
const std::function< bool(const Model &a, const Model &b)> & | sort_function | ) |
|
|
protected |
Sets a custom sorting function for models of this type.
- Parameters
-
| [in] | sort_function | The comparison function returning true if a should precede b. |
◆ setTreeWidgetsForSelection()
| virtual void CustomModelLogic::setTreeWidgetsForSelection |
( |
const Model & | , |
|
|
Buffer< QWidget * > & | , |
|
|
SceneTree * | ) |
|
inlineprotectedvirtual |
Override to provide custom tree widgets shown when the model is selected.
- Parameters
-
| [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 in BuildActionProgramLogic.
Definition at line 68 of file CustomModelLogic.h.
◆ setupModel()
| virtual void CustomModelLogic::setupModel |
( |
Model & | | ) |
|
|
inlineprotectedvirtual |
Override to perform setup when a model of this type is read from an NDV file.
- Parameters
-
| [in] | model | The model being set up (unused parameter name). |
Reimplemented in BuildActionProgramLogic.
Definition at line 61 of file CustomModelLogic.h.
◆ setupPropertiesDialog()
◆ setupUI()
Override to set up custom UI elements for this model type.
- Parameters
-
| [in] | manager | The window manager for creating UI components (unused parameter name). |
Reimplemented in PaperViewModelLogic.
Definition at line 31 of file CustomModelLogic.h.
◆ treeWidgetCallback()
Returns the tree widget callback for this model logic.
- Returns
- The CustomTreeWidgets callback instance.
◆ typeNames()
| const Buffer< String > & CustomModelLogic::typeNames |
( |
| ) |
const |
Returns the type names handled by this custom model logic.
- Returns
- The buffer of type name strings.
The documentation for this class was generated from the following file: