4 #include "qwt_picker_machine.h"
10 setTrackerMode(QwtPicker::AlwaysOn);
16 qRegisterMetaType<QRectF>(
"QRectF");
18 setStateMachine(
new QwtPickerDragRectMachine());
19 setRubberBand(QwtPicker::EllipseRubberBand);
26 if ( points.size() == 2 ) {
27 const int width = qAbs(points[1].x() - points[0].x());
28 const int height = qAbs(points[1].y() - points[0].y());
30 QRect rect(0, 0, 2 * width, 2 * height);
31 rect.moveCenter(points[0]);
33 adjusted += rect.topLeft();
34 adjusted += rect.bottomRight();
43 qRegisterMetaType< QVector<QPointF> >(
"QVector<QPointF>");
45 setStateMachine(
new QwtPickerPolygonMachine());
46 setRubberBand(QwtPicker::PolygonRubberBand);
55 QxrdMaskPicker::append(pt);
64 return QxrdMaskPicker::end(ok);
QxrdCircularMaskPicker(QWidget *canvas, QxrdImagePlot *plot)
QxrdMaskPicker(QWidget *canvas, QxrdImagePlot *plot)
void append(const QPoint &pt)
QxrdPolygonalMaskPicker(QWidget *canvas, QxrdImagePlot *plot)
QPolygon adjustedPoints(const QPolygon &points) const
void disableContextMenu()