37 int mode =
m_Window -> currentGraphMode();
39 int nRows = data->get_Height();
40 int nCols = data->get_Width();
42 double hStart = data->get_HStart();
43 double hStep = data->get_HStep();
45 double vStart = data->get_VStart();
46 double vStep = data->get_VStep();
49 m_Window -> m_ImagePlot -> setAxisTitle(QwtPlot::xBottom, tr(
"%1 (%2)")
50 .arg(data->get_HLabel()).arg(data->get_HUnits()));
51 m_Window -> m_ImagePlot -> setAxisTitle(QwtPlot::yLeft,
"Intensity");
53 int start =
m_Window->get_SliceHStart();
54 int summed =
m_Window->get_SliceHSummed();
55 int skipped =
m_Window->get_SliceHSkipped();
56 int repeats =
m_Window->get_SliceHRepeats();
58 if (summed < 1) summed = 1;
59 if (skipped < 0) skipped = 0;
60 if (repeats < 1) repeats = 1;
62 for (
int rpt = 0; rpt<repeats; rpt++) {
63 int st = start+rpt*(summed+skipped);
68 for (
int col=0; col<nCols; col++) {
72 for (
int sum=0; sum<summed; sum++) {
73 int row=start+rpt*(summed+skipped)+sum;
85 x.append(hStart+col*hStep);
90 int st = start+rpt*(summed+skipped);
97 QwtPlotCurve *curve = NULL;
101 .arg(data->get_VLabel())
102 .arg(vStart+st*vStep)
103 .arg(data->get_VUnits()));
106 .arg(data->get_VLabel())
107 .arg(vStart+st*vStep).arg(vStart+en*vStep)
108 .arg(data->get_VUnits()));
111 curve->setSamples(x, y);
113 m_Window->m_ImagePlot->setPlotCurveStyle(curveNumber++, curve);
120 m_Window -> m_ImagePlot -> setAxisTitle(QwtPlot::xBottom, tr(
"%1 (%2)")
121 .arg(data->get_VLabel()).arg(data->get_VUnits()));
122 m_Window -> m_ImagePlot -> setAxisTitle(QwtPlot::yLeft,
"Intensity");
124 int start =
m_Window->get_SliceVStart();
125 int summed =
m_Window->get_SliceVSummed();
126 int skipped =
m_Window->get_SliceVSkipped();
127 int repeats =
m_Window->get_SliceVRepeats();
129 if (summed < 1) summed = 1;
130 if (skipped < 0) skipped = 0;
131 if (repeats < 1) repeats = 1;
133 for (
int rpt = 0; rpt<repeats; rpt++) {
134 int st = start+rpt*(summed+skipped);
139 for (
int row=0; row<nRows; row++) {
143 for (
int sum=0; sum<summed; sum++) {
144 int col=start+rpt*(summed+skipped)+sum;
156 x.append(vStart+row*vStep);
161 int st = start+rpt*(summed+skipped);
162 int en = st+summed-1;
172 .arg(data->get_HLabel())
173 .arg(hStart+st*hStep)
174 .arg(data->get_HUnits()));
177 .arg(data->get_HLabel())
178 .arg(hStart+st*hStep).arg(hStart+en*hStep)
179 .arg(data->get_HUnits()));
182 curve->setSamples(x, y);
184 m_Window->m_ImagePlot->setPlotCurveStyle(curveNumber++, curve);
193 m_Window -> m_ImagePlot -> replot();
virtual ~QcepImageSliceGraphController()
QcepImageSliceGraphController(QcepDataObjectGraphWindow *window, int mode, QcepDataObjectWPtr object)
void appendCurve(QwtPlotCurve *curve)
QcepDataObjectGraphWindow * m_Window
virtual double getImageData(int x, int y) const =0
A class which draws piecewise curves.
QWeakPointer< QcepDataObject > QcepDataObjectWPtr
virtual void updateDisplay()
virtual void updateDisplay()
QcepDataObjectWPtr m_Object