ddt  0.1
Signals | Public Member Functions | Protected Member Functions | List of all members
DdtGraphicsView Class Reference

#include <ddtImageWidget.hpp>

Inheritance diagram for DdtGraphicsView:

Signals

void CursorPosition (double x, double y, bool mouse_clicked)
 
void GraphicalElement (double x1, double y1, double x2, double y2, QString drawMode)
 
void GraphicalTextElement (double x1, double y1, double x2, double y2, QString drawMode, QString text)
 
void StatisticRectangle (double x1, double y1, double x2, double y2)
 
void SlitElement (double target_x, double target_y, double slit_x, double slit_y, double x_offset, double y_offset)
 
void CalculateHistogramReferenceLine (const QPointF p1, const QPointF p2)
 
void MouseDecrementScale ()
 
void MouseIncrementScale ()
 

Public Member Functions

 DdtGraphicsView (QWidget *parent=nullptr)
 
void SetConvertPixelToDegrees (const double convPixelDegrees)
 
void SetDrawMode (const QString mode)
 
void SetDrawSlitLine (const bool drawLine)
 
void SetStatisticRect (const double x1, const double y1, const double x2, const double y2)
 
void AddStatisticRectToScene ()
 
void AddSlitElementToScene ()
 
void AddReferenceLineElementToScene ()
 
void UpdateAllStatistics ()
 

Protected Member Functions

void mouseMoveEvent (QMouseEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
void mouseDoubleClickEvent (QMouseEvent *event)
 
void keyPressEvent (QKeyEvent *event)
 
void wheelEvent (QWheelEvent *event)
 
void drawForeground (QPainter *painter, const QRectF &rect)
 
void AddTextItem ()
 

Detailed Description

Class to serve as graphic view inside the image widget, derived from the QGraphicsView. The mouse events (move, press) are overwritten.

Constructor & Destructor Documentation

◆ DdtGraphicsView()

DdtGraphicsView::DdtGraphicsView ( QWidget *  parent = nullptr)
explicit

Constructor

Parameters
parentPointer to the parent widget

Member Function Documentation

◆ AddReferenceLineElementToScene()

void DdtGraphicsView::AddReferenceLineElementToScene ( )

Re-add the reference line element to the scene for the case it was removed by a refresh procedure

◆ AddSlitElementToScene()

void DdtGraphicsView::AddSlitElementToScene ( )

Re-add the slit element to the scene, for the case it was removed by a refresh procedure

◆ AddStatisticRectToScene()

void DdtGraphicsView::AddStatisticRectToScene ( )

Re-add the statistic rectangle to the scene, for the case it was removed by a refresh procedure

◆ AddTextItem()

void DdtGraphicsView::AddTextItem ( )
protected

Re-add the textItem for text input (necessary in case of a running data stream input)

◆ CalculateHistogramReferenceLine

void DdtGraphicsView::CalculateHistogramReferenceLine ( const QPointF  p1,
const QPointF  p2 
)
signal

Signal send when a reference line was drawn

◆ CursorPosition

void DdtGraphicsView::CursorPosition ( double  x,
double  y,
bool  mouse_clicked 
)
signal

Signal that is emitted to report the cursor position.

Parameters
xmouse x cooridnate
ymouse y coordinate
mouse_clickedflag, if mouse button was clicked

◆ drawForeground()

void DdtGraphicsView::drawForeground ( QPainter *  painter,
const QRectF &  rect 
)
protected

Draw the foreground layer. This is automatically called when the view is updated.

Parameters
painterthe painter to use for drawing
rectthe exposed rectangle

◆ GraphicalElement

void DdtGraphicsView::GraphicalElement ( double  x1,
double  y1,
double  x2,
double  y2,
QString  drawMode 
)
signal

Signal that is emitted to report a graphical element's dimensions and type.

Parameters
x1mouse x coordinate of first position
y1mouse y coordinate of first position
x2mouse x coordinate of first position
y2mouse y coordinate of first position
drawModestring identifying the graphical element

◆ GraphicalTextElement

void DdtGraphicsView::GraphicalTextElement ( double  x1,
double  y1,
double  x2,
double  y2,
QString  drawMode,
QString  text 
)
signal

◆ keyPressEvent()

void DdtGraphicsView::keyPressEvent ( QKeyEvent *  event)
protected

Event handler to receive keyboard events

Parameters
eventKey event

◆ MouseDecrementScale

void DdtGraphicsView::MouseDecrementScale ( )
signal

Signal emitted when zooming in by mouse wheel

◆ mouseDoubleClickEvent()

void DdtGraphicsView::mouseDoubleClickEvent ( QMouseEvent *  event)
protected

Event handler to receive mouse press events.

Parameters
eventthe mouse press event

◆ MouseIncrementScale

void DdtGraphicsView::MouseIncrementScale ( )
signal

Signal emitted when zooming out by mouse wheel

◆ mouseMoveEvent()

void DdtGraphicsView::mouseMoveEvent ( QMouseEvent *  event)
protected

Event handler to receive mouse move events.

Parameters
eventthe mouse move event

◆ mousePressEvent()

void DdtGraphicsView::mousePressEvent ( QMouseEvent *  event)
protected

Event handler to receive mouse press events.

Parameters
eventthe mouse press event

◆ mouseReleaseEvent()

void DdtGraphicsView::mouseReleaseEvent ( QMouseEvent *  event)
protected

Event handler to receive mouse release events.

Parameters
eventthe mouse press event

◆ SetConvertPixelToDegrees()

void DdtGraphicsView::SetConvertPixelToDegrees ( const double  convPixelDegrees)

Set the value for the factor to convert pixel distances to degrees

Parameters
convPixelDegreesthe factor to be used to convert pixel distances to degrees

◆ SetDrawMode()

void DdtGraphicsView::SetDrawMode ( const QString  mode)

Sets the current draw mode for graphical elements

Parameters
thecurrent draw mode

◆ SetDrawSlitLine()

void DdtGraphicsView::SetDrawSlitLine ( const bool  drawLine)

Sets the draw slit line flag

Parameters
flagindicating if the slit line shall be drawn

◆ SetStatisticRect()

void DdtGraphicsView::SetStatisticRect ( const double  x1,
const double  y1,
const double  x2,
const double  y2 
)

Sets the current draw mode for graphical elements

Parameters
x1the x coordinate of top left corner
y1the y coordinate of top left corner
x2the x coordinate of bottom right corner
y2the y coordinate of bottom right corner

◆ SlitElement

void DdtGraphicsView::SlitElement ( double  target_x,
double  target_y,
double  slit_x,
double  slit_y,
double  x_offset,
double  y_offset 
)
signal

◆ StatisticRectangle

void DdtGraphicsView::StatisticRectangle ( double  x1,
double  y1,
double  x2,
double  y2 
)
signal

◆ UpdateAllStatistics()

void DdtGraphicsView::UpdateAllStatistics ( )

Update all statistics

◆ wheelEvent()

void DdtGraphicsView::wheelEvent ( QWheelEvent *  event)
protected

Event handler for mouse wheel events.

Parameters
eventthe scroll wheel event

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