Fit2DTool.qo.h

Go to the documentation of this file.
00001 //# Copyright (C) 1994,1995,1996,1997,1998,1999,2000
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
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                 //Update the widgets that depend on knowing the frame.
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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1