Esempio n. 1
0
Plot::Plot( QWidget *parent ):
    QwtPlot( parent )
{
    setAutoFillBackground( true );
    setPalette( Qt::darkGray );
    setCanvasBackground( Qt::white );

    plotLayout()->setAlignCanvasToScales( true );

    initAxis( QwtAxis::yLeft, "Local Time", Qt::LocalTime );
    initAxis( QwtAxis::yRight, 
        "Coordinated Universal Time ( UTC )", Qt::UTC );

    QwtPlotPanner *panner = new QwtPlotPanner( canvas() );
    QwtPlotMagnifier *magnifier = new QwtPlotMagnifier( canvas() );

    for ( int axis = 0; axis < QwtAxis::PosCount; axis++ )
    {
        const bool on = QwtAxis::isYAxis( axis );

        setAxisVisible( axis, on );
        panner->setAxisEnabled( axis, on );
        magnifier->setAxisEnabled( axis, on );
    }

    QwtPlotGrid *grid = new QwtPlotGrid();
    grid->setMajorPen( Qt::black, 0, Qt::SolidLine );
    grid->setMinorPen( Qt::gray, 0 , Qt::SolidLine );
    grid->enableX( false );
    grid->enableXMin( false );
    grid->enableY( true );
    grid->enableYMin( true );

    grid->attach( this );
}
Esempio n. 2
0
void initCartesian ( ) {
    static bool uninitialized = true;
    if (uninitialized) {
        initAxis();
        initGrid();
    }
    else {
        initGrid();
        initAxis();
    }
    uninitialized = not uninitialized;
}
Esempio n. 3
0
  void PlotBundle::drawOnCurrentPad(const PlotStyle &plot_style) {
    if (gPad) {
      initAxis(plot_style);

      bool something_was_drawn = drawHistsAndGraphs(plot_style);

      // if nothing was drawn just skip the decoration part
      if (something_was_drawn) {
        drawPlotAccessories();
      }
      plot_axis.redrawAxis();
    }
  }
Esempio n. 4
0
/*-<==>-----------------------------------------------------------------
/ Save the new camera position and target point
/---------------------------------------------------------------------*/
void CCamera::setView(const VECTOR &src_point, const VECTOR &dst_point) {
	loc = src_point;
	target = dst_point;
	initAxis();
}