示例#1
0
void SaxsviewImage::setAspectRatioFixed(bool yes) {
  p->rescaler->setEnabled(yes);
  if (yes)
    p->rescaler->rescale();
  else
    setZoomBase(p->frame->boundingRect());
}
void QwtPlotZoomer::setAxis( int xAxis, int yAxis )
{
    if ( xAxis != QwtPlotPicker::xAxis() || yAxis != QwtPlotPicker::yAxis() )
    {
        QwtPlotPicker::setAxis( xAxis, yAxis );
        setZoomBase( scaleRect() );
    }
}
示例#3
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());
}
//! 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() );
}
示例#5
0
void SaxsviewImage::setFrame(SaxsviewFrame *frame) {
  if (p->frame)
    p->frame->detach();

  p->frame = frame;
  frame->attach(this);

  if (frame->data()) {
    const QwtInterval range = p->frame->data()->interval(Qt::ZAxis);
    axisWidget(QwtPlot::yRight)->setColorBarInterval(range);
    setAxisScale(QwtPlot::yRight, range.minValue(), range.maxValue());
  }

  setZoomBase(p->frame->boundingRect());

  replot();
}
示例#6
0
void PlotZoomer::zoomToFit(bool replot)
{
  if (zoomRectIndex() <= 0)
  {
    // Force zoom signal for synchronisation.
    zoom(0);
    emit zoomed(zoomRect());
  }
  else
  {
    zoom(0);
  }
  if (QwtPlot *plotter = plot())
  {
    plotter->setAxisAutoScale(AxisX);
    plotter->setAxisAutoScale(AxisY);
    plotter->updateAxes();
  }
  setZoomBase(replot);
}
示例#7
0
文件: Graph.cpp 项目: rrnntt/plugins
Graph::Graph():
m_needSquareCorrection(false)
{
  setTitle("");
  setAxisTitle(QtAPI::Plot::xBottom,"");
  setAxisTitle(QtAPI::Plot::yLeft,"");
  enableAxis(QtAPI::Plot::xTop);
  enableAxis(QtAPI::Plot::yRight);
  setZoomBase();

  setRescaler(new QtAPI::ConstSizeRescaler(this));
  setXAxisScale(-10,10,false);
  setYAxisScale(-10,10,false);

  correctToSquare();

  auto circle = new GraphCircle;
  circle->attach(this);

}
示例#8
0
void Plot::setZoomStack()
{
    const QRectF rect(QPointF(xBase.x(), yBase.x()), QPointF(xBase.y(), yBase.y()));
    setZoomBase();
    canvas->setZoomStack(rect);
}