FindSourcesDialog.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
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
00102
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
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