summaryrefslogtreecommitdiff
path: root/CIAO/examples/Display/NavDisplayGUI_exec/RootPanel.h
blob: a7ef945b1c39d038aa9c9ee72cb25a9ca73e78e2 (plain)
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
#ifndef __ROOTPANEL_H
#define __ROOTPANEL_H

#define QT_GENUINE_STR

#include "ace/Hash_Map_Manager.h"
#include "ace/Null_Mutex.h"
#include "MapView.h"
#include "DetailView.h"
#include <QtGui/qmainwindow.h>
#include <QtGui/qevent.h>
#include <QtGui/qgraphicsscene.h>

#include "Command.h"

class NodeItem;
class QMouseEvent;

class NavEvent : public QEvent
{
public:
  NavEvent(CommandBase* cmd);
  virtual ~NavEvent ();

  CommandBase* cmd () const;

  static void set_type (int type);

  static QEvent::Type get_type ();

private:
  CommandBase* cmd_;

  static int registered_type_;
};

class RootPanel : public QMainWindow
{
  Q_OBJECT

typedef ACE_Hash_Map_Manager_Ex<ACE_UINT64,
                                NodeItem*,
                                ACE_Hash<ACE_UINT64>,
                                ACE_Equal_To<ACE_UINT64>,
                                ACE_Null_Mutex> NodeItemMap;

public:
  RootPanel(QGraphicsScene&, QWidget *parent = 0);
  ~RootPanel();

public:
  void addUnit(NavUnit* unit);
  void updateUnit(NavUnit *unit);

protected:
  void clear();
  virtual void customEvent(QEvent *e);

  QGraphicsScene& canvas;
  MapView *navview;
  DetailView *details;
  NodeItemMap nodeMap;
};

#endif // __ROOTPANEL_H