QtExportManager.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
00027
00028 #ifndef QTEXPORTMANAGER_H_
00029 #define QTEXPORTMANAGER_H_
00030
00031
00032
00033
00034 #include <casa/aips.h>
00035 #include <casa/BasicSL/String.h>
00036
00037
00038 #include <graphics/X11/X_enter.h>
00039 #include <QDir>
00040 #include <QColor>
00041 #include <QHash>
00042 #include <QWidget>
00043
00044
00045
00046 #include <display/QtViewer/QtExportManager.ui.h>
00047
00048 #include <graphics/X11/X_exit.h>
00049
00050
00051 namespace casa {
00052
00053 class QtDisplayPanelGui;
00054 class QtDisplayPanel;
00055 class QtDisplayData;
00056 template <class T> class ImageInterface;
00057
00058 class QtExportManager : public QWidget, private Ui::QtExportManager {
00059
00060 Q_OBJECT
00061
00062 public:
00063
00064 QtExportManager(QtDisplayPanelGui* panel=0, const char* name=0,
00065 QWidget* parent=0 );
00066 ~QtExportManager();
00067
00068 public slots:
00069 void updateEM(QtDisplayData* qdd=0, Bool autoRegister=True);
00070
00071 protected:
00072 void fillFormatBox(int type);
00073 QColor getDirColor(int);
00074 QString getOutFileName(QString &filter);
00075 QString getOutDirName(QString &);
00076 QString getOutDirNameOLD(QString &filter);
00077
00078 enum DATATYPE { UNKNOWN, IMAGE, MEASUREMENT_SET, SKY_CATALOG, RESTORE,
00079 DIRECTORY, QUALIMG, CASAREGION, DS9REGION
00080 };
00081 enum DISPLAYTYPE { RASTER, CONTOUR, VECTOR, MARKER, SKY_CAT,
00082 NEWPANEL, OLDPANEL
00083 };
00084
00085 QHash<int, String> dataType_;
00086 QHash<QString, int> uiDataType_;
00087 QHash<int, String> displayType_;
00088 QHash<QString, int> uiDisplayType_;
00089 QHash<int, QtDisplayData*> qddList_;
00090 QVector<int> exportTypes_;
00091
00092 protected slots:
00093 void changeItemSelection();
00094 void exportData();
00095 void buildFileList();
00096 void browseOutFilePath();
00097 void browseFileSelection();
00098 void browseFileSelectionOLD();
00099
00100 void showDDCreateError_(String);
00101
00102
00103 private:
00104 void expImageInterfaceToFITS(ImageInterface<Float>* img, String outFile);
00105 void getSectralCoordFlags(const ImageInterface<Float>* img, Bool &preferVelocity, Bool &opticalVelocity,
00106 Bool &preferWavelength, Bool &preferAirWavelength);
00107 void expImageInterfaceToCASA(ImageInterface<Float>* img, String outFile);
00108
00109 void messageFromEM(QString &msg);
00110
00111 QWidget *parent_;
00112 QtDisplayPanelGui* panel_;
00113 QDir dir_;
00114 QTreeWidgetItem *selItem_;
00115 int saveType_;
00116 };
00117
00118
00119
00120 }
00121
00122 #endif