Exemple #1
0
 explicit picker( QWidget * parent = 0 ) : QwtPlotPicker( parent ) {
     setTrackerMode( QwtPicker::AlwaysOff );
     setStateMachine( new QwtPickerDragRectMachine() );
     setRubberBand( QwtPicker::RectRubberBand );
     setRubberBandPen( QColor( Qt::red ) );
     setTrackerPen( QColor( Qt::white ) );
 }
QcepPlotZoomer::QcepPlotZoomer(QWidget *canvas, QcepPlot *plot)
  : QwtPlotZoomer(canvas),
  m_Plot(plot)
{
  setTrackerMode(QwtPicker::AlwaysOn);
  setTrackerPen(QPen(Qt::green));
}
Exemple #3
0
    Zoomer(int xAxis, int yAxis, QWidget *canvas):
#else
    Zoomer(int xAxis, int yAxis, QwtPlotCanvas *canvas):
#endif
        QwtPlotZoomer(xAxis, yAxis, canvas)
    {
#if QWT_VERSION >= 0x060000
        setStateMachine(new QwtPickerDragRectMachine());
#else
        setSelectionFlags(QwtPicker::DragSelection | QwtPicker::CornerToCorner);
#endif
	//	setTrackerMode(QwtPlotZoomer::AlwaysOn);
	//        setTrackerMode(QwtPicker::AlwaysOff);
	//        setRubberBand(QwtPicker::NoRubberBand);
	QPen pen = rubberBandPen();
	pen.setColor(Qt::black);
	setRubberBandPen(pen);
	setTrackerPen(pen);
        // RightButton: zoom out by 1
        // Ctrl+RightButton: zoom out to full size

        setMousePattern(QwtEventPattern::MouseSelect2,
            Qt::RightButton, Qt::ControlModifier);
        setMousePattern(QwtEventPattern::MouseSelect3,
            Qt::RightButton);
    }
