se2ez
panel.h
Go to the documentation of this file.
1 /* Author: Constantinos Chamzas */
2 
3 #ifndef PANEL_H
4 #define PANEL_H
5 
6 #include <QPainter>
7 #include <QWidget>
8 
9 #include <boost/date_time.hpp>
10 
11 #include <se2ez/gui/mainwindow.h>
12 #include <se2ez/gui/renderarea.h>
13 
14 namespace se2ez
15 {
16  namespace gui
17  {
18  class Panel : public QWidget
19  {
20  public:
21  // non-copyable
22  Panel(const Panel &) = delete;
23  Panel &operator=(const Panel &) = delete;
24 
25  /** \brief Constructor */
26  Panel(std::string panel_name, QWidget *parent = 0)
27  : QWidget(parent), name(QString(panel_name.c_str())){};
28 
29  /** \brief Destructor */
30  virtual ~Panel() = default;
31 
32  virtual void draw(QPainter &painter, RenderArea *canvas) = 0;
33  virtual bool click(QMouseEvent * /*event*/, double /*x*/, double /*y*/, int /*sx*/, int /*sy*/)
34  {
35  return false;
36  }
37 
38  virtual void update(boost::posix_time::ptime last, boost::posix_time::ptime current) = 0;
39 
41  {
42  panels = p;
43  }
44 
45  QString name;
48  };
49  } // namespace gui
50 } // namespace se2ez
51 
52 #endif // PANEL_H
virtual void update(boost::posix_time::ptime last, boost::posix_time::ptime current)=0
virtual void draw(QPainter &painter, RenderArea *canvas)=0
std::recursive_mutex mutex_
Definition: panel.h:47
Panel & operator=(const Panel &)=delete
Panel(const Panel &)=delete
virtual ~Panel()=default
Destructor.
Panel(std::string panel_name, QWidget *parent=0)
Constructor.
Definition: panel.h:26
QString name
Definition: panel.h:45
MainWindow::PanelMapPtr panels
Definition: panel.h:46
The canvas widget. It contains all the drawing functions as well as all the general settings for draw...
Definition: renderarea.h:48
Main namespace.
Definition: collision.h:11
virtual bool click(QMouseEvent *, double, double, int, int)
Definition: panel.h:33
virtual void initialize(MainWindow::PanelMapPtr p)
Definition: panel.h:40