Public Member Functions | Protected Member Functions | Private Attributes | List of all members
PlotZoomer Class Reference

#include <plotzoomer.h>

Inheritance diagram for PlotZoomer:
Inheritance graph
[legend]

Public Member Functions

void keepAspectratio (bool doKeep)
 
 PlotZoomer ()
 
 PlotZoomer (QWidget *)
 
virtual ~PlotZoomer () override=default
 
- Public Member Functions inherited from QwtPlotZoomer
int maxStackDepth () const
 
 QwtPlotZoomer (QWidget *, bool doReplot=true)
 Create a zoomer for a plot canvas. More...
 
 QwtPlotZoomer (int xAxis, int yAxis, QWidget *, bool doReplot=true)
 Create a zoomer for a plot canvas. More...
 
virtual void setAxis (int xAxis, int yAxis) override
 
void setMaxStackDepth (int)
 Limit the number of recursive zoom operations to depth. More...
 
virtual void setZoomBase (bool doReplot=true)
 
virtual void setZoomBase (const QRectF &)
 Set the initial size of the zoomer. More...
 
void setZoomStack (const QStack< QRectF > &, int zoomRectIndex=-1)
 Assign a zoom stack. More...
 
QRectF zoomBase () const
 
QRectF zoomRect () const
 
uint zoomRectIndex () const
 
const QStack< QRectF > & zoomStack () const
 
virtual ~QwtPlotZoomer ()
 
- Public Member Functions inherited from QwtPlotPicker
QWidget * canvas ()
 
const QWidget * canvas () const
 
QwtPlotplot ()
 
const QwtPlotplot () const
 
 QwtPlotPicker (QWidget *canvas)
 Create a plot picker. More...
 
 QwtPlotPicker (int xAxis, int yAxis, QWidget *)
 
 QwtPlotPicker (int xAxis, int yAxis, RubberBand rubberBand, DisplayMode trackerMode, QWidget *)
 
int xAxis () const
 Return x axis. More...
 
int yAxis () const
 Return y axis. More...
 
virtual ~QwtPlotPicker ()
 Destructor. More...
 
- Public Member Functions inherited from QwtPicker
virtual void drawRubberBand (QPainter *) const
 
virtual void drawTracker (QPainter *) const
 
virtual bool eventFilter (QObject *, QEvent *)
 Event filter. More...
 
bool isActive () const
 
bool isEnabled () const
 
QWidget * parentWidget ()
 Return the parent widget, where the selection happens. More...
 
const QWidget * parentWidget () const
 Return the parent widget, where the selection happens. More...
 
virtual QPainterPath pickArea () const
 
 QwtPicker (QWidget *parent)
 
 QwtPicker (RubberBand rubberBand, DisplayMode trackerMode, QWidget *)
 
ResizeMode resizeMode () const
 
RubberBand rubberBand () const
 
virtual QRegion rubberBandMask () const
 
QPen rubberBandPen () const
 
QPolygon selection () const
 
void setResizeMode (ResizeMode)
 Set the resize mode. More...
 
void setRubberBand (RubberBand)
 
void setRubberBandPen (const QPen &)
 
void setStateMachine (QwtPickerMachine *)
 
void setTrackerFont (const QFont &)
 
void setTrackerMode (DisplayMode)
 Set the display mode of the tracker. More...
 
void setTrackerPen (const QPen &)
 
const QwtPickerMachinestateMachine () const
 
QwtPickerMachinestateMachine ()
 
QFont trackerFont () const
 
virtual QRegion trackerMask () const
 
DisplayMode trackerMode () const
 
QPen trackerPen () const
 
QPoint trackerPosition () const
 
virtual QRect trackerRect (const QFont &) const
 
virtual ~QwtPicker ()
 Destructor. More...
 
- Public Member Functions inherited from QwtEventPattern
void initKeyPattern ()
 
void initMousePattern (int numButtons)
 
bool keyMatch (KeyPatternCode, const QKeyEvent *) const
 Compare a key event with an event pattern. More...
 
const QVector< KeyPattern > & keyPattern () const
 
QVector< KeyPattern > & keyPattern ()
 
bool mouseMatch (MousePatternCode, const QMouseEvent *) const
 Compare a mouse event with an event pattern. More...
 
const QVector< MousePattern > & mousePattern () const
 
