00001 //# Copyright (C) 2005 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 #ifndef HISTOGRAMMAIN_QO_H 00026 #define HISTOGRAMMAIN_QO_H 00027 00028 #include <QtGui/QMainWindow> 00029 #include <images/Images/PagedImage.h> 00030 #include <casa/aipstype.h> 00031 #include <guitools/Histogram/HistogramMain.ui.h> 00032 #include <guitools/Histogram/ImageLoader.qo.h> 00033 #include <guitools/Histogram/SaveHistogramWidget.qo.h> 00034 00035 class QCloseEvent; 00036 00037 00038 namespace casa { 00039 00040 class BinPlotWidget; 00041 class ColorPreferences; 00042 template <class T> class ImageInterface; 00043 class ImageRegion; 00044 00049 class HistogramMain : public QMainWindow { 00050 Q_OBJECT 00051 00052 public: 00062 HistogramMain(bool showFileLoader, bool fitControls, bool rangeControls, 00063 bool plotModeControls, QWidget *parent); 00064 bool setImage(SHARED_PTR<const ImageInterface<Float> > img ); 00065 bool setImageRegion( ImageRegion* imageRegion, int id ); 00066 std::pair<double,double> getRange() const; 00067 void deleteImageRegion( int id ); 00068 void imageRegionSelected( int id ); 00069 void setChannelCount( int count ); 00070 void setChannelValue( int value ); 00071 void setDisplayPlotTitle( bool display ); 00072 void setDisplayAxisTitles( bool display ); 00073 void setPlotMode( int mode ); 00074 ~HistogramMain(); 00075 00076 signals: 00077 void rangeChanged(); 00078 void closing(); 00079 00080 protected: 00081 //Clean up images and regions because we are going down 00082 virtual void closeEvent(QCloseEvent* event); 00083 00084 private slots: 00085 void openFileLoader(); 00086 void openHistogramSaver(); 00087 void imageFileChanged(); 00088 void openColorPreferences(); 00089 void colorsChanged(); 00090 void postStatusMessage( const QString& statusMsg ); 00091 00092 private: 00093 HistogramMain( const HistogramMain& histMain ); 00094 HistogramMain& operator=( const HistogramMain& histMain ); 00095 bool generateImage( const QString& imagePath, SHARED_PTR<const ImageInterface<Float> > image ); 00096 00097 ImageLoader fileLoader; 00098 SaveHistogramWidget histogramSaver; 00099 ColorPreferences* preferencesColor; 00100 BinPlotWidget* plotWidget; 00101 LogIO logger; 00102 00103 Ui::HistogramMainClass ui; 00104 00105 }; 00106 } 00107 00108 #endif // HISTOGRAMMAIN_QO_H