API Documentation
Loading...
Searching...
No Matches
ContextMenuManager.h
Go to the documentation of this file.
1
#pragma once
2
#include <NDEVR/PopupInfo.h>
3
#include <NDEVR/SelectionInfo.h>
4
#include <QMenu>
5
namespace
NDEVR
6
{
7
enum class
ContextMenuActions
8
{
9
e_show_properties
10
,
e_make_visible
11
,
e_hide_everything_except
12
,
e_make_invisible
13
,
e_solid_material
14
,
e_outline_material
15
,
e_mesh
16
,
e_save
17
,
e_explode
18
,
e_group
19
,
e_import_from_library
20
,
e_delete_from_library
21
,
e_add_station
22
,
e_delete_object
23
,
e_station_text_visible
24
,
e_station_lines_visible
25
,
e_station_axis_visible
26
,
e_deploy_to_station
27
,
e_deploy_to_borehole
28
,
e_add_deployment
29
,
e_none
30
};
31
class
QTModelManager;
32
class
ContextMenuCallback
33
{
34
public
:
35
virtual
void
addContextMenuItems
(
QTModelManager
* manager, QMenu& menu,
const
Buffer<UUID>
& ids,
const
SelectionInfo
& cursor_location) = 0;
36
virtual
void
contextMenu
(
QTModelManager
* manager, QAction* action,
const
Buffer<UUID>
& ids,
const
SelectionInfo
& cursor_location,
PopupInfo
origin) = 0;
37
};
38
class
ContextMenuManager
39
{
40
public
:
41
ContextMenuManager
(
QTModelManager
* manager);
42
virtual
void
addContextMenuItems
(QMenu& menu,
const
Buffer<UUID>
& ids =
Buffer<UUID>
(),
const
SelectionInfo
& selection_info =
SelectionInfo
());
43
virtual
void
contextMenu
(QAction* action,
const
Buffer<UUID>
& ids,
const
SelectionInfo
& selection_info =
SelectionInfo
(),
PopupInfo
origin =
PopupInfo
());
44
virtual
void
addContextMenuCallback
(
const
UUID
&
id
,
ContextMenuCallback
* callback);
45
virtual
void
removeContextMenuCallback
(
const
UUID
&
id
);
46
virtual
bool
hasContextMenuCallback
(
const
UUID
&
id
)
const
;
47
virtual
ContextMenuActions
actionType
(QAction* action);
48
protected
:
49
Dictionary<UUID, ContextMenuCallback*>
m_custom_context_callbacks
;
50
QTModelManager
*
m_manager
;
51
};
52
}
NDEVR::Buffer
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition
Buffer.hpp:59
NDEVR::ContextMenuCallback
Definition
ContextMenuManager.h:33
NDEVR::ContextMenuCallback::contextMenu
virtual void contextMenu(QTModelManager *manager, QAction *action, const Buffer< UUID > &ids, const SelectionInfo &cursor_location, PopupInfo origin)=0
NDEVR::ContextMenuCallback::addContextMenuItems
virtual void addContextMenuItems(QTModelManager *manager, QMenu &menu, const Buffer< UUID > &ids, const SelectionInfo &cursor_location)=0
NDEVR::ContextMenuManager
Definition
ContextMenuManager.h:39
NDEVR::ContextMenuManager::addContextMenuCallback
virtual void addContextMenuCallback(const UUID &id, ContextMenuCallback *callback)
NDEVR::ContextMenuManager::addContextMenuItems
virtual void addContextMenuItems(QMenu &menu, const Buffer< UUID > &ids=Buffer< UUID >(), const SelectionInfo &selection_info=SelectionInfo())
NDEVR::ContextMenuManager::m_custom_context_callbacks
Dictionary< UUID, ContextMenuCallback * > m_custom_context_callbacks
Definition
ContextMenuManager.h:49
NDEVR::ContextMenuManager::hasContextMenuCallback
virtual bool hasContextMenuCallback(const UUID &id) const
NDEVR::ContextMenuManager::removeContextMenuCallback
virtual void removeContextMenuCallback(const UUID &id)
NDEVR::ContextMenuManager::contextMenu
virtual void contextMenu(QAction *action, const Buffer< UUID > &ids, const SelectionInfo &selection_info=SelectionInfo(), PopupInfo origin=PopupInfo())
NDEVR::ContextMenuManager::actionType
virtual ContextMenuActions actionType(QAction *action)
NDEVR::ContextMenuManager::ContextMenuManager
ContextMenuManager(QTModelManager *manager)
NDEVR::ContextMenuManager::m_manager
QTModelManager * m_manager
Definition
ContextMenuManager.h:50
NDEVR::Dictionary
A hash-based key-value store, useful for quick associative lookups.
Definition
Dictionary.h:59
NDEVR::QTModelManager
Definition
QTModelManager.h:94
NDEVR::SelectionInfo
Responsible for turning a user interaction into a selection within a DesignObjectLookup.
Definition
Selector.h:50
NDEVR::UUID
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition
UUID.h:62
NDEVR
Definition
ACIColor.h:37
NDEVR::ContextMenuActions
ContextMenuActions
Definition
ContextMenuManager.h:8
NDEVR::ContextMenuActions::e_group
@ e_group
NDEVR::ContextMenuActions::e_make_visible
@ e_make_visible
NDEVR::ContextMenuActions::e_save
@ e_save
NDEVR::ContextMenuActions::e_make_invisible
@ e_make_invisible
NDEVR::ContextMenuActions::e_none
@ e_none
NDEVR::ContextMenuActions::e_explode
@ e_explode
NDEVR::ContextMenuActions::e_hide_everything_except
@ e_hide_everything_except
NDEVR::ContextMenuActions::e_delete_object
@ e_delete_object
NDEVR::ContextMenuActions::e_deploy_to_borehole
@ e_deploy_to_borehole
NDEVR::ContextMenuActions::e_delete_from_library
@ e_delete_from_library
NDEVR::ContextMenuActions::e_outline_material
@ e_outline_material
NDEVR::ContextMenuActions::e_station_lines_visible
@ e_station_lines_visible
NDEVR::ContextMenuActions::e_show_properties
@ e_show_properties
NDEVR::ContextMenuActions::e_deploy_to_station
@ e_deploy_to_station
NDEVR::ContextMenuActions::e_station_axis_visible
@ e_station_axis_visible
NDEVR::ContextMenuActions::e_import_from_library
@ e_import_from_library
NDEVR::ContextMenuActions::e_station_text_visible
@ e_station_text_visible
NDEVR::ContextMenuActions::e_mesh
@ e_mesh
NDEVR::ContextMenuActions::e_add_deployment
@ e_add_deployment
NDEVR::ContextMenuActions::e_solid_material
@ e_solid_material
NDEVR::TooltipType::e_add_station
@ e_add_station
NDEVR::PopupInfo
Definition
PopupInfo.h:10
NDEVR
Headers
ContextMenuManager.h