trikRuntime
trikControl::GuiWorker Class Reference

Works in GUI thread and is responsible for all output to display. More...

#include <guiWorker.h>

Inheritance diagram for trikControl::GuiWorker:
Collaboration diagram for trikControl::GuiWorker:

Public Slots

void showImage (const QString &fileName)
 Shows image with given filename on display. More...
 
void show (const QVector< int32_t > &array, int width, int height, const QString &format)
 Shows image from array data according to format. Image is scaled to fill the screen. More...
 
void addLabel (const QString &text, int x, int y)
 Add a label to the specific position of the screen without redrawing it. More...
 
void removeLabels ()
 Remove all labels from the screen and redraws it. More...
 
void hide ()
 Hides image widget. More...
 
void setBackground (const QString &color)
 Sets background for a picture. More...
 
void setPainterWidth (int penWidth)
 Set painter width. More...
 
void setPainterColor (const QString &color)
 Set painter color. More...
 
void clear ()
 Clear everything painted with this object. More...
 
void reset ()
 Returns a display in a blank state. More...
 
void drawPoint (int x, int y)
 Draw point on the widget without redrawing it. More...
 
void drawLine (int x1, int y1, int x2, int y2)
 Draw line on the widget without redrawing it. More...
 
void drawRect (int x, int y, int width, int height, bool filled=false)
 Draw rect on the widget without redrawing it. More...
 
void drawEllipse (int x, int y, int width, int height, bool filled=false)
 Draw ellipse without redrawing the screen. More...
 
void drawArc (int x, int y, int width, int height, int startAngle, int spanAngle)
 Draw arc on the widget without redrawing it. More...
 
void init ()
 Initializes widget. Shall be called when widget is moved to correct thread. Not supposed to be called from .qts. More...
 
void redraw ()
 Updates painted picture on the robot`s screen. More...
 

Public Member Functions

 GuiWorker ()
 
DisplayWidgetInterfacegraphicsWidget ()
 Returns a widget on which everything is drawn. More...
 

Detailed Description

Works in GUI thread and is responsible for all output to display.

Constructor & Destructor Documentation

GuiWorker::GuiWorker ( )

Member Function Documentation

void GuiWorker::addLabel ( const QString &  text,
int  x,
int  y 
)
slot

Add a label to the specific position of the screen without redrawing it.

If there already is a label in these coordinates, its contents will be updated.

Parameters
text- label text.
x- label x coordinate.
y- label y coordinate.
void GuiWorker::clear ( )
slot

Clear everything painted with this object.

void GuiWorker::drawArc ( int  x,
int  y,
int  width,
int  height,
int  startAngle,
int  spanAngle 
)
slot

Draw arc on the widget without redrawing it.

Parameters
x- x coordinate.
y- y coordinate.
width- width rect forming an arc.
height- height rect forming an arc.
startAngle- start angle.
spanAngle- end andle.
void GuiWorker::drawEllipse ( int  x,
int  y,
int  width,
int  height,
bool  filled = false 
)
slot

Draw ellipse without redrawing the screen.

Parameters
x- x coordinate.
y- y coordinate.
width- width of ellipse.
height- height of ellipse.
void GuiWorker::drawLine ( int  x1,
int  y1,
int  x2,
int  y2 
)
slot

Draw line on the widget without redrawing it.

Parameters
x1- first point's x coordinate.
y1- first point's y coordinate.
x2- second point's x coordinate.
y2- second point's y coordinate.
void GuiWorker::drawPoint ( int  x,
int  y 
)
slot

Draw point on the widget without redrawing it.

Parameters
x- x coordinate.
y- y coordinate.
void GuiWorker::drawRect ( int  x,
int  y,
int  width,
int  height,
bool  filled = false 
)
slot

Draw rect on the widget without redrawing it.

Parameters
x- x coordinate.
y- y coordinate.
width- rect's width.
height- rect's height.
DisplayWidgetInterface & GuiWorker::graphicsWidget ( )

Returns a widget on which everything is drawn.

void GuiWorker::hide ( )
slot

Hides image widget.

void GuiWorker::init ( )
slot

Initializes widget. Shall be called when widget is moved to correct thread. Not supposed to be called from .qts.

void GuiWorker::redraw ( )
slot

Updates painted picture on the robot`s screen.

Warning
This operation is pretty slow, so it shouldn`t be called without need.
void GuiWorker::removeLabels ( )
slot

Remove all labels from the screen and redraws it.

void GuiWorker::reset ( )
slot

Returns a display in a blank state.

void GuiWorker::setBackground ( const QString &  color)
slot

Sets background for a picture.

Parameters
color- color of a background.
void GuiWorker::setPainterColor ( const QString &  color)
slot

Set painter color.

void GuiWorker::setPainterWidth ( int  penWidth)
slot

Set painter width.

void GuiWorker::show ( const QVector< int32_t > &  array,
int  width,
int  height,
const QString &  format 
)
slot

Shows image from array data according to format. Image is scaled to fill the screen.

void GuiWorker::showImage ( const QString &  fileName)
slot

Shows image with given filename on display.

Image is scaled to fill the screen and is cached on first read for better performance.


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