Ejemplo n.º 1
0
//! Init the picker, used by the constructors
void QwtPicker::init( QWidget *parent,
    RubberBand rubberBand, DisplayMode trackerMode )
{
    d_data = new PrivateData;

    d_data->rubberBandWidget = NULL;
    d_data->trackerWidget = NULL;

    d_data->rubberBand = rubberBand;
    d_data->enabled = false;
    d_data->resizeMode = Stretch;
    d_data->trackerMode = AlwaysOff;
    d_data->isActive = false;
    d_data->trackerPosition = QPoint( -1, -1 );
    d_data->mouseTracking = false;

    d_data->stateMachine = NULL;

    if ( parent )
    {
        if ( parent->focusPolicy() == Qt::NoFocus )
            parent->setFocusPolicy( Qt::WheelFocus );

        d_data->trackerFont = parent->font();
        d_data->mouseTracking = parent->hasMouseTracking();
        setEnabled( true );
    }
    setTrackerMode( trackerMode );
}
Ejemplo n.º 2
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;
}
Ejemplo n.º 3
0
QxrdPowderPointPicker::QxrdPowderPointPicker(QxrdImagePlot *plot)
  : QxrdImagePlotMeasurer(plot -> canvas(), plot),
    m_Plot(plot)
{
  setTrackerMode(QwtPicker::AlwaysOn);
  setStateMachine(new QwtPickerClickPointMachine());
  setRubberBand(QwtPicker::CrossRubberBand);
}
Ejemplo n.º 4
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);
}
Ejemplo n.º 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));
}
Ejemplo n.º 6
0
CurveTracker::CurveTracker( QWidget *canvas ):
    QwtPlotPicker( canvas )
{
    setTrackerMode( QwtPlotPicker::ActiveOnly );
    setRubberBand( VLineRubberBand );

    setStateMachine( new QwtPickerDragPointMachine() );
}
Ejemplo n.º 7
0
CurveTracker::CurveTracker( QWidget *canvas ):
    QwtPlotPicker( canvas )
{
    setTrackerMode( QwtPlotPicker::ActiveOnly );
    setRubberBand( VLineRubberBand );    
    setStateMachine( new QwtPickerTrackerMachineEx() );
    setRubberBandPen( QPen( "MediumOrchid" ) );

    currentX = 0;
}
Ejemplo n.º 8
0
	Zoomer(int xAxis,int yAxis,QWidget *canvas):
		QwtPlotZoomer(xAxis,yAxis,canvas)
	{
		setTrackerMode(QwtPicker::AlwaysOff);
		setRubberBand(QwtPicker::NoRubberBand);

		setMousePattern(QwtEventPattern::MouseSelect2,
						Qt::RightButton,Qt::ControlModifier);
		setMousePattern(QwtEventPattern::MouseSelect3,
						Qt::RightButton);
	}
Ejemplo n.º 9
0
//! Init the zoomer, used by the constructors
void QwtPlotZoomer::init(int selectionFlags, DisplayMode trackerMode)
{
    d_data = new PrivateData;

    d_data->maxStackDepth = -1;

    setSelectionFlags(selectionFlags);
    setTrackerMode(trackerMode);
    setRubberBand(RectRubberBand);

    setZoomBase(scaleRect());
}
Ejemplo n.º 10
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) {
        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;
}
Ejemplo n.º 11
0
    Zoomer(int xAxis, int yAxis, QwtPlotCanvas *canvas):
        QwtPlotZoomer(xAxis, yAxis, canvas)
    {
        setTrackerMode(QwtPicker::AlwaysOff);
        setRubberBand(QwtPicker::NoRubberBand);

        // RightButton: zoom out by 1
        // Ctrl+RightButton: zoom out to full size

        setMousePattern(QwtEventPattern::MouseSelect2,
            Qt::RightButton, Qt::ControlModifier);
        setMousePattern(QwtEventPattern::MouseSelect3,
            Qt::RightButton);
    }
Ejemplo n.º 12
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);
}
Ejemplo n.º 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 () );
    }
Ejemplo n.º 14
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);
}
Ejemplo n.º 15
0
LazyCameraManipulator::LazyCameraManipulator():
	NodeTrackerManipulator() 
{   
    _oldNodePosition = osg::Vec3(0, 0, 0);
    _oldCameraPosition = osg::Vec3(0, 0, 0);
    _newCameraPosition = osg::Vec3(0, 0, 0);
    
    _directionOfMovementX = 0;
    _durationOfMovementX = 0;
    
    _firstRun = true;
    _fadeOut = false;
    
	setTrackerMode(osgGA::NodeTrackerManipulator::NODE_CENTER);    	  
}
Ejemplo n.º 16
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() );
}
Ejemplo n.º 17
0
    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&)));
    }
Ejemplo n.º 18
0
//! Initialize the picker - used by the constructors
void QwtPicker::init( QWidget *parent,
    RubberBand rubberBand, DisplayMode trackerMode )
{
    d_data = new PrivateData;

    d_data->rubberBand = rubberBand;

    if ( parent )
    {
        if ( parent->focusPolicy() == Qt::NoFocus )
            parent->setFocusPolicy( Qt::WheelFocus );

        d_data->openGL = parent->inherits( "QGLWidget" );
        d_data->trackerFont = parent->font();
        d_data->mouseTracking = parent->hasMouseTracking();

        setEnabled( true );
    }

    setTrackerMode( trackerMode );
}
Ejemplo n.º 19
0
 MyZoomer(Plot *plot) : QwtPlotZoomer(plot->canvas())
 {
   mPlot = plot;
   setTrackerMode(AlwaysOn);
 }
Ejemplo n.º 20
0
 MyZoomer(QwtPlotCanvas *canvas):
     QwtPlotZoomer(canvas, true)
 {
     setTrackerMode(AlwaysOn);
 }
Ejemplo n.º 21
0
 zoomer( QWidget * canvas ) : QwtPlotZoomer( canvas ) {
     setTrackerMode( ActiveOnly );
 }
Ejemplo n.º 22
0
 MyZoomer( QWidget *canvas ):
     QwtPlotZoomer(dynamic_cast<QwtPlotCanvas *>(canvas))
 {
     setTrackerMode( AlwaysOn );
 }
Ejemplo n.º 23
0
PfPvDoubleClickPicker::PfPvDoubleClickPicker( PfPvPlot *plot):
    QwtPlotPicker( plot->canvas() ), pfPvPlot(plot)
{
    setRubberBand(QwtPicker::CrossRubberBand);
    setTrackerMode(QwtPicker::AlwaysOn);
}
Ejemplo n.º 24
0
 MyZoomer(QwtPlotCanvas *canvas):
     QwtPlotZoomer(canvas)
 {
     setTrackerMode(AlwaysOff);
 }
Ejemplo n.º 25
0
 MyZoomer( QWidget *canvas ):
     QwtPlotZoomer( canvas )
 {
     setTrackerMode( AlwaysOn );
 }
Ejemplo n.º 26
0
 Zoomer( QWidget *canvas ):
     QwtPlotZoomer( canvas )
 {
     setRubberBandPen( QColor( Qt::darkGreen ) );
     setTrackerMode( QwtPlotPicker::AlwaysOn );
 }
Ejemplo n.º 27
0
 MyZoomer(SectionWindow *parent, QwtPlotCanvas *canvas):
     QwtPlotZoomer(canvas)
 {
     m_parent = parent;
     setTrackerMode(AlwaysOn);
 }