QVector< MousePattern > & mousePattern ()
 
 QwtEventPattern ()
 
void setKeyPattern (KeyPatternCode, int keyCode, Qt::KeyboardModifiers modifierCodes=Qt::NoModifier)
 
void setKeyPattern (const QVector< KeyPattern > &)
 Change the key event patterns. More...
 
void setMousePattern (MousePatternCode, Qt::MouseButton button, Qt::KeyboardModifiers=Qt::NoModifier)
 
void setMousePattern (const QVector< MousePattern > &)
 Change the mouse event patterns. More...
 
virtual ~QwtEventPattern ()
 Destructor. More...
 

Protected Member Functions

virtual bool accept (QPolygon &) const override
 Check and correct a selected rectangle. More...
 
virtual QSizeF minZoomSize () const override
 Limit zooming by a minimum rectangle. More...
 
virtual void widgetMouseMoveEvent (QMouseEvent *event) override
 
virtual void widgetMousePressEvent (QMouseEvent *event) override
 
virtual void widgetMouseReleaseEvent (QMouseEvent *event) override
 
virtual void zoom (const QRectF &rect) override
 Zoom in. More...
 
- Protected Member Functions inherited from QwtPlotZoomer
virtual void begin () override
 
virtual bool end (bool ok=true) override
 
virtual void rescale ()
 
virtual void widgetKeyPressEvent (QKeyEvent *) override
 
- Protected Member Functions inherited from QwtPlotPicker
virtual void append (const QPoint &)
 
QRectF invTransform (const QRect &) const
 
QPointF invTransform (const QPoint &) const
 
virtual void move (const QPoint &)
 
QRectF scaleRect () const
 
virtual QwtText trackerText (const QPoint &) const
 
virtual QwtText trackerTextF (const QPointF &) const
 Translate a position into a position string. More...
 
QRect transform (const QRectF &) const
 
QPoint transform (const QPointF &) const
 
- Protected Member Functions inherited from QwtPicker
virtual QPolygon adjustedPoints (const QPolygon &) const
 Map the pickedPoints() into a selection() More...
 
const QPolygon & pickedPoints () const
 
virtual void remove ()
 
virtual void reset ()
 
const QwtWidgetOverlayrubberBandOverlay () const
 
virtual void stretchSelection (const QSize &oldSize, const QSize &newSize)
 
const QwtWidgetOverlaytrackerOverlay () const
 
virtual void transition (const QEvent *)
 
virtual void updateDisplay ()
 Update the state of rubber band and tracker label. More...
 
virtual void widgetEnterEvent (QEvent *)
 
virtual void widgetKeyReleaseEvent (QKeyEvent *)
 
virtual void widgetLeaveEvent (QEvent *)
 
virtual void widgetMouseDoubleClickEvent (QMouseEvent *)
 
virtual void widgetWheelEvent (QWheelEvent *)
 
- Protected Member Functions inherited from QwtEventPattern
virtual bool keyMatch (const KeyPattern &, const QKeyEvent *) const
 Compare a key event with an event pattern. More...
 
virtual bool mouseMatch (const MousePattern &, const QMouseEvent *) const
 Compare a mouse event with an event pattern. More...
 

Private Attributes

QPoint _initial_pos
 
bool _keep_aspect_ratio
 
bool _mouse_pressed
 
bool _zoom_enabled
 

Additional Inherited Members

- Public Types inherited from QwtPicker
enum  DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly }
 Display mode. More...
 
enum  ResizeMode { Stretch, KeepSize }
 
enum  RubberBand {
  NoRubberBand = 0, HLineRubberBand, VLineRubberBand, CrossRubberBand,
  RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand = 100
}
 
- Public Types inherited from QwtEventPattern
enum  KeyPatternCode {
  KeySelect1, KeySelect2, KeyAbort, KeyLeft,
  KeyRight, KeyUp, KeyDown, KeyRedo,
  KeyUndo, KeyHome, KeyPatternCount
}
 Symbolic keyboard input codes. More...
 
enum  MousePatternCode {
  MouseSelect1, MouseSelect2, MouseSelect3, MouseSelect4,
  MouseSelect5, MouseSelect6, MousePatternCount
}
 Symbolic mouse input codes. More...
 
- Public Slots inherited from QwtPlotZoomer
void moveBy (double dx, double dy)
 
