Changeset 11740 for trunk


Ignore:
Timestamp:
08/02/11 15:43:03 (13 years ago)
Author:
lyard
Message:
improved zooming and bug fix of raw events viewer
Location:
trunk/FACT++/gui/RawEventsViewer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc

    r11723 r11740  
    2020#include <QtGui/QFileDialog>
    2121
    22 #include <qwt_plot_grid.h>
    23 #include <qwt_symbol.h>
     22#include <qwt-qt4/qwt_plot_grid.h>
     23#include <qwt-qt4/qwt_symbol.h>
    2424
    2525#include "src/Configuration.h"
     
    10221022    if (whichSlice >= nRoi)
    10231023    {
     1024        whichSlice = 0;
    10241025        if (!loopCurrentEvent)
    10251026        {
     
    10291030            eventStep = backupStep;
    10301031        }
    1031         whichSlice=0;
    10321032    }
    10331033    emit signalCurrentSlice(whichSlice);
     
    10391039    if (whichSlice < 0)
    10401040    {
     1041        whichSlice = nRoi-1;
    10411042        if (!loopCurrentEvent)
    10421043        {
     
    10461047            eventStep = backupStep;
    10471048        }
    1048         whichSlice = nRoi-1;
    10491049    }
    10501050    emit signalCurrentSlice(whichSlice);
     
    16411641//    startCellHistoZoom->setZoomBase(startCellHistoItem.boundingRect());
    16421642    QStack< QRectF > stack;
    1643     stack.push(boardsTimeHistoItem.boundingRect());
     1643//    QRectF cRectangle = boardsTimeHistoItem.boundingRect();
     1644    stack.push(scaleBoundingRectangle(boardsTimeHistoItem.boundingRect(), 1.05f));//cRectangle);//boardsTimeHistoItem.boundingRect());
    16441645    boardsTimeHistoZoom->setZoomStack(stack);
    16451646    stack.pop();
    1646     stack.push(startCellHistoItem.boundingRect());
     1647    stack.push(scaleBoundingRectangle(startCellHistoItem.boundingRect(), 1.05f));
    16471648    startCellHistoZoom->setZoomStack(stack);
    16481649    stack.pop();
    1649     stack.push(startTimeMarkHistoItem.boundingRect());
     1650    stack.push(scaleBoundingRectangle(startTimeMarkHistoItem.boundingRect(), 1.05f));
    16501651    startTimeMarkHistoZoom->setZoomStack(stack);
    16511652    stack.pop();
    1652     stack.push(triggerDelayHistoItem.boundingRect());
     1653    stack.push(scaleBoundingRectangle(triggerDelayHistoItem.boundingRect(), 1.05f));
    16531654    triggerDelayHistoZoom->setZoomStack(stack);
    16541655    stack.pop();
    16551656    pixelChanged(viewer->selectedPixel);
    1656 
    1657 
    1658 
    1659 }
    1660 
     1657}
     1658//can't use a ref to rectangle, as the type must be converted first
     1659QRectF UIConnector::scaleBoundingRectangle(QRectF rectangle, float scale)
     1660{
     1661    QPointF bottomRight = rectangle.bottomRight();
     1662    QPointF topLeft = rectangle.topLeft();
     1663    QPointF center = rectangle.center();
     1664    return QRectF(topLeft + (topLeft-center)*(scale-1.0f), //top left
     1665                  bottomRight + (bottomRight-center)*(scale-1.0f)); //bottom right
     1666}
    16611667void UIConnector::initHistograms()
    16621668{
     
    17761782    }
    17771783#if QWT_VERSION < 0x060000
    1778        pixelValueCurveItem.setRawData(xval, yval, viewer->nRoi);
     1784       pixelValueCurveItem.setData(xval, yval, viewer->nRoi);
    17791785#else
    1780        pixelValueCurveItem.setRawSamples(xval, yval, viewer->nRoi);
     1786       pixelValueCurveItem.setSamples(xval, yval, viewer->nRoi);
    17811787#endif
    17821788
    17831789    QStack< QRectF > stack;
    1784     stack.push(pixelValueCurveItem.boundingRect());
     1790    stack.push(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1.05f));
    17851791    curveZoom->setZoomStack(stack);
    17861792    stack.pop();
     
    19691975        ("color.range", vars<double>(), "Range of the display colours")
    19701976        ("color.red", vars<double>(), "Range of red values")
    1971         ("color.rreen", vars<double>(), "Range of green values")
     1977        ("color.green", vars<double>(), "Range of green values")
    19721978        ("color.blue", vars<double>(), "Range of blue values")
    19731979        ("file,f", var<string>(), "File to be loaded at startup")
  • trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h

    r11704 r11740  
    3030#include <GL/gl.h>
    3131
    32 #include "qwt_plot.h"
     32#include <qwt-qt4/qwt_plot.h>
    3333//#include "qwt_plot_histogram.h"
    34 #include "qwt_plot_curve.h"
    35 
    36 #include <qwt_plot_zoomer.h>
     34#include <qwt-qt4/qwt_plot_curve.h>
     35
     36#include <qwt-qt4/qwt_plot_zoomer.h>
    3737
    3838
     
    253253    int swID;
    254254    bool rescaleWholeCamera;
     255    QRectF scaleBoundingRectangle(QRectF rectangle, float scale);
    255256public:
    256257    QListWidget *boardsTimeList;
  • trunk/FACT++/gui/RawEventsViewer/viewer.ui

    r11697 r11740  
    857857   <class>QwtPlot</class>
    858858   <extends>QFrame</extends>
    859    <header>qwt_plot.h</header>
     859   <header>qwt-qt4/qwt_plot.h</header>
    860860   <container>1</container>
    861861  </customwidget>
Note: See TracChangeset for help on using the changeset viewer.