~ubuntu-branches/ubuntu/utopic/scidavis/utopic-proposed

« back to all changes in this revision

Viewing changes to .pc/make-public-in-MultiPeakFit.diff/scidavis/src/MultiPeakFit.h

  • Committer: Package Import Robot
  • Author(s): Georges Khaznadar
  • Date: 2013-11-01 14:45:26 UTC
  • Revision ID: package-import@ubuntu.com-20131101144526-tia15q4m1fjk9u5y
Tags: 0.2.4-4
* New maintainer (Closes: #700414)
* updated Standards-Version to 3.9.4
* removed files from the install target : CHANGES and gpl.txt
* changed the way used to put plugin libraries into a directory; they are
  no longer under /usr/lib64, but under /usr/lib/${DEB_HOST_MULTIARCH}.
  Closes: #701973; Closes:  #701983.
* added a dependency on ${python:Depends}
* enabled hardening-wrapper (build dependency, and variable in debian/rules)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    File                 : MultiPeakFit.h
 
3
    Project              : SciDAVis
 
4
    --------------------------------------------------------------------
 
5
    Copyright            : (C) 2006 by Ion Vasilief, Tilman Benkert
 
6
    Email (use @ for *)  : ion_vasilief*yahoo.fr, thzs*gmx.net
 
7
    Description          : MultiPeakFit module with Lorentz and Gauss peak shapes
 
8
                           
 
9
 ***************************************************************************/
 
10
 
 
11
/***************************************************************************
 
12
 *                                                                         *
 
13
 *  This program is free software; you can redistribute it and/or modify   *
 
14
 *  it under the terms of the GNU General Public License as published by   *
 
15
 *  the Free Software Foundation; either version 2 of the License, or      *
 
16
 *  (at your option) any later version.                                    *
 
17
 *                                                                         *
 
18
 *  This program is distributed in the hope that it will be useful,        *
 
19
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 
20
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 
21
 *  GNU General Public License for more details.                           *
 
22
 *                                                                         *
 
23
 *   You should have received a copy of the GNU General Public License     *
 
24
 *   along with this program; if not, write to the Free Software           *
 
25
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
 
26
 *   Boston, MA  02110-1301  USA                                           *
 
27
 *                                                                         *
 
28
 ***************************************************************************/
 
29
#ifndef MULTIPEAKFIT_H
 
30
#define MULTIPEAKFIT_H
 
31
 
 
32
#include "Fit.h"
 
33
 
 
34
class MultiPeakFit : public Fit
 
35
{
 
36
        Q_OBJECT
 
37
 
 
38
        public:         
 
39
                enum PeakProfile{Gauss, Lorentz};
 
40
                MultiPeakFit(ApplicationWindow *parent, Graph *g = 0, PeakProfile profile = Gauss, int peaks = 1);
 
41
 
 
42
                int peaks(){return d_peaks;};
 
43
                void setNumPeaks(int n);
 
44
 
 
45
                void enablePeakCurves(bool on){generate_peak_curves = on;};
 
46
                void setPeakCurvesColor(int colorIndex){d_peaks_color = colorIndex;};
 
47
 
 
48
                static QString generateFormula(int order, PeakProfile profile);
 
49
                static QStringList generateParameterList(int order);
 
50
                static QStringList generateExplanationList(int order);
 
51
 
 
52
        private:
 
53
                QString logFitInfo(double *par, int iterations, int status, const QString& plotName);
 
54
                void generateFitCurve(double *par);
 
55
                static QString peakFormula(int peakIndex, PeakProfile profile);
 
56
                //! Inserts a peak function curve into the plot 
 
57
                void insertPeakFunctionCurve(double *x, double *y, int peak);
 
58
                void storeCustomFitResults(double *par);
 
59
 
 
60
                //! Used by the GaussFit and LorentzFit derived classes to calculate initial values for the parameters 
 
61
                void guessInitialValues();
 
62
 
 
63
                //! Number of peaks
 
64
                int d_peaks;
 
65
 
 
66
                //! Tells weather the peak curves should be displayed together with the best line fit.
 
67
                bool generate_peak_curves;
 
68
 
 
69
                //! Color index for the peak curves
 
70
                int d_peaks_color;
 
71
 
 
72
                //! The peak profile
 
73
                PeakProfile d_profile;
 
74
};
 
75
 
 
76
class LorentzFit : public MultiPeakFit
 
77
{
 
78
        Q_OBJECT
 
79
 
 
80
        public:
 
81
                LorentzFit(ApplicationWindow *parent, Graph *g);
 
82
                LorentzFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle);
 
83
                LorentzFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
 
84
 
 
85
        private:
 
86
                void init();
 
87
};
 
88
 
 
89
class GaussFit : public MultiPeakFit
 
90
{
 
91
        Q_OBJECT
 
92
 
 
93
        public:
 
94
                GaussFit(ApplicationWindow *parent, Graph *g);
 
95
                GaussFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle);
 
96
                GaussFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
 
97
 
 
98
        private:
 
99
                void init();
 
100
};
 
101
 
 
102
class GaussAmpFit : public Fit
 
103
{
 
104
        Q_OBJECT
 
105
 
 
106
        public:
 
107
                GaussAmpFit(ApplicationWindow *parent, Graph *g);
 
108
                GaussAmpFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle);
 
109
                GaussAmpFit(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
 
110
 
 
111
        private:
 
112
                void init();
 
113
                void calculateFitCurveData(double *par, double *X, double *Y);
 
114
};
 
115
#endif