Exemple #4
0
int QwtPicker::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: activated((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: selected((*reinterpret_cast< const QPolygon(*)>(_a[1]))); break;
        case 2: appended((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 3: moved((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 4: removed((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        case 5: changed((*reinterpret_cast< const QPolygon(*)>(_a[1]))); break;
        case 6: setEnabled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 7;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isEnabled(); break;
        case 1: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break;
        case 2: *reinterpret_cast< DisplayMode*>(_v) = trackerMode(); break;
        case 3: *reinterpret_cast< QPen*>(_v) = trackerPen(); break;
        case 4: *reinterpret_cast< QFont*>(_v) = trackerFont(); break;
        case 5: *reinterpret_cast< RubberBand*>(_v) = rubberBand(); break;
        case 6: *reinterpret_cast< QPen*>(_v) = rubberBandPen(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 1: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break;
        case 2: setTrackerMode(*reinterpret_cast< DisplayMode*>(_v)); break;
        case 3: setTrackerPen(*reinterpret_cast< QPen*>(_v)); break;
        case 4: setTrackerFont(*reinterpret_cast< QFont*>(_v)); break;
        case 5: setRubberBand(*reinterpret_cast< RubberBand*>(_v)); break;
        case 6: setRubberBandPen(*reinterpret_cast< QPen*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemple #5
0
PlotZozPicker::PlotZozPicker( QWidget *canvas ): QwtPlotPicker( canvas )
{
    setAxis(QwtPlot::xBottom, QwtPlot::yLeft);
    setTrackerMode(QwtPlotPicker::AlwaysOn);
    setRubberBandPen(QColor(Qt::green));
    setRubberBand(QwtPicker::CrossRubberBand);
    setTrackerPen(QColor(Qt::black));
}
Exemple #6
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RiuFlowCharacteristicsPlot::addWindowZoom(QwtPlot* plot)
{
    auto zoomer = new RiuQwtPlotZoomer(plot->canvas());
    zoomer->setRubberBandPen(QColor(Qt::black));
    zoomer->setTrackerMode(QwtPicker::AlwaysOff);
    zoomer->setTrackerPen(QColor(Qt::black));
    zoomer->initMousePattern(1);
}
Exemple #7
0
void QxrdImagePlot::setInverseGrayscale()
{
  colorMapStart(Qt::white, Qt::black);
  colorMapRange(0.0, Qt::white, 1.0, Qt::black);

  setTrackerPen(QPen(Qt::red));

  changedColorMap();
}
int QwtPicker::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 4)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 4;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = selectionFlags(); break;
        case 1: *reinterpret_cast< DisplayMode*>(_v) = trackerMode(); break;
        case 2: *reinterpret_cast< QFont*>(_v) = trackerFont(); break;
        case 3: *reinterpret_cast< RubberBand*>(_v) = rubberBand(); break;
        case 4: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break;
        case 5: *reinterpret_cast< bool*>(_v) = isEnabled(); break;
        case 6: *reinterpret_cast< QPen*>(_v) = trackerPen(); break;
        case 7: *reinterpret_cast< QPen*>(_v) = rubberBandPen(); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setSelectionFlags(*reinterpret_cast< int*>(_v)); break;
        case 1: setTrackerMode(*reinterpret_cast< DisplayMode*>(_v)); break;
        case 2: setTrackerFont(*reinterpret_cast< QFont*>(_v)); break;
        case 3: setRubberBand(*reinterpret_cast< RubberBand*>(_v)); break;
        case 4: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break;
        case 5: setEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 6: setTrackerPen(*reinterpret_cast< QPen*>(_v)); break;
        case 7: setRubberBandPen(*reinterpret_cast< QPen*>(_v)); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 8;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemple #9
0
void QxrdImagePlot::setIce()
{
  colorMapStart(Qt::black, Qt::white);

  colorMapRange(0.0,  Qt::black, 0.25, Qt::blue);
  colorMapRange(0.25, Qt::blue,  0.75, Qt::cyan);
  colorMapRange(0.75, Qt::cyan,  1.0,  Qt::white);

  setTrackerPen(QPen(Qt::red));

  changedColorMap();
}
Exemple #10
0
void QxrdImagePlot::setFire()
{
  colorMapStart(Qt::black, Qt::white);

  colorMapRange(0.0,  Qt::black,  0.25, Qt::red);
  colorMapRange(0.25, Qt::red,    0.75, Qt::yellow);
  colorMapRange(0.75, Qt::yellow, 1.0,  Qt::white);

  setTrackerPen(QPen(Qt::blue));

  changedColorMap();
}
Exemple #11
0
void QxrdImagePlot::setSpectrum()
{
  colorMapStart(Qt::magenta, Qt::red);

  colorMapRange(0.0, Qt::magenta,0.2, Qt::blue);
  colorMapRange(0.2, Qt::blue,   0.4, Qt::cyan);
  colorMapRange(0.4, Qt::cyan,   0.6, Qt::green);
  colorMapRange(0.6, Qt::green,  0.8, Qt::yellow);
  colorMapRange(0.8, Qt::yellow, 1.0, Qt::red);

  setTrackerPen(QPen(Qt::black));

  changedColorMap();
}
Exemple #12
0
void QxrdImagePlot::setEarthTones()
{
  colorMapStart(Qt::black, Qt::white);

  colorMapRange(0.0, Qt::black, 0.15, Qt::blue);
  colorMapRange(0.15, Qt::blue, 0.25, Qt::gray);
  colorMapRange(0.25, Qt::gray, 0.35, Qt::green);
  colorMapRange(0.35, Qt::green, 0.5, Qt::darkYellow);
  colorMapRange(0.5, Qt::darkYellow, 0.85, Qt::darkMagenta);
  colorMapRange(0.85, Qt::darkMagenta, 1.0, Qt::white);

  setTrackerPen(QPen(Qt::red));

  changedColorMap();
}
Exemple #13
0
    PlotPicker( QWidget *canvas , const struct stream_info* streamInfo, const size_t group, const QVector<QwtPlotCurve*>* curves):
        m_streamInfo( streamInfo ),
        m_group( group ),
        m_curves( curves ),
        QwtPlotPicker( canvas )
    {
        setAxis( QwtPlot::xBottom, QwtPlot::yLeft );
        setRubberBand( QwtPlotPicker::CrossRubberBand );
        setRubberBandPen( QColor( Qt::green ) );

        setTrackerMode( QwtPicker::AlwaysOn );
        setTrackerPen( QColor( Qt::black ) );

        setStateMachine( new QwtPickerDragPointMachine () );
    }
Exemple #14
0
//矩形设门
//提供选择类
RectPicker::RectPicker(QWidget *canvas)
:QwtPlotPicker(canvas)
{
	setAxis(QwtPlot::xBottom, QwtPlot::yLeft);
	setResizeMode(QwtPicker::KeepSize);//变形模式
	//设置一个状态机,并删除上一个
	setStateMachine(new QwtPickerDragRectMachine());
	setRubberBandPen(QColor(Qt::red));
	//设置橡胶圈样式:椭圆
	setRubberBand(QwtPicker::RectRubberBand);
	setTrackerPen(QColor(Qt::blue));
	//设置跟踪模式
	setTrackerMode(QwtPicker::ActiveOnly);
	setEnabled(false);
}