|
se2ez
|
The main widget that acts a container for other widgets (canvas, panels). It also delegates the drawing functions between the panels and the canvas. More...
#include <mainwindow.h>
Public Types | |
| using | PanelMap = std::map< std::string, Panel * > |
| using | PanelMapPtr = std::shared_ptr< PanelMap > |
Public Member Functions | |
Constructors | |
| MainWindow (QWidget *parent=nullptr) | |
| Constructor. Nothing intresting for now. More... | |
| ~MainWindow () | |
| Destructor Nothing intresting for now. More... | |
Panels | |
| void | draw (QPainter &painter, RenderArea *canvas) |
| Asks all the panels to draw their respective information. More... | |
| void | click (QMouseEvent *event, double x, double y, int sx, int sy) |
| Asks the top panel to click at the location. More... | |
| void | addPanel (Panel *panel) |
| Adds a panel to the main GUI. More... | |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *e) override |
Private Slots | |
| void | updateState () |
| calls the update function from canvas to draw the updated state More... | |
| void | updateOriginX (double x) |
| Slot called when the origin is updated. More... | |
| void | updateOriginY (double y) |
| Slot called when the origin is updated. More... | |
| void | updateScale (double scale) |
| Slot called when the scale is updated. More... | |
| void | record () |
| void | screenshot () |
| void | process () |
Private Attributes | |
| Ui::MainWindow * | ui_ |
| UI (User Interface) pointer. More... | |
| RenderArea * | canvas_ |
| The canvas widget. More... | |
| PanelMapPtr | panels_ |
| Holds the panels. More... | |
| bool | screen_ {false} |
| bool | record_ {false} |
| std::thread * | camera_ {nullptr} |
| Thread used to record the camera. More... | |
| std::string | directory_ |
| Directory to save screenshots/videos. More... | |
| unsigned int | shotnum_ |
| Number of screenshots taken. More... | |
| bool | update_ {true} |
| bool | didUpdate_ {false} |
| std::mutex | updateMutex_ |
| boost::posix_time::ptime | last_ |
Friends | |
| class | RenderArea |
The main widget that acts a container for other widgets (canvas, panels). It also delegates the drawing functions between the panels and the canvas.
Definition at line 34 of file mainwindow.h.
| using se2ez::gui::MainWindow::PanelMap = std::map<std::string, Panel *> |
Definition at line 40 of file mainwindow.h.
Definition at line 41 of file mainwindow.h.
|
explicit |
Constructor. Nothing intresting for now.
Definition at line 23 of file mainwindow.cpp.
| gui::MainWindow::~MainWindow | ( | ) |
Destructor Nothing intresting for now.
Definition at line 78 of file mainwindow.cpp.
| void gui::MainWindow::addPanel | ( | Panel * | panel | ) |
Adds a panel to the main GUI.
| [in] | panel | Pointer to the Panel. |
Definition at line 95 of file mainwindow.cpp.
| void gui::MainWindow::click | ( | QMouseEvent * | event, |
| double | x, | ||
| double | y, | ||
| int | sx, | ||
| int | sy | ||
| ) |
Asks the top panel to click at the location.
| [in] | event | Mouse event that was triggered. |
| [in] | x | x coordinate in robot space |
| [in] | y | y coordinate in robot space |
| [in] | sx | x coordinate in screen space |
| [in] | sy | y coordinate in screen space |
Definition at line 143 of file mainwindow.cpp.
| void gui::MainWindow::draw | ( | QPainter & | painter, |
| RenderArea * | canvas | ||
| ) |
Asks all the panels to draw their respective information.
| [in] | painter | QPainter the QObject that paints/draws . |
| [in] | canvas | RenderArea the drawing widget |
Definition at line 134 of file mainwindow.cpp.
|
privateslot |
Definition at line 43 of file mainwindow.cpp.
|
privateslot |
Definition at line 161 of file mainwindow.cpp.
|
overrideprotected |
Definition at line 89 of file mainwindow.cpp.
|
privateslot |
Definition at line 205 of file mainwindow.cpp.
|
privateslot |
Slot called when the origin is updated.
Definition at line 111 of file mainwindow.cpp.
|
privateslot |
Slot called when the origin is updated.
Definition at line 119 of file mainwindow.cpp.
|
privateslot |
Slot called when the scale is updated.
Definition at line 126 of file mainwindow.cpp.
|
privateslot |
calls the update function from canvas to draw the updated state
Definition at line 105 of file mainwindow.cpp.
|
friend |
Definition at line 37 of file mainwindow.h.
|
private |
Thread used to record the camera.
Definition at line 107 of file mainwindow.h.
|
private |
The canvas widget.
Definition at line 102 of file mainwindow.h.
|
private |
Definition at line 113 of file mainwindow.h.
|
private |
Directory to save screenshots/videos.
Definition at line 108 of file mainwindow.h.
|
private |
Definition at line 116 of file mainwindow.h.
|
private |
Holds the panels.
Definition at line 103 of file mainwindow.h.
|
private |
Definition at line 106 of file mainwindow.h.
|
private |
Definition at line 105 of file mainwindow.h.
|
private |
Number of screenshots taken.
Definition at line 110 of file mainwindow.h.
|
private |
UI (User Interface) pointer.
Definition at line 101 of file mainwindow.h.
|
private |
Definition at line 112 of file mainwindow.h.
|
private |
Definition at line 114 of file mainwindow.h.