QtExportManager.qo.h

Go to the documentation of this file.
00001 //# QtDataManager.qo.h: Qt implementation of viewer data manager widget.
00002 //# Copyright (C) 2005
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 
00028 #ifndef QTEXPORTMANAGER_H_
00029 #define QTEXPORTMANAGER_H_
00030 // (Trailing underscore is not a typo -- do not remove it;
00031 // QtDataManager.ui.h uses the QTDATAMANAGER_H symbol).
00032 
00033 
00034 #include <casa/aips.h>
00035 #include <casa/BasicSL/String.h>
00036 //#include <display/QtViewer/QtLELEdit.qo.h>
00037 
00038 #include <graphics/X11/X_enter.h>
00039 #include <QDir>
00040 #include <QColor>
00041 #include <QHash>
00042 #include <QWidget>
00043 //#dk Be careful to put *.ui.h within X_enter/exit bracket too,
00044 //#   because they'll have Qt includes.
00045 //#   E.g. <QApplication> needs the X11 definition of 'Display'
00046 #include <display/QtViewer/QtExportManager.ui.h>
00047 //#include <display/QtViewer/QtDataMgrMsSelect.ui.h>
00048 #include <graphics/X11/X_exit.h>
00049 
00050 
00051 namespace casa { //# NAMESPACE CASA - BEGIN
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                 //void expImageInterfaceToMIRIAD(ImageInterface<Float>* img, String outFile);
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 } //# NAMESPACE CASA - END
00121 
00122 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1