All the ranges of the axes work properly without zooming in and out each time

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@11 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-06-19 15:01:40 +00:00
parent 8246154032
commit 69e6500522
22 changed files with 521 additions and 412 deletions

View File

@ -2,7 +2,13 @@
/**
* @author Ian Johnson
* @version 1.0
*/
* Modifications:
* 19.06.2012: {Some functions have been added by Dhanya to enable zooming in and out
* without using mouse control:
* DisableZoom,
* SetXMinMax,SetYMinMax,
* GetXMinimum,GetXMaximum,GetYMinimum,GetYMaximum}
* */
#ifndef SLSQT1DPLOT_H
#define SLSQT1DPLOT_H
@ -12,6 +18,8 @@
#include <qwt_plot_marker.h>
#include <qwt_scale_div.h>
#include "SlsQt1DZoomer.h"
#include <iostream>
using namespace std;
class QPen;
class SlsQt1DPlot;
@ -104,14 +112,18 @@ class SlsQt1DPlot:public QwtPlot{
void InsertVLine(double v);
void RemoveVLine();
void DisableZoom(bool disableZoom);
void SetXAxisScale(double min,double max){setAxisScale(QwtPlot::xBottom,min,max);};
void SetYAxisScale(double min,double max){setAxisScale(QwtPlot::yLeft,min,max);};
double GetXAxisLowerBound(){return axisScaleDiv(QwtPlot::xBottom)->lowerBound();};
double GetXAxisUpperBound(){return axisScaleDiv(QwtPlot::xBottom)->upperBound();};
double GetYAxisLowerBound(){return axisScaleDiv(QwtPlot::yLeft)->lowerBound();};
double GetYAxisUpperBound(){return axisScaleDiv(QwtPlot::yLeft)->upperBound(); };
/** This group of functions have been added by Dhanya on 19.06.2012 to be able to
use zooming functionality without mouse control*/
void DisableZoom(bool disableZoom);
void SetXMinMax(double min,double max){setAxisScale(QwtPlot::xBottom,min,max);};
void SetYMinMax(double min,double max){setAxisScale(QwtPlot::yLeft,min,max);};
double GetXMinimum(){return hist_list->Hist()->GetXMin();};
double GetXMaximum(){return hist_list->Hist()->GetXMax();};
double GetYMinimum(){return hist_list->Hist()->GetYMin();};
double GetYMaximum(){return hist_list->Hist()->GetYMax();};
/**---*/
void SetZoom(double xmin,double ymin,double x_width,double y_width);
void SetZoomBase(double xmin,double ymin,double x_width, double y_width){ zoomer->SetZoomBase(xmin,ymin,x_width,y_width);}

View File

@ -2,6 +2,12 @@
/**
* @author Ian Johnson
* @version 1.0
* Modifications:
* 19.06.2012: {Some functions have been added by Dhanya to enable zooming in and out
* without using mouse control:
* DisableZoom,
* SetXMinMax,SetYMinMax,
* GetXMinimum,GetXMaximum,GetYMinimum,GetYMaximum}
*/
@ -43,10 +49,22 @@ public:
SlsQt2DPlot(QWidget * = NULL);
// SlsQt2DHist *GetHistogram(){ return hist; }
void UnZoom();
void SetZoom(double xmin,double ymin,double x_width,double y_width);
/** This group of functions have been added by Dhanya on 19.06.2012 to be able to
use zooming functionality without mouse control*/
void DisableZoom(bool disableZoom);
void SetXMinMax(double min,double max){setAxisScale(QwtPlot::xBottom,min,max);};
void SetYMinMax(double min,double max){setAxisScale(QwtPlot::yLeft,min,max);};
double GetXMinimum(){return hist->GetXMin();};
double GetXMaximum(){return hist->GetXMax();};
double GetYMinimum(){return hist->GetYMin();};
double GetYMaximum(){return hist->GetYMax();};
/**---*/
double GetZMinimum(){ return hist->GetMinimum();}
double GetZMaximum(){ return hist->GetMaximum();}
void SetZMinMax(double zmin=0,double zmax=-1);

View File

@ -1,6 +1,10 @@
/**
* @author Ian Johnson
* @version 1.0
* @comments
* 19.06.2012 All modifications with the Ian flag has been made since
* z_range_ne and the buttons are defined in another class.
* Logz button and z_range_ne have wrappers to connect them
*/
@ -15,7 +19,7 @@
class QGridLayout;
class QString;
class QToolButton;
class SlsQt2DPlotLayout: public QGroupBox{
@ -26,33 +30,42 @@ public:
SlsQt2DPlotLayout(QWidget * = NULL);
~SlsQt2DPlotLayout();
SlsQt2DPlot* GetPlot() {return the_plot;}
SlsQt2DPlot* GetPlot(){return the_plot;}
void SetXTitle(QString st);
void SetYTitle(QString st);
void SetZTitle(QString st);
void UpdateNKeepSetRangeIfSet();
void UpdateNKeepSetRangeIfSet();
private:
QGridLayout* the_layout;
SlsQt2DPlot* the_plot;
QGridLayout* the_layout;
QToolButton* btnInterpolate;
QToolButton* btnContour;
QToolButton* btnLogz;
SlsQt2DPlot* the_plot;
SlsQtNumberEntry* z_range_ne;
SlsQtNumberEntry* z_range_ne;
bool logsChecked;
#ifndef IAN
bool zRangeChecked;
#endif
void CreateTheButtons();
void ConnectSignalsAndSlots();
void Layout();
public slots:
void SetZScaleToLog(bool yes);
void ResetRange();
void SetTitle(QString st);
#ifndef IAN
void SetZRange(double,double);
void EnableZRange(bool enable);
#endif
signals:
void InterpolateSignal(bool);
void ContourSignal(bool);
};
#endif