ddt 1.2.1
Loading...
Searching...
No Matches
Protected Attributes | List of all members
DdtOverlayRendering Class Reference

#include <ddtOverlayRendering.hpp>

Protected Attributes

DdtGraphicalOverlaygraphics_overlay
 
DdtFileBasedOverlayfile_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 DdtGraphicalElementPropertiesGetLastSelectedElementProperties ()
 
DdtGraphicalOverlayGetGraphicalOverlay ()
 
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)
 

Detailed Description

Class for the rendering of graphical overlays

Constructor & Destructor Documentation

◆ DdtOverlayRendering()

DdtOverlayRendering::DdtOverlayRendering ( )
explicit

Constructor

◆ ~DdtOverlayRendering()

DdtOverlayRendering::~DdtOverlayRendering ( )
virtual

Destructor

Member Function Documentation

◆ AddGraphicalElement()

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.

Parameters
element_propertiesthe graphical element properties
x1mouse x coordinate of first position
y1mouse y coordinate of first position
x2mouse x coordinate of second position
y2mouse y coordinate of second position
draw_modestring identifying the graphical element
texttext of the graphical element text

◆ ChangeElementOverlayProperties()

void DdtOverlayRendering::ChangeElementOverlayProperties ( const DdtGraphicalElementProperties & properties)

Change overlay properties on respective selected elements

Parameters
propertiesGraphical Element properties

◆ GetGraphicalOverlay()

DdtGraphicalOverlay * DdtOverlayRendering::GetGraphicalOverlay ( )

Access to the graphical overlay

Returns
Pointer to used graphical overlay

◆ GetLastSelectedElementProperties()

const DdtGraphicalElementProperties & DdtOverlayRendering::GetLastSelectedElementProperties ( )

Get a map with all the last element properties with respective DialogIDs

Returns
properties Last Selected Graphical Element properties

◆ GetListOfElementIDs()

QStringList DdtOverlayRendering::GetListOfElementIDs ( ) const

Get a list of element IDs.

Returns
A QStringList containing all element IDs.

◆ HideOverlayByElement()

void DdtOverlayRendering::HideOverlayByElement ( const QString element_name) const

Hides an element of the overlay specified by its name

Parameters
element_nameElement name to hide

◆ HideOverlayByObject()

void DdtOverlayRendering::HideOverlayByObject ( const QString object_name) const

Hides a specified object of the overlay

Parameters
object_nameName of the overlay object to hide

◆ HideStaticOverlay()

void DdtOverlayRendering::HideStaticOverlay ( ) const

Hide the static overlay elements

◆ LoadOverlayFile()

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

Parameters
overlay_fileThe overlay file to load
image_widget_nameThe name of the image widget
error_msgThe error message
Returns
true if loading was successful, false otherwise

◆ RedrawOverlay()

void DdtOverlayRendering::RedrawOverlay ( QGraphicsScene * scene,
const QString timestamp = "" )
virtual

Function that draw all overlay elements into the scene of the view

◆ RemoveGraphicalElements()

void DdtOverlayRendering::RemoveGraphicalElements ( const QString selection)

Removes overlays of given type (selection)

Parameters
selectionThe type of overlay to delete

◆ SelectGraphicalElements()

bool DdtOverlayRendering::SelectGraphicalElements ( const double x1,
const double y1,
const QGraphicsView *const view )

Selects a graphical element at the current coordinates

Parameters
x1First x coordinate
y1First y coordinate
viewActive graphics view
Returns
result Indicate if any graphical element was selected

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

◆ SetCurrentScale()

void DdtOverlayRendering::SetCurrentScale ( const float scale)

Set the current scale factor of the view

Parameters
scaleThe current scale

◆ SetEditable()

void DdtOverlayRendering::SetEditable ( const bool editable)

Loops through all graphical elements and enables / disables resizing and moving.

◆ SetTransformation()

void DdtOverlayRendering::SetTransformation ( QTransform const & transform)

Makes the views current transformation available to text elements

Parameters
transformThe view's current transformation

◆ ShowOverlayByElement()

void DdtOverlayRendering::ShowOverlayByElement ( const QString element_name) const

Shows an element of the overlay specified by its name

Parameters
element_nameElement name to show

◆ ShowOverlayByObject()

void DdtOverlayRendering::ShowOverlayByObject ( const QString object_name) const

Shows a specified object of the overlay

Parameters
object_nameName of the overlay object to show

◆ ShowStaticOverlay()

void DdtOverlayRendering::ShowStaticOverlay ( ) const

Show the static overlay elements

◆ UnselectGraphicalElements()

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.

Member Data Documentation

◆ current_scale

float DdtOverlayRendering::current_scale
protected

The current scale factor.

◆ file_based_overlay

DdtFileBasedOverlay* DdtOverlayRendering::file_based_overlay
protected

The DDT graphical overlay object.

◆ graphics_overlay

DdtGraphicalOverlay* DdtOverlayRendering::graphics_overlay
protected

The DDT graphical overlay object.

◆ selected_elements

QList<DdtGraphicalElement*> DdtOverlayRendering::selected_elements
protected

A QList containing all selected elements.


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