virtual void moveTo (const QPointF &)
 
virtual void zoom (int offset)
 Zoom in or out. More...
 
- Public Slots inherited from QwtPicker
void setEnabled (bool)
 En/disable the picker. More...
 
- Signals inherited from QwtPlotZoomer
void zoomed (const QRectF &rect)
 
- Signals inherited from QwtPlotPicker
void appended (const QPointF &pos)
 
void moved (const QPointF &pos)
 
void selected (const QPointF &pos)
 
void selected (const QRectF &rect)
 
void selected (const QVector< QPointF > &pa)
 
- Signals inherited from QwtPicker
void activated (bool on)
 
void appended (const QPoint &pos)
 
void changed (const QPolygon &selection)
 
void moved (const QPoint &pos)
 
void removed (const QPoint &pos)
 
void selected (const QPolygon &polygon)
 
- Properties inherited from QwtPicker
bool isEnabled
 
ResizeMode resizeMode
 
RubberBand rubberBand
 
QPen rubberBandPen
 
QFont trackerFont
 
DisplayMode trackerMode
 
QPen trackerPen
 

Detailed Description

Definition at line 7 of file plotzoomer.h.

Constructor & Destructor Documentation

PlotZoomer::PlotZoomer ( )
PlotZoomer::PlotZoomer ( QWidget *  canvas)
explicit

Definition at line 7 of file plotzoomer.cpp.

virtual PlotZoomer::~PlotZoomer ( )
overridevirtualdefault

Member Function Documentation

bool PlotZoomer::accept ( QPolygon &  pa) const
overrideprotectedvirtual

Check and correct a selected rectangle.

Reject rectangles with a height or width < 2, otherwise expand the selected rectangle to a minimum size of 11x11 and accept it.

Returns
true If the rectangle is accepted, or has been changed to an accepted one.

Reimplemented from QwtPlotZoomer.

Definition at line 75 of file plotzoomer.cpp.

void PlotZoomer::keepAspectratio ( bool  doKeep)
inline

Definition at line 16 of file plotzoomer.h.

QSizeF PlotZoomer::minZoomSize ( ) const
overrideprotectedvirtual

Limit zooming by a minimum rectangle.

Returns
zoomBase().width() / 10e4, zoomBase().height() / 10e4

Reimplemented from QwtPlotZoomer.

Definition at line 119 of file plotzoomer.cpp.

void PlotZoomer::widgetMouseMoveEvent ( QMouseEvent *  mouseEvent)
overrideprotectedvirtual

Handle a mouse move event for the observed widget.

Parameters
mouseEventMouse event
See also
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

Reimplemented from QwtPicker.

Definition at line 32 of file plotzoomer.cpp.

void PlotZoomer::widgetMousePressEvent ( QMouseEvent *  mouseEvent)
overrideprotectedvirtual

Handle a mouse press event for the observed widget.

Parameters
mouseEventMouse event
See also
eventFilter(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

Reimplemented from QwtPicker.

Definition at line 16 of file plotzoomer.cpp.

void PlotZoomer::widgetMouseReleaseEvent ( QMouseEvent *  me)
overrideprotectedvirtual

Qt::MidButton zooms out one position on the zoom stack, Qt::RightButton to the zoom base.

Changes the current position on the stack, but doesn't pop any rectangle.

Note
The mouse events can be changed, using QwtEventPattern::setMousePattern: 2, 1

Reimplemented from QwtPlotZoomer.

Definition at line 67 of file plotzoomer.cpp.

void PlotZoomer::zoom ( const QRectF &  rect)
overrideprotectedvirtual

Zoom in.

Clears all rectangles above the current position of the zoom stack and pushes the normalized rectangle on it.

Note
If the maximal stack depth is reached, zoom is ignored.
The zoomed signal is emitted.

Reimplemented from QwtPlotZoomer.

Definition at line 92 of file plotzoomer.cpp.

Member Data Documentation

QPoint PlotZoomer::_initial_pos
private

Definition at line 34 of file plotzoomer.h.

bool PlotZoomer::_keep_aspect_ratio
private

Definition at line 33 of file plotzoomer.h.

bool PlotZoomer::_mouse_pressed
private

Definition at line 31 of file plotzoomer.h.

bool PlotZoomer::_zoom_enabled
private

Definition at line 32 of file plotzoomer.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18