CanvasPicker Class Reference

Handles parts of the user interaction for a Plot by registering itself as an event filter for its QwtPlotCanvas. More...

`#include <CanvasPicker.h>`

Inheritance diagram for CanvasPicker:

## Signals

void | modified ()
void | showMarkerPopupMenu ()
void | showPlotDialog (int)
void | viewLineDialog ()

## Public Member Functions

| CanvasPicker (Graph *plot)
void | disableEditing ()
| Disable editing of d_editing_marker on a TAB-key event. More...
virtual bool | eventFilter (QObject *, QEvent *)
void | selectPeak (const QPoint &p)
void | selectPoints (int n)

## Private Member Functions

void | drawLineMarker (const QPoint &, bool endArrow)
Graph * | plot ()
| Return my parent as a Graph. More...
bool | selectMarker (const QMouseEvent *e)
| Selects and highlights the marker at the given position. More...

## Private Attributes

ArrowMarker * | d_editing_marker
| The marker that is currently being edited, or NULL. Editing does explicitly not inlude moving and resizing, which are being handled by SelectionMoveResizer (see Graph::d_markers_selector). Currently, only ArrowMarker provides any other form of editing, but this really should be generalized. See ImageMarker for details. More...
QPoint | endLinePoint
bool | pointSelected
QPoint | startLinePoint

## Detailed Description

Handles parts of the user interaction for a Plot by registering itself as an event filter for its QwtPlotCanvas.

## Constructor & Destructor Documentation

CanvasPicker::CanvasPicker | ( | Graph * | plot | ) |

References d_editing_marker, and pointSelected.

## Member Function Documentation

void CanvasPicker::disableEditing | ( |  | ) |

Disable editing of d_editing_marker on a TAB-key event.

Called by Graph::focusNextPrevChild ()

References d_editing_marker, and ArrowMarker::setEditable().

Referenced by Graph::deselectMarker(), Graph::remove(), and selectMarker().

void CanvasPicker::drawLineMarker | ( | const QPoint & | point,
|  | bool | endArrow
| ) |  |

private

References ArrowMarker::drawEndArrow(), ArrowMarker::drawStartArrow(), plot(), ArrowMarker::setColor(), ArrowMarker::setEndPoint(), ArrowMarker::setStartPoint(), ArrowMarker::setStyle(), ArrowMarker::setWidth(), and startLinePoint.

Referenced by eventFilter().

bool CanvasPicker::eventFilter | ( | QObject * | object,
|  | QEvent * | e
| ) |  |

virtual

References Graph::activateGraph(), Graph::activeTool(), Graph::addArrow(), MdiSubWindow::applicationWindow(), Graph::arrowsList(), Graph::closestCurve(), Graph::curveIndex(), d_editing_marker, ApplicationWindow::d_graph_attach_policy, ApplicationWindow::defaultArrowColor, ApplicationWindow::defaultArrowHeadAngle, ApplicationWindow::defaultArrowHeadFill, ApplicationWindow::defaultArrowHeadLength, ApplicationWindow::defaultArrowLineStyle, ApplicationWindow::defaultArrowLineWidth, Graph::deselect(), Graph::drawArrow(), ArrowMarker::drawEndArrow(), Graph::drawLine(), Graph::drawLineActive(), drawLineMarker(), ArrowMarker::drawStartArrow(), ArrowMarker::eventFilter(), ArrowMarker::fillArrowHead(), Graph::hasPanningMagnifierEnabled(), Graph::increasingAreaEnrichmentsList(), Graph::isPiePlot(), FrameWidget::mousePressEvent(), Graph::multiLayer(), plot(), Graph::selectCanvas(), Graph::selectedArrow(), Graph::selectedCurveLabels(), selectMarker(), ArrowMarker::setAttachPolicy(), ArrowMarker::setColor(), ArrowMarker::setEndPoint(), ArrowMarker::setHeadAngle(), ArrowMarker::setHeadLength(), ArrowMarker::setStartPoint(), ArrowMarker::setStyle(), ArrowMarker::setWidth(), showMarkerPopupMenu(), showPlotDialog(), startLinePoint, viewLineDialog(), and Graph::zoomOn().

void CanvasPicker::modified | ( |  | ) |

signal

Graph* CanvasPicker::plot | ( |  | ) |

inline private

Return my parent as a Graph.

Referenced by drawLineMarker(), eventFilter(), and selectMarker().

bool CanvasPicker::selectMarker | ( | const QMouseEvent * | e | ) |

private

Selects and highlights the marker at the given position.

Returns
  whether a marker was found at pointSelected

References Graph::arrowsList(), d_editing_marker, Graph::deselectMarker(), disableEditing(), ArrowMarker::dist(), plot(), ArrowMarker::setEditable(), and Graph::setSelectedArrow().

Referenced by eventFilter().

void CanvasPicker::selectPeak | ( | const QPoint & | p | ) |

void CanvasPicker::selectPoints | ( | int | n | ) |

void CanvasPicker::showMarkerPopupMenu | ( |  | ) |

signal

Referenced by eventFilter().

void CanvasPicker::showPlotDialog | ( | int |  | ) |

signal

Referenced by eventFilter().

void CanvasPicker::viewLineDialog | ( |  | ) |

signal

Referenced by eventFilter().

## Member Data Documentation

ArrowMarker* CanvasPicker::d_editing_marker

private

The marker that is currently being edited, or NULL. Editing does explicitly not inlude moving and resizing, which are being handled by SelectionMoveResizer (see Graph::d_markers_selector). Currently, only ArrowMarker provides any other form of editing, but this really should be generalized. See ImageMarker for details.

Referenced by CanvasPicker(), disableEditing(), eventFilter(), and selectMarker().

QPoint CanvasPicker::endLinePoint

private

bool CanvasPicker::pointSelected

private

Referenced by CanvasPicker().

QPoint CanvasPicker::startLinePoint

private

Referenced by drawLineMarker(), and eventFilter().

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

- qtiplot/src/plot2D/CanvasPicker.h
- qtiplot/src/plot2D/CanvasPicker.cpp