casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FitWidget.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modify it
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 #ifndef FITWIDGET_QO_H
26 #define FITWIDGET_QO_H
27 
28 #include <QWidget>
29 #include <QTextStream>
30 #include <guitools/Histogram/FitWidget.ui.h>
31 #include <casa/Arrays/Vector.h>
32 
33 namespace casa {
34 
35 class Fitter;
36 class FitterGaussian;
37 class FitterPoisson;
38 
44 class FitWidget : public QWidget {
45  Q_OBJECT
46 
47 public:
48  FitWidget(QWidget *parent = 0);
49  void setCenterPeak( double center, double peak );
50  void setFWHM( double fwhm );
51  void setLambda( double lambda );
52  void setUnits( const QString& units );
53  void setValues( int id, casacore::Vector<float> xValues, casacore::Vector<float> yValues );
54  double getCenter() const;
55  double getPeak() const;
56  double getFWHM() const;
57  double getLambda() const;
60  bool isGaussian() const;
61  void toAscii( QTextStream& out) const;
62  void restrictDomain( double xMin, double xMax );
63  void clearDomainLimits();
64  ~FitWidget();
65 
66 signals:
67  void fitModeChanged();
68  void dataFitted(const QString& msg);
69  void gaussianFitChanged();
70  void poissonFitChanged();
71  void fitCleared();
72 
73 public slots:
74  void clearFit();
75 
76 private slots:
77  void centerEdited( const QString& centerText );
78  void peakEdited( const QString& peakText );
79  void fwhmEdited( const QString& fwhmText );
80  void lambdaEdited( const QString& lambdaText );
81  void fitSelected( int index );
82  void doFit();
83 
84 private:
85  FitWidget( const FitWidget& );
86  FitWidget& operator=( const FitWidget& );
87  void setSolutionVisible( bool visible );
88  void resetFWHM( double newCenter );
93  Ui::FitWidgetClass ui;
94  int fitId;
95 };
96 }
97 #endif // FITWIDGET_QO_H
void setSolutionVisible(bool visible)
void fitSelected(int index)
void peakEdited(const QString &peakText)
void resetFWHM(double newCenter)
void setUnits(const QString &units)
void setValues(int id, casacore::Vector< float > xValues, casacore::Vector< float > yValues)
void setFWHM(double fwhm)
void fitModeChanged()
FitterPoisson * fitterPoisson
Definition: FitWidget.qo.h:92
casacore::Vector< float > getFitValuesX() const
void clearDomainLimits()
void setCenterPeak(double center, double peak)
double getFWHM() const
void poissonFitChanged()
Main class for handling the pluggable fit functionality for the histogram.
Definition: FitWidget.qo.h:44
void lambdaEdited(const QString &lambdaText)
FitterGaussian * fitterGaussian
Definition: FitWidget.qo.h:91
void dataFitted(const QString &msg)
bool isGaussian() const
void gaussianFitChanged()
Ui::FitWidgetClass ui
Definition: FitWidget.qo.h:93
void restrictDomain(double xMin, double xMax)
void centerEdited(const QString &centerText)
double getCenter() const
void setLambda(double lambda)
Base class for classes performing histogram fits.
Definition: Fitter.h:38
Fitter * fitter
Definition: FitWidget.qo.h:90
double getPeak() const
FitWidget(QWidget *parent=0)
Fits casacore::Poisson curves to the histogram.
Definition: FitterPoisson.h:36
casacore::Vector< float > getFitValues() const
double getLambda() const
void fwhmEdited(const QString &fwhmText)
Manages Gaussian initial guesses and fits Gaussian curves to the histogram.
void toAscii(QTextStream &out) const
FitWidget & operator=(const FitWidget &)