Fit2DTool.qo.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef FIT2DTOOL_QO_H
00026 #define FIT2DTOOL_QO_H
00027
00028 #include <QtGui/QDialog>
00029 #include <QProgressDialog>
00030 #include <QFileDialog>
00031 #include <casa/aipstype.h>
00032 #include <display/Fit/Fit2DTool.ui.h>
00033 #include <display/Fit/FindSourcesDialog.qo.h>
00034 #include <display/Fit/PixelRangeDialog.qo.h>
00035 #include <display/Fit/ResidualHistogramDialog.qo.h>
00036 #include <display/Fit/Fit2DLogDialog.qo.h>
00037 #include <display/region/QtRegionSource.qo.h>
00038
00039 namespace casa {
00040
00041 template <class T> class ImageInterface;
00042 class Gaussian2DFitter;
00043 class ColorComboDelegate;
00044 class RegionShape;
00045
00046 class Fit2DTool : public QDialog {
00047 Q_OBJECT
00048
00049 public:
00050 Fit2DTool(QWidget *parent = 0);
00051 void setImage( SHARED_PTR<const ImageInterface<Float> > image);
00052 bool setImageRegion( ImageRegion* imageRegion, int id );
00053 void deleteImageRegion( int id );
00054 void imageRegionSelected( int id );
00055 ~Fit2DTool();
00056
00057 signals:
00058 void showOverlay(String, const QString&);
00059 void removeOverlay(String);
00060 void remove2DFitOverlay( QList<RegionShape*> fitMarkers );
00061 void add2DFitOverlay( QList<RegionShape*> fitMarkers );
00062 void addResidualFitImage( String );
00063
00064 public slots:
00065 void frameChanged( int frame );
00066 void newRegion( int, const QString &shape, const QString &name,
00067 const QList<double> &world_x, const QList<double> &world_y,
00068 const QList<int> &pixel_x, const QList<int> &pixel_y,
00069 const QString &linecolor, const QString &text, const QString &font, int fontsize, int fontstyle );
00070 void updateRegion( int, viewer::region::RegionChanges,
00071 const QList<double> &world_x, const QList<double> &world_y,
00072 const QList<int> &pixel_x, const QList<int> &pixel_y );
00073
00074 private slots:
00075 void showFileDialog();
00076 void showFindSourcesDialog();
00077 void showPixelRangeDialog();
00078 void estimateFileChanged( const QString& fullPath );
00079 void pixelRangeChanged();
00080 void pixelRangeEnabledChanged( bool enabled );
00081 void pixelRangeNoneSelected( bool selected );
00082 void doFit();
00083 void fitColorChanged( const QString& colorName);
00084 void fitDone();
00085 void clearFitMarkers();
00086 void showResults();
00087 void showSaveDialog();
00088 void showResidualHistogramDialog();
00089 void residualSupportChanged( bool enable );
00090 void showResidualDialog();
00091 void displayFitChanged( bool display );
00092 void imageModeChanged( bool imageEnabled );
00093
00094 private:
00095 Fit2DTool( const Fit2DTool& fitTool );
00096 Fit2DTool operator=( const Fit2DTool& fitTool );
00097 Vector<Float> populateInclude() const;
00098 Vector<Float> populateExclude() const;
00099 void populateIncludeExclude(Vector<Float>& range ) const;
00100
00101 void setImageFunctionalityEnabled( bool enable );
00102 void resetRegion( const QList<int>& pixelX, const QList<int>& pixelY );
00103 bool populateSaveFile( String& saveFile );
00104 bool populateResidualFile( String& saveFile );
00105 void showFileChooserDialog(const QString& title, QFileDialog::FileMode mode, QLineEdit* destinationLineEdit );
00106 bool validateFile( QLineEdit* directoryLineEdit, QLineEdit* fileLineEdit,
00107 String& saveFile, const QString& purpose );
00108 void addViewerFitMarkers();
00109 void removeViewerFitMarkers();
00110 void clearRegions();
00111
00112
00113 void updateFrame();
00114
00115 const QString REGION_LABEL;
00116 SHARED_PTR<const ImageInterface<Float> > image;
00117 QList<RegionShape*> fitMarkers;
00118 Gaussian2DFitter* fitter;
00119 ColorComboDelegate* fitColorDelegate;
00120 QProgressDialog progressBar;
00121 FindSourcesDialog findSourcesDialog;
00122 PixelRangeDialog pixelRangeDialog;
00123 Fit2DLogDialog logDialog;
00124 ResidualHistogramDialog residualHistogramDialog;
00125 String residualImagePath;
00126
00127 Ui::Fit2DToolClass ui;
00128 };
00129 }
00130 #endif // FIT2DTOOL_QO_H