ddt 1.2.1
|
#include <ddtOverlayRendering.hpp>
Protected Attributes | |
DdtGraphicalOverlay * | graphics_overlay |
DdtFileBasedOverlay * | file_based_overlay |
QList< DdtGraphicalElement * > | selected_elements |
float | current_scale |
DdtOverlayRendering () | |
virtual | ~DdtOverlayRendering () |
virtual void | RedrawOverlay (QGraphicsScene *scene, const QString timestamp="") |
void | AddGraphicalElement (const DdtGraphicalElementProperties &element_properties, const double x1, const double y1, const double x2, const double y2, const QString draw_mode, const QString text="") |
void | RemoveGraphicalElements (const QString selection) |
bool | SelectGraphicalElements (const double x1, const double y1, const QGraphicsView *const view) |
void | UnselectGraphicalElements () |
void | SetCurrentScale (const float scale) |
void | ChangeElementOverlayProperties (const DdtGraphicalElementProperties &properties) |
const DdtGraphicalElementProperties & | GetLastSelectedElementProperties () |
DdtGraphicalOverlay * | GetGraphicalOverlay () |
QStringList | GetListOfElementIDs () const |
void | SetEditable (const bool editable) |
bool | LoadOverlayFile (const QString overlay_file, const std::string image_widget_name, QString &error_msg) |
void | HideStaticOverlay () const |
void | ShowStaticOverlay () const |
void | ShowOverlayByObject (const QString object_name) const |
void | HideOverlayByObject (const QString object_name) const |
void | ShowOverlayByElement (const QString element_name) const |
void | HideOverlayByElement (const QString element_name) const |
void | SetTransformation (QTransform const &transform) |
Class for the rendering of graphical overlays
|
explicit |
Constructor
|
virtual |
Destructor
void DdtOverlayRendering::AddGraphicalElement | ( | const DdtGraphicalElementProperties & | element_properties, |
const double | x1, | ||
const double | y1, | ||
const double | x2, | ||
const double | y2, | ||
const QString | draw_mode, | ||
const QString | text = "" ) |
Add a graphical element to the overlay.
element_properties | the graphical element properties |
x1 | mouse x coordinate of first position |
y1 | mouse y coordinate of first position |
x2 | mouse x coordinate of second position |
y2 | mouse y coordinate of second position |
draw_mode | string identifying the graphical element |
text | text of the graphical element text |
void DdtOverlayRendering::ChangeElementOverlayProperties | ( | const DdtGraphicalElementProperties & | properties | ) |
Change overlay properties on respective selected elements
properties | Graphical Element properties |
DdtGraphicalOverlay * DdtOverlayRendering::GetGraphicalOverlay | ( | ) |
Access to the graphical overlay
const DdtGraphicalElementProperties & DdtOverlayRendering::GetLastSelectedElementProperties | ( | ) |
Get a map with all the last element properties with respective DialogIDs
QStringList DdtOverlayRendering::GetListOfElementIDs | ( | ) | const |
Get a list of element IDs.
void DdtOverlayRendering::HideOverlayByElement | ( | const QString | element_name | ) | const |
Hides an element of the overlay specified by its name
element_name | Element name to hide |
void DdtOverlayRendering::HideOverlayByObject | ( | const QString | object_name | ) | const |
Hides a specified object of the overlay
object_name | Name of the overlay object to hide |
void DdtOverlayRendering::HideStaticOverlay | ( | ) | const |
Hide the static overlay elements
bool DdtOverlayRendering::LoadOverlayFile | ( | const QString | overlay_file, |
const std::string | image_widget_name, | ||
QString & | error_msg ) |
Loads the json overlay file which contains graphics to be drawn at startup
overlay_file | The overlay file to load |
image_widget_name | The name of the image widget |
error_msg | The error message |
|
virtual |
Function that draw all overlay elements into the scene of the view
void DdtOverlayRendering::RemoveGraphicalElements | ( | const QString | selection | ) |
Removes overlays of given type (selection)
selection | The type of overlay to delete |
bool DdtOverlayRendering::SelectGraphicalElements | ( | const double | x1, |
const double | y1, | ||
const QGraphicsView *const | view ) |
Selects a graphical element at the current coordinates
x1 | First x coordinate |
y1 | First y coordinate |
view | Active graphics view |
Check if a text item is placed at the selected position. As text items are handled differently (in order to have the text always readable (without rotation)), the bounding rectangle is not identical to the drawn text rectangle in case of rotation or zooming
void DdtOverlayRendering::SetCurrentScale | ( | const float | scale | ) |
Set the current scale factor of the view
scale | The current scale |
void DdtOverlayRendering::SetEditable | ( | const bool | editable | ) |
Loops through all graphical elements and enables / disables resizing and moving.
void DdtOverlayRendering::SetTransformation | ( | QTransform const & | transform | ) |
Makes the views current transformation available to text elements
transform | The view's current transformation |
void DdtOverlayRendering::ShowOverlayByElement | ( | const QString | element_name | ) | const |
Shows an element of the overlay specified by its name
element_name | Element name to show |
void DdtOverlayRendering::ShowOverlayByObject | ( | const QString | object_name | ) | const |
Shows a specified object of the overlay
object_name | Name of the overlay object to show |
void DdtOverlayRendering::ShowStaticOverlay | ( | ) | const |
Show the static overlay elements
void DdtOverlayRendering::UnselectGraphicalElements | ( | ) |
Unselects all items. The select item button can be toggled in order to leave the selecting mode. If so, UnselectGraphicalElements() is called to unselect a selected item.
|
protected |
The current scale factor.
|
protected |
The DDT graphical overlay object.
|
protected |
The DDT graphical overlay object.
|
protected |
A QList containing all selected elements.