887d4441
David Mayerich
updates from STIM...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#include <qwt/qwt_plot.h>
#include <qwt/qwt_plot_curve.h>
#include <vector>
#include <QVector>
#include "globals.h"
class qwtSpectrumDisplay
{
QwtPlot* mainPlot;
QwtPlotCurve* simSpectrum;
public:
qwtSpectrumDisplay()
{
mainPlot = new QwtPlot();
simSpectrum = new QwtPlotCurve("Simulated Spectrum");
//set colors
mainPlot->setCanvasBackground(QBrush(Qt::black));
simSpectrum->setPen(QPen(Qt::white));
//attach curves
simSpectrum->attach(mainPlot);
//display the plot
mainPlot->show();
}
void updateCurves()
{
//create qVectors to store curve values
QVector<double> qNu;
QVector<double> qV;
//update the simulation
for(int i = 0; i < SimSpectrum.size(); i++)
{
qNu.push_back(SimSpectrum[i].nu);
qV.push_back(SimSpectrum[i].A);
}
simSpectrum->setSamples(qNu, qV);
}
void replot()
{
//set the appropriate axis title
mainPlot->setAxisTitle(2, "Wavenumber (cm^-1)");
if(dispSimType == AbsorbanceSpecType)
mainPlot->setAxisTitle(0, "Absorbance (a.u.)");
else if(dispSimType == IntensitySpecType)
mainPlot->setAxisTitle(0, "Intensity (a.u.)");
updateCurves();
mainPlot->replot();
}
};
|