ddt 1.2.1
Loading...
Searching...
No Matches
Signals | List of all members
DdtGraphicsView Class Reference

#include <ddtGraphicsView.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 draw_mode)
 
void GraphicalTextElement (double x1, double y1, double x2, double y2, QString draw_mode, 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 CalculateDistanceLine (const QPointF p1, const QPointF p2)
 
void MouseDecrementScale ()
 
void MouseIncrementScale ()
 
void LayerIncrement (const int inc)
 
void LayerDecrement (const int dec)
 
 DdtGraphicsView (QWidget *parent=nullptr)
 
 ~DdtGraphicsView () override
 
void SetConvertPixelToDegrees (const double conv_pixel_degrees)
 
void SetDrawMode (const QString mode)
 
QString GetDrawMode () const
 
void SetDrawSlitLine (const bool draw_line)
 
void SetStatisticRect (const double x1, const double y1, const double x2, const double y2)
 
void SetOverlayImageFile (const QString filename)
 
void AddStatisticRectToScene ()
 
void AddSlitElementToScene ()
 
void AddReferenceLineElementToScene ()
 
void AddDistanceLineElementToScene ()
 
void UpdateAllStatistics ()
 
void UpdateCursorInfo ()
 
void ClearTextItemFocus ()
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
void wheelEvent (QWheelEvent *event) override
 
void drawForeground (QPainter *painter, const QRectF &rect) override
 
bool IsHandleGraphicalElement () const
 
void AddTextItem ()
 
void ReferenceLineHandleHoldingShift ()
 

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

◆ ~DdtGraphicsView()

DdtGraphicsView::~DdtGraphicsView ( )
overridedefault

Destructor

Member Function Documentation

◆ AddDistanceLineElementToScene()

void DdtGraphicsView::AddDistanceLineElementToScene ( )

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

◆ 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)

◆ CalculateDistanceLine

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

Signals send when a distance line was drawn

◆ CalculateHistogramReferenceLine

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

Signals send when a reference line was drawn

◆ ClearTextItemFocus

void DdtGraphicsView::ClearTextItemFocus ( )
slot

Slot which is called when the Graphical Element dialog is closed. It clears the focus of a text item if present.

◆ CursorPosition

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

Signal that is emitted to report the cursor position.

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

◆ drawForeground()

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

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

Parameters
painterthe painter to use for drawing
rectthe exposed rectangle

◆ GetDrawMode()

QString DdtGraphicsView::GetDrawMode ( ) const

Returns the current draw mode for graphical elements

Returns
the current draw mode

◆ GraphicalElement

void DdtGraphicsView::GraphicalElement ( double x1,
double y1,
double x2,
double y2,
QString draw_mode )
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 second position
y2mouse y coordinate of second position
draw_modestring identifying the graphical element

◆ GraphicalTextElement

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

◆ IsHandleGraphicalElement()

bool DdtGraphicsView::IsHandleGraphicalElement ( ) const
protected

Check if draw mode is to be handled as for graphical elements

◆ keyPressEvent()

void DdtGraphicsView::keyPressEvent ( QKeyEvent * event)
overrideprotected

Event handler to receive keyboard events

Parameters
eventKey event

Clearing the focus triggers the focusOutEvent of the text_item. This emits the signal GraphicsTextItemLostFocus that calls the connected slot HandleText(). Note: Do not call HandleText() directly!

◆ LayerDecrement

void DdtGraphicsView::LayerDecrement ( const int dec)
signal

Signal emitted to decrement the layer (plane) in a cube image

Parameters
decthe decrement value. A value of 0 will set the layer to the first one.

◆ LayerIncrement

void DdtGraphicsView::LayerIncrement ( const int inc)
signal

Signal emitted to increment the layer (plane) in a cube image

Parameters
incthe increment value. A value of 0 will set the layer to the last one.

◆ MouseDecrementScale

void DdtGraphicsView::MouseDecrementScale ( )
signal

Signal emitted when zooming in by mouse wheel

◆ mouseDoubleClickEvent()

void DdtGraphicsView::mouseDoubleClickEvent ( QMouseEvent * event)
overrideprotected

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)
overrideprotected

Event handler to receive mouse move events.

Parameters
eventthe mouse move event

◆ mousePressEvent()

void DdtGraphicsView::mousePressEvent ( QMouseEvent * event)
overrideprotected

Event handler to receive mouse press events.

Parameters
eventthe mouse press event

◆ mouseReleaseEvent()

void DdtGraphicsView::mouseReleaseEvent ( QMouseEvent * event)
overrideprotected

Event handler to receive mouse release events.

Parameters
eventthe mouse press event

◆ ReferenceLineHandleHoldingShift()

void DdtGraphicsView::ReferenceLineHandleHoldingShift ( )
protected

◆ SetConvertPixelToDegrees()

void DdtGraphicsView::SetConvertPixelToDegrees ( const double conv_pixel_degrees)

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

Parameters
conv_pixel_degreesthe 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
modethe current draw mode

◆ SetDrawSlitLine()

void DdtGraphicsView::SetDrawSlitLine ( const bool draw_line)

Sets the draw slit line flag

Parameters
draw_lineindicating if the slit line shall be drawn

◆ SetOverlayImageFile()

void DdtGraphicsView::SetOverlayImageFile ( const QString filename)

Sets the current overlay image file name

Parameters
filenamethe current overlay image file name

◆ 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

◆ UpdateCursorInfo()

void DdtGraphicsView::UpdateCursorInfo ( )

Update the cursor info

◆ wheelEvent()

void DdtGraphicsView::wheelEvent ( QWheelEvent * event)
overrideprotected

Event handler for mouse wheel events.

Parameters
eventthe scroll wheel event

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