API Documentation
Loading...
Searching...
No Matches
CustomModelLogic.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/ContextMenuManager.h>
4#include <NDEVR/QTModelManager.h>
5#include <NDEVR/DesignObjectDialog.h>
6#include <NDEVR/Pointer.h>
7#include <NDEVR/UUID.h>
8#include <NDEVR/String.h>
9#include <QMenu>
10#include <QAction>
11namespace NDEVR
12{
13 class CustomTreeWidgets;
14 class SceneTree;
15 /**--------------------------------------------------------------------------------------------------
16 \brief An easy interface for adding common SoftwareInterfaces relating to a Model to the program
17 logic. Can be used to easily change program behavior for a particular Model.
18 **/
20 {
21 //Override the below to add custom program behavior
22 protected:
23 //Adds menu items to context menus when model of type is selected
24 virtual void addMenuItems(Model&, QTModelManager*, QMenu&, const Buffer<UUID>&, const SelectionInfo&) {}
25 //executes menu items to context menus when model of type is selected
26 virtual void executeMenuItems(Model&, QTModelManager*, QAction*, const Buffer<UUID>&, const SelectionInfo&, PopupInfo) {}
27 //modifies property dialogs when objects are created
29 //performs any needed setup for the model when it is read in via ndv file
30 virtual void setupModel(Model&) {}
31 //custom buttons that appear when selected or selected with the tree
33 protected:
39 NDEVR_API std::function<void(Model&)> ndvFileReadLogic();
40 public:
41 NDEVR_API virtual void registerAll(QTModelManager* manager);
42 NDEVR_API virtual UUID id() const;
43 NDEVR_API const String& typeName() const;
44 protected:
48 };
49}
#define NDEVR_API
Definition DLLInfo.h:50
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Allows for customization of what is shown when the user right-clicks or accesses the ContextMenu for ...
Definition ContextMenuManager.h:41
An easy interface for adding common SoftwareInterfaces relating to a Model to the program logic....
Definition CustomModelLogic.h:20
const String & typeName() const
virtual void executeMenuItems(Model &, QTModelManager *, QAction *, const Buffer< UUID > &, const SelectionInfo &, PopupInfo)
Definition CustomModelLogic.h:26
ContextMenuCallback * contextMenuCallback()
friend class CustomModelTreeWidgets
Definition CustomModelLogic.h:35
ContextMenuCallback * m_custom_context_menu
Definition CustomModelLogic.h:46
friend class CustomModelContextMenu
Definition CustomModelLogic.h:34
virtual void addMenuItems(Model &, QTModelManager *, QMenu &, const Buffer< UUID > &, const SelectionInfo &)
Definition CustomModelLogic.h:24
std::function< void(Model &)> ndvFileReadLogic()
String m_type_name
Definition CustomModelLogic.h:47
virtual void setTreeWidgetsForSelection(const Model &, Buffer< QWidget * > &, SceneTree *)
Definition CustomModelLogic.h:32
CustomTreeWidgets * m_tree_button_menu
Definition CustomModelLogic.h:45
CustomTreeWidgets * treeWidgetCallback()
virtual UUID id() const
virtual void setupPropertiesDialog(DesignObjectDialog *, const DynamicPointer< QTDesignObject > &)
Definition CustomModelLogic.h:28
CustomModelLogic(const String &type_name)
virtual void registerAll(QTModelManager *manager)
virtual void setupModel(Model &)
Definition CustomModelLogic.h:30
Allows for modification or addition of the widgets shown when an object is selected by the user in th...
Definition SceneTreeModelDelegate.h:51
A popup dialog for showing options or information to the user for a particular DesignObject....
Definition DesignObjectDialog.h:75
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
Definition SceneTree.h:50
Responsible for turning a user interaction into a selection within a DesignObjectLookup.
Definition Selector.h:50
The core String class for the NDEVR API.
Definition String.h:69
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
Definition ACIColor.h:37
Class which is used to pass arguments and requests for creating a popup dialog or widget....
Definition PopupInfo.h:15