forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewer.h
121 lines (94 loc) · 3.25 KB
/
Viewer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
*
*
* Distributed under the OpenDDS License.
* See: http://www.opendds.org/license.html
*/
#ifndef VIEWER_H
#define VIEWER_H
#include "GvOptions.h"
#include "NodeOptions.h"
// Tell GCC to ignore implicitly declared copy methods as long as
// Qt is not compliant.
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include "ui_Monitor.h"
#include <QtWidgets/QScrollArea>
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
// context menu items
#define EXPAND_ACTION "Expand All"
#define COLLAPSE_ACTION "Collapse All"
#define SELECTION_TO_NODE_VIEW "Selection to Node View"
#define SELECTION_TO_GRAPH_VIEW "Selection to Graph View"
#define NODE_VIEW_UPDATE_ACTION "Update Node View"
#define NODE_VIEW_OPTIONS_ACTION "Show Node Options"
#define NODE_VIEW_TO_FILE "Save Node View to File"
#define NODE_EXPAND "Expand Node"
#define NODE_COLLAPSE "Collapse Node"
#define NODE_DELETE "Delete Node"
#define NODE_CONNECT "Connect"
#define NODE_DISCONNECT "Disconnect"
#define NODE_RESTORE_CONNECTIONS "Restore Connections"
#define GRAPH_UPDATE_ACTION "Update Graph View"
#define GRAPH_OPTIONS_ACTION "Show Graph Options"
#define GRAPH_VIEW_TO_FILE "Save Graph View to File"
namespace Monitor {
class Options;
class MonitorData;
class MonitorDataModel;
class Viewer : public QMainWindow {
Q_OBJECT
public:
Viewer( const Options& options, QMainWindow* parent = 0);
private slots:
/// Translate index to column to signal the view to resize the column.
void itemExpanded( const QModelIndex& item);
/// Data has changed. Moved from MonitorDataModel to avoid calling
/// outside of GUI thread. This fixes the "QPixmap: It is not safe to
/// use pixmaps outside the GUI thread" warnings.
void resizeColumnsOnDataChange(const QModelIndex & start,
const QModelIndex & end);
void addRepo();
void removeRepo();
void scaleImage();
void newRepo( const QString& ior);
void doSort( int index);
// context menu slots
void treeContextMenu(const QPoint&);
void nodeContextMenu(const QPoint&);
void graphContextMenu(const QPoint&);
// methods called from context menus
void showGraphOptions();
void updateGraphView(bool honorDisplayFlag = false);
void showNodeOptions();
void updateNodeView(bool honorDisplayFlag = false);
void expand(bool flag = false);
void saveImage(const QPixmap *p);
protected:
/// Close action.
void closeEvent( QCloseEvent* event = 0);
private:
Ui::Monitor ui;
const Options& options_;
MonitorData* dataSource_;
MonitorDataModel* model_;
GvOptionsData gvOpt; // the authority for gvoptions ie the gvdialog may
// not have the correct options if it's hidden.
NodeOptionsData nodeOpt;
// these items are not created with the designer tool
// they belong to the viewer not the ui.
QLabel* graphView;
QImage* image;
// rt-click context menu popups for tree, node and graph view options
QMenu treeMenu;
QMenu nodeViewMenu; // node view options
QMenu nodeMenu; // individual node options
QMenu graphMenu;
QGraphicsScene *nodeScene;
};
} // End of namespace Monitor
#endif /* VIEWER_H */