FindSourcesDialog.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 
00026 #ifndef FIND_SOURCES_DIALOG_QO_H
00027 #define FIND_SOURCES_DIALOG_QO_H
00028 
00029 #include <QtGui/QDialog>
00030 #include <QMap>
00031 #include <casa/Containers/Record.h>
00032 #include <display/Fit/FindSourcesDialog.ui.h>
00033 #include <display/Fit/ComponentListWrapper.h>
00034 #include <display/Fit/PixelRangeDialog.qo.h>
00035 #include <display/region/QtRegionSource.qo.h>
00036 
00037 class QFileSystemModel;
00038 
00039 namespace casa {
00040 
00041         class SkyCatOverlayDD;
00042         class RegionBox;
00043         class ColorComboDelegate;
00044 
00050         class FindSourcesDialog : public QDialog {
00051                 Q_OBJECT
00052 
00053         public:
00054                 FindSourcesDialog(QWidget *parent = 0, bool displayModeFunctionality = true);
00055                 void setImage( SHARED_PTR<const ImageInterface<Float> > image );
00056                 void setChannel( int channel );
00057 
00058                 void clearImage();
00059 
00060                 QString getRegionString() const;
00061                 String getPixelBox() const;
00062                 QString getImagePixelBox() const;
00063                 String getScreenedEstimatesFile( const String& estimatesFileName,
00064                                                  bool* errorWritingFile );
00065                 const static QStringList colorNames;
00066                 ~FindSourcesDialog();
00067 
00068         signals:
00069                 void showOverlay(String, const QString& );
00070                 void removeOverlay(String path );
00071                 void estimateFileSpecified( const QString& fullPath );
00072 
00073         public slots:
00074                 void setImageMode( bool imageMode );
00075                 bool newRegion( int id, const QString & shape, const QString &name,
00076                                 const QList<double> & world_x, const QList<double> & world_y,
00077                                 const QList<int> &pixel_x, const QList<int> &pixel_y,
00078                                 const QString & linecolor, const QString & text, const QString & font,
00079                                 int fontsize, int fontstyle );
00080                 bool updateRegion( int id, viewer::region::RegionChanges changes,
00081                                    const QList<double> & world_x, const QList<double> & world_y,
00082                                    const QList<int> &pixel_x, const QList<int> &pixel_y );
00083                 void setOverlayColor(const QString& colorName);
00084 
00085         private slots:
00086                 void findSources();
00087                 void deleteSelectedSource();
00088                 void canceledFindSources();
00089                 void saveEstimateFile();
00090                 void directoryChanged(const QModelIndex& modelIndex );
00091                 void validateDirectory( const QString& str );
00092                 void cutoffModeChanged( bool noise );
00093                 void showPixelRange();
00094                 void pixelRangeChanged();
00095                 void viewerDisplayChanged();
00096 
00097         private:
00098                 FindSourcesDialog( const FindSourcesDialog& other );
00099                 FindSourcesDialog& operator=( const FindSourcesDialog& other );
00100                 void populatePixelBox();
00101                 //Written because when a fit of a residual image was being done, the region
00102                 //bounds were larger than the bounds in the residual image.
00103                 void populateImageBounds();
00104 
00105                 void resetCurrentId( int suggestedId );
00106                 void resetSourceView();
00107                 void setSourceResultsVisible( bool visible );
00108                 void createTable();
00109                 void initializeFileManagement();
00110                 void setTableValue(int row, int col, const String& val );
00111                 double populateCutOff(bool* valid) const;
00112                 Record makeRegion( bool * valid );
00113                 void resetSkyOverlay();
00114                 void clearSkyOverlay();
00115                 void clearRegions();
00116                 bool writeEstimateFile( QString& filePath,
00117                                         bool screenEstimates = false, RegionBox* screeningBox = NULL );
00118                 QString getRemoveOverlayPath() const;
00119 
00120                 ComponentListWrapper skyList;
00121                 enum SourceColumns { ID_COL, RA_COL, DEC_COL, FLUX_COL,
00122                                      MAJOR_AXIS_COL, MINOR_AXIS_COL, ANGLE_COL/*, FIXED_COL*/
00123                                    };
00124         SHARED_PTR<const ImageInterface<Float> > image;
00125                 String pixelBox;
00126                 QString skyPath;
00127                 QString overlayColorName;
00128                 bool imageMode;
00129                 int channel;
00130                 int resultIndex;
00131                 int currentRegionId;
00132                 QFileSystemModel* fileModel;
00133                 QMap< int, RegionBox*> regions;
00134                 const int DEFAULT_KEY;
00135                 const QString SKY_CATALOG;
00136                 ColorComboDelegate* colorDelegate;
00137                 PixelRangeDialog pixelRangeDialog;
00138                 Vector<int> blcVector;
00139                 Vector<int> trcVector;
00140                 Ui::FindSourcesDialogClass ui;
00141         };
00142 }
00143 #endif // FIND_SOURCES_DIALOG_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