Beispiel #1
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);
    }
Beispiel #2
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 ) );
 }
Beispiel #3
0
 DistancePicker( QWidget *canvas ):
     QwtPlotPicker( canvas )
 {
     setTrackerMode( QwtPicker::ActiveOnly );
     setStateMachine( new QwtPickerDragLineMachine() );
     setRubberBand( QwtPlotPicker::PolygonRubberBand );
 }
QxrdPowderPointPicker::QxrdPowderPointPicker(QxrdImagePlot *plot)
  : QxrdImagePlotMeasurer(plot -> canvas(), plot),
    m_Plot(plot)
{
  setTrackerMode(QwtPicker::AlwaysOn);
  setStateMachine(new QwtPickerClickPointMachine());
  setRubberBand(QwtPicker::CrossRubberBand);
}
Beispiel #5
0
CurveTracker::CurveTracker( QWidget *canvas ):
    QwtPlotPicker( canvas )
{
    setTrackerMode( QwtPlotPicker::ActiveOnly );
    setRubberBand( VLineRubberBand );

    setStateMachine( new QwtPickerDragPointMachine() );
}
Beispiel #6
0
CurveTracker::CurveTracker( QWidget *canvas ):
    QwtPlotPicker( canvas )
{
    setTrackerMode( QwtPlotPicker::ActiveOnly );
    setRubberBand( VLineRubberBand );    
    setStateMachine( new QwtPickerTrackerMachineEx() );
    setRubberBandPen( QPen( "MediumOrchid" ) );

    currentX = 0;
}
//! Init the zoomer, used by the constructors
void QwtPlotZoomer::init( bool doReplot )
{
    d_data = new PrivateData;

    d_data->maxStackDepth = -1;

    setTrackerMode( ActiveOnly );
    setRubberBand( RectRubberBand );
    setStateMachine( new QwtPickerDragRectMachine() );

    if ( doReplot && plot() )
        plot()->replot();

    setZoomBase( scaleRect() );
}
Beispiel #8
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 () );
    }
Beispiel #9
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);
}
Beispiel #10
0
ViSpectrumPlotPicker::ViSpectrumPlotPicker(ViSpectrumPlot *plot)
	: QwtPlotPicker(plot->canvas())
{
	mPlot = plot;
	mZoomer = new QwtPlotZoomer(plot->canvas());
	mZoomer->setTrackerMode(QwtPicker::AlwaysOff);

	setStateMachine(new QwtPickerTrackerMachine);
	setTrackerMode(QwtPicker::ActiveOnly);
	setRubberBand(QwtPicker::VLineRubberBand);

	QPen pen(ViThemeManager::color(ViThemeColors::BorderColor1));
	setRubberBandPen(pen);
	mZoomer->setRubberBandPen(pen);
}
    OrdinationSelection(QwtPlotCanvas *canvas, SamplesPtr samples)
			:QwtPlotPicker(canvas), m_canvas(canvas), m_samples(samples), m_bAddToSelection(false)
    {
		m_stateMachine = new OrdinationSelectionMachine();
		setStateMachine(m_stateMachine);
		setTrackerMode(QwtPicker::AlwaysOn);
		setRubberBand(QwtPicker::RectRubberBand);

		QPen rubberBandPen(QPen(QColor(150, 190, 240)));
		rubberBandPen.setStyle(Qt::DashLine);
		rubberBandPen.setWidth(2);
		setRubberBandPen(rubberBandPen);

		setEnabled(true);

		QObject::connect(this, SIGNAL(selected(const QRectF&)), this, SLOT(ProcessRect(const QRectF&)));
    }
Beispiel #12
0
void QwtPicker::setSelectionFlags(int flags)
{
    d_data->selectionFlags = flags;
    setStateMachine(stateMachine(flags));
}
void GameState::create(StateMachine& stateMachine)
{
	setStateMachine(stateMachine);
	firstLevel_	= new FirstLevel(*this);
	firstLevel_->create();
}
Beispiel #14
0
 RiuPvtQwtPicker(QwtPlot* plot, RiuPvtTrackerTextProvider* trackerTextProvider)
  :  QwtPicker(QwtPicker::NoRubberBand, QwtPicker::AlwaysOn, plot->canvas()),
     m_trackerTextProvider(trackerTextProvider)
 {
     setStateMachine(new QwtPickerTrackerMachine);
 }