ddt  0.1
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
DdtPanningWidget Class Reference

#include <ddtPanningWidget.hpp>

Inheritance diagram for DdtPanningWidget:
DdtWidget

Public Slots

void SetImage (const QImage *const image, const QTransform &transform, const bool show, const double rotation)
 
void ImageWidgetViewChanged (const QRectF &visible_image_rect, const int current_image_width, const int current_image_height)
 

Signals

void UpdatePosition (double scroll_fraction_x, double scroll_fraction_y)
 

Public Member Functions

 DdtPanningWidget (QWidget *parent=nullptr)
 
 ~DdtPanningWidget ()
 
void set_show_axes (const bool show)
 
bool get_show_axes () const
 
void set_rotation_deg (const float rotation)
 
float get_rotation_deg () const
 
- Public Member Functions inherited from DdtWidget
 DdtWidget (QWidget *parent=nullptr)
 DdtWidget. More...
 
virtual ~DdtWidget ()=default
 
QLayout * addParentLayout (QLayout *childLayout)
 addParentLayout This will add the given layout to the layout of the parent inside the group box. More...
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event)
 

Protected Attributes

bool show_axes
 
int show_status = 1
 
float rotation_deg
 
float zoom_factor
 
bool mouse_drag_active
 
QLabel * preview_image_label
 
QImage preview_image
 
QRect selection_rectangle
 
QRect max_selection_rectangle
 
int origin_x
 
int origin_y
 
QRubberBand * rubberband
 

Properties

bool ShowAxes
 

Detailed Description

Class for the Panning Widget that can be used to pan the image currently displayed in an Image Widget

Constructor & Destructor Documentation

◆ DdtPanningWidget()

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

Constructor

Parameters
parentPointer to the parent widget

◆ ~DdtPanningWidget()

DdtPanningWidget::~DdtPanningWidget ( )
default

Destructor

Member Function Documentation

◆ eventFilter()

bool DdtPanningWidget::eventFilter ( QObject *  obj,
QEvent *  event 
)
protected

Event filter that will be called especially when mouse events reach the widget

Parameters
objPointer to the object
eventPointer to the event that occurred

◆ get_rotation_deg()

float DdtPanningWidget::get_rotation_deg ( ) const

Rerieve the rotation angle (in degrees) that is used for the compass display

Returns
the rotation angle (in degrees)

◆ get_show_axes()

bool DdtPanningWidget::get_show_axes ( ) const

Retrieve the state of the show_axes flag

Returns
true if the compass axes should be plotted in the pan preview

◆ ImageWidgetViewChanged

void DdtPanningWidget::ImageWidgetViewChanged ( const QRectF &  visible_image_rect,
const int  current_image_width,
const int  current_image_height 
)
slot

Slot which is called when the position in the image widget was changed (e.g. by scrolling, resizing, zoom)

Parameters
visible_image_rectRectangle of the currently visible part of the image
current_image_widthTotal width of the image currently displayed
current_image_heightTotal height of the image currently displayed

◆ set_rotation_deg()

void DdtPanningWidget::set_rotation_deg ( const float  rotation)

Sets the rotation angle (in degrees) to be used for the compass display

Parameters
rotation_degthe rotation angle to be set (in degrees)

◆ set_show_axes()

void DdtPanningWidget::set_show_axes ( const bool  show)

Sets status of the flag that decides if compass axis should be shown at all

Parameters
show_axesif true the axes of the compass will be displayed in the preview image

◆ SetImage

void DdtPanningWidget::SetImage ( const QImage *const  image,
const QTransform &  transform,
const bool  show,
const double  rotation 
)
slot

Slot which is called when a new image was loaded in the image widget to the new preview image @transform Transformation to be used for drawing the compass @show_axes Flag indicating if the compass lines shall be shown @rotation The rotation angle for the compass display

◆ UpdatePosition

void DdtPanningWidget::UpdatePosition ( double  scroll_fraction_x,
double  scroll_fraction_y 
)
signal

Signal which is sent when the selection rectangle is moved

Parameters
scroll_fraction_xFraction of the width to which the selection rectangle was moved
scroll_fraction_yFraction of the height to which the selection rectangle was moved

Member Data Documentation

◆ max_selection_rectangle

QRect DdtPanningWidget::max_selection_rectangle
protected

Maximum rectangle that is available for the preview window

◆ mouse_drag_active

bool DdtPanningWidget::mouse_drag_active
protected

Flag which indicates that a mouse drag operation is in progress

◆ origin_x

int DdtPanningWidget::origin_x
protected

Origin of the x coordinate since the preview image might be smaller then the widget

◆ origin_y

int DdtPanningWidget::origin_y
protected

Origin of the y coordinate since the preview image might be smaller then the widget

◆ preview_image

QImage DdtPanningWidget::preview_image
protected

QImage that holds the preview image shown in the widget

◆ preview_image_label

QLabel* DdtPanningWidget::preview_image_label
protected

QLabel which is used to display the preview image that can be used to navigate the current view

◆ rotation_deg

float DdtPanningWidget::rotation_deg
protected

Rotation angle (in degrees) to be used for the compass display

◆ rubberband

QRubberBand* DdtPanningWidget::rubberband
protected

Rubberband object to display the selection rectangle in the widget

◆ selection_rectangle

QRect DdtPanningWidget::selection_rectangle
protected

Rectangle holding the current pan rectangle

◆ show_axes

bool DdtPanningWidget::show_axes
protected

Flag to decide if compass axes should be displayed in the widget

◆ show_status

int DdtPanningWidget::show_status = 1
protected

Status indicating which axes are to be shown 0 - show none 1 - show compass and x/y axes 2 - only show compass 3 - only show x/y axes

◆ zoom_factor

float DdtPanningWidget::zoom_factor
protected

Current zoom factor

Property Documentation

◆ ShowAxes

bool DdtPanningWidget::ShowAxes
readwrite

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