casa
$Rev:20696$
|
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 SLICER_MAINWINDOW_QO_H 00027 #define SLICER_MAINWINDOW_QO_H 00028 00029 #include <QtGui/QMainWindow> 00030 #include <display/Slicer/SlicerMainWindow.ui.h> 00031 #include <display/Slicer/SlicePlot.qo.h> 00032 00033 class QCursor; 00034 00035 namespace casa { 00036 00037 class SliceZoomer; 00038 class SliceColorPreferences; 00039 class SlicePlotPreferences; 00040 class StatisticsRegion; 00041 00042 class SlicerMainWindow : public QMainWindow { 00043 00044 Q_OBJECT 00045 00046 public: 00047 SlicerMainWindow(QWidget *parent = 0); 00048 void updateChannel( int channel ); 00049 void updatePolyLine( int regionId, viewer::region::RegionChanges regionChanges, 00050 const QList<double> & worldX, const QList<double> & worldY, 00051 const QList<int> &pixelX, const QList<int> & pixelY ); 00052 void addPolyLine( int regionId, viewer::region::RegionChanges regionChanges, 00053 const QList<double> & worldX, const QList<double> & worldY, 00054 const QList<int> &pixelX, const QList<int> & pixelY, const QString& colorName ); 00055 void setImage( ImageInterface<float>* img ); 00056 void setRegionSelected( int regionId, bool selected ); 00057 void setCurveColor( int id, const QString& color ); 00058 void updatePositionInformation( int id, const QVector<String>& info ); 00059 ~SlicerMainWindow(); 00060 00061 signals: 00062 void markerPositionChanged(int regionId,int segmentIndex,float percentage); 00063 void markerVisibilityChanged(int regionId,bool showMarker); 00064 00065 private slots: 00066 void clearCurves(); 00067 void autoCountChanged( bool selected ); 00068 void sampleCountChanged(); 00069 void accumulateChanged( bool accumulate ); 00070 void interpolationMethodChanged( const QString& method ); 00071 void showPlotPreferences(); 00072 void resetPlotPreferences(); 00073 void exportSlice(); 00074 void showColorDialog(); 00075 void resetColors(); 00076 void zoomIn(); 00077 void zoomNeutral(); 00078 void zoomOut(); 00079 bool checkZoom(); 00080 void markPositionChanged(int regionId,int segmentIndex,float percentage); 00081 void markVisibilityChanged(int regionId,bool showMarker); 00082 00083 private: 00084 void initializeZooming(); 00085 SlicerMainWindow( const SlicerMainWindow& mainWindow ); 00086 SlicerMainWindow& operator=( const SlicerMainWindow& other); 00087 00088 int populateSampleCount() const; 00089 00090 //Persistence 00091 bool toImageFormat( const QString& fileName, const QString& format ); 00092 bool toASCII( const QString& fileName ); 00093 00094 //Statistics 00095 void updateStatisticsLayout(); 00096 00097 SliceColorPreferences* colorPreferences; 00098 SlicePlotPreferences* plotPreferences; 00099 SliceZoomer* plotZoomer; 00100 00101 SlicePlot slicePlot; 00102 00103 QStringList methodList; 00104 QStringList xAxisList; 00105 00106 Ui::SlicerMainWindowClass ui; 00107 00108 }; 00109 } 00110 00111 #endif // SLICERMAINWINDOW_QO_H