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;
16 {
17 //Override the below to add custom program behavior
18 protected:
19 //Adds menu items to context menus when model of type is selected
20 virtual void addMenuItems(Model&, QTModelManager*, QMenu&, const Buffer<UUID>&, const SelectionInfo&) {}
21 //executes menu items to context menus when model of type is selected
22 virtual void executeMenuItems(Model&, QTModelManager*, QAction*, const Buffer<UUID>&, const SelectionInfo&, PopupInfo) {}
23 //modifies property dialogs when objects are created
25 //performs any needed setup for the model when it is read in via ndv file
26 virtual void setupModel(Model&) {}
27 //custom buttons that appear when selected or selected with the tree
29 protected:
32 NDEVR_API CustomModelLogic(const String& type_name);
35 NDEVR_API std::function<void(Model&)> ndvFileReadLogic();
36 public:
37 NDEVR_API virtual void registerAll(QTModelManager* manager);
38 NDEVR_API virtual UUID id() const;
39 NDEVR_API const String& typeName() const;
40 protected:
44 };
45}
#define NDEVR_API
Definition DLLInfo.h:67
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition ContextMenuManager.h:33
Definition CustomModelLogic.cpp:9
Definition CustomModelLogic.h:16
NDEVR_API const String & typeName() const
Definition CustomModelLogic.cpp:77
virtual void executeMenuItems(Model &, QTModelManager *, QAction *, const Buffer< UUID > &, const SelectionInfo &, PopupInfo)
Definition CustomModelLogic.h:22
NDEVR_API ContextMenuCallback * contextMenuCallback()
Definition CustomModelLogic.cpp:94
ContextMenuCallback * m_custom_context_menu
Definition CustomModelLogic.h:42
virtual NDEVR_API UUID id() const
Definition CustomModelLogic.cpp:81
virtual void addMenuItems(Model &, QTModelManager *, QMenu &, const Buffer< UUID > &, const SelectionInfo &)
Definition CustomModelLogic.h:20
NDEVR_API std::function< void(Model &)> ndvFileReadLogic()
Definition CustomModelLogic.cpp:59
String m_type_name
Definition CustomModelLogic.h:43
virtual void setTreeWidgetsForSelection(const Model &, Buffer< QWidget * > &, SceneTree *)
Definition CustomModelLogic.h:28
CustomTreeWidgets * m_tree_button_menu
Definition CustomModelLogic.h:41
NDEVR_API CustomTreeWidgets * treeWidgetCallback()
Definition CustomModelLogic.cpp:88
virtual void setupPropertiesDialog(DesignObjectDialog *, const DynamicPointer< QTDesignObject > &)
Definition CustomModelLogic.h:24
NDEVR_API CustomModelLogic(const String &type_name)
Definition CustomModelLogic.cpp:85
virtual NDEVR_API void registerAll(QTModelManager *manager)
Definition CustomModelLogic.cpp:67
virtual void setupModel(Model &)
Definition CustomModelLogic.h:26
Definition CustomModelLogic.cpp:40
Definition SceneTreeModelDelegate.h:47
Definition DesignObjectDialog.h:70
Definition Pointer.hpp:303
Definition Model.h:54
Definition QTModelManager.h:94
Definition SceneTree.h:50
Definition Selector.h:46
Definition String.h:40
Definition UUID.h:66
Definition ACIColor.h:37
Definition PopupInfo.h:10