se2ez
se2ez::gui::MainWindow Class Reference

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>

Inheritance diagram for se2ez::gui::MainWindow:
[legend]

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...
 
RenderAreacanvas_
 The canvas widget. More...
 
PanelMapPtr panels_
 Holds the panels. More...
 
bool screen_ {false}
 
bool record_ {false}
 
std::threadcamera_ {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
 

Detailed Description

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.

Member Typedef Documentation

◆ PanelMap

Definition at line 40 of file mainwindow.h.

◆ PanelMapPtr

Constructor & Destructor Documentation

◆ MainWindow()

gui::MainWindow::MainWindow ( QWidget *  parent = nullptr)
explicit

Constructor. Nothing intresting for now.

Definition at line 23 of file mainwindow.cpp.

◆ ~MainWindow()

gui::MainWindow::~MainWindow ( )

Destructor Nothing intresting for now.

Definition at line 78 of file mainwindow.cpp.

Member Function Documentation

◆ addPanel()

void gui::MainWindow::addPanel ( Panel panel)

Adds a panel to the main GUI.

Parameters
[in]panelPointer to the Panel.

Definition at line 95 of file mainwindow.cpp.

◆ click()

void gui::MainWindow::click ( QMouseEvent *  event,
double  x,
double  y,
int  sx,
int  sy 
)

Asks the top panel to click at the location.

Parameters
[in]eventMouse event that was triggered.
[in]xx coordinate in robot space
[in]yy coordinate in robot space
[in]sxx coordinate in screen space
[in]syy coordinate in screen space

Definition at line 143 of file mainwindow.cpp.

◆ draw()

void gui::MainWindow::draw ( QPainter &  painter,
RenderArea canvas 
)

Asks all the panels to draw their respective information.

Parameters
[in]painterQPainter the QObject that paints/draws .
[in]canvasRenderArea the drawing widget

Definition at line 134 of file mainwindow.cpp.

◆ process

void gui::MainWindow::process ( )
privateslot

Definition at line 43 of file mainwindow.cpp.

◆ record

void gui::MainWindow::record ( )
privateslot

Definition at line 161 of file mainwindow.cpp.

◆ resizeEvent()

void gui::MainWindow::resizeEvent ( QResizeEvent *  e)
overrideprotected

Definition at line 89 of file mainwindow.cpp.

◆ screenshot

void gui::MainWindow::screenshot ( )
privateslot

Definition at line 205 of file mainwindow.cpp.

◆ updateOriginX

void gui::MainWindow::updateOriginX ( double  x)
privateslot

Slot called when the origin is updated.

Definition at line 111 of file mainwindow.cpp.

◆ updateOriginY

void gui::MainWindow::updateOriginY ( double  y)
privateslot

Slot called when the origin is updated.

Definition at line 119 of file mainwindow.cpp.

◆ updateScale

void gui::MainWindow::updateScale ( double  scale)
privateslot

Slot called when the scale is updated.

Definition at line 126 of file mainwindow.cpp.

◆ updateState

void gui::MainWindow::updateState ( )
privateslot

calls the update function from canvas to draw the updated state

Definition at line 105 of file mainwindow.cpp.

Friends And Related Function Documentation

◆ RenderArea

friend class RenderArea
friend

Definition at line 37 of file mainwindow.h.

Member Data Documentation

◆ camera_

std::thread* se2ez::gui::MainWindow::camera_ {nullptr}
private

Thread used to record the camera.

Definition at line 107 of file mainwindow.h.

◆ canvas_

RenderArea* se2ez::gui::MainWindow::canvas_
private

The canvas widget.

Definition at line 102 of file mainwindow.h.

◆ didUpdate_

bool se2ez::gui::MainWindow::didUpdate_ {false}
private

Definition at line 113 of file mainwindow.h.

◆ directory_

std::string se2ez::gui::MainWindow::directory_
private

Directory to save screenshots/videos.

Definition at line 108 of file mainwindow.h.

◆ last_

boost::posix_time::ptime se2ez::gui::MainWindow::last_
private

Definition at line 116 of file mainwindow.h.

◆ panels_

PanelMapPtr se2ez::gui::MainWindow::panels_
private

Holds the panels.

Definition at line 103 of file mainwindow.h.

◆ record_

bool se2ez::gui::MainWindow::record_ {false}
private

Definition at line 106 of file mainwindow.h.

◆ screen_

bool se2ez::gui::MainWindow::screen_ {false}
private

Definition at line 105 of file mainwindow.h.

◆ shotnum_

unsigned int se2ez::gui::MainWindow::shotnum_
private

Number of screenshots taken.

Definition at line 110 of file mainwindow.h.

◆ ui_

Ui::MainWindow* se2ez::gui::MainWindow::ui_
private

UI (User Interface) pointer.

Definition at line 101 of file mainwindow.h.

◆ update_

bool se2ez::gui::MainWindow::update_ {true}
private

Definition at line 112 of file mainwindow.h.

◆ updateMutex_

std::mutex se2ez::gui::MainWindow::updateMutex_
private

Definition at line 114 of file mainwindow.h.


The documentation for this class was generated from the following files: