casa
$Rev:20696$
|
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 IMAGEMANAGERDIALOG_QO_H 00026 #define IMAGEMANAGERDIALOG_QO_H 00027 00028 #include <QtGui/QDialog> 00029 #include <display/QtViewer/ImageManager/ImageManagerDialog.ui.h> 00030 #include <display/QtViewer/ImageManager/ImageTracker.h> 00031 #include <casa/BasicSL/String.h> 00032 00033 namespace casa { 00034 00035 class QtDisplayData; 00036 class ImageView; 00037 class ImageScrollWidget; 00038 class DisplayDataHolder; 00039 class ColormapDefinition; 00040 class Colormap; 00041 template <class T> class ImageInterface; 00042 00048 class ImageManagerDialog : public QDialog, public ImageTracker { 00049 Q_OBJECT 00050 00051 public: 00052 ImageManagerDialog(QWidget *parent = 0); 00053 void setImageHolders( DisplayDataHolder* displayed, DisplayDataHolder* allImages ); 00054 QtDisplayData* getDisplayChangeDD() const; 00055 ~ImageManagerDialog(); 00056 00057 //Image Tracker Interface 00058 void masterImageSelected( QtDisplayData* image ); 00059 void imageAdded( QtDisplayData* image ); 00060 void imageRemoved( QtDisplayData* image ); 00061 00062 signals: 00063 void ddClosed( QtDisplayData* dd ); 00064 void ddOpened( const String& path, const String& dataType, 00065 const String& displayType/*, const QColor singleColor*/ ); 00066 00067 public slots: 00068 void displayTypeChanged( ImageView* changedView ); 00069 void displayColorsChanged(ImageView* changedView ); 00070 00071 private slots: 00072 void applyColorChanges(); 00073 void openToDisplayed(); 00074 void displayedToOpen(); 00075 void closeImage(); 00076 void unDisplayImage( QtDisplayData* image ); 00077 void displayImage( QtDisplayData* image ); 00078 void colorRestrictionsChanged(); 00079 void masterImageChanged( const QString& imageName ); 00080 00081 private: 00082 ImageManagerDialog( const ImageManagerDialog& other ); 00083 ImageManagerDialog operator=( const ImageManagerDialog& other ); 00084 00085 void updateSelectedMaster( const QString& previousSelection); 00086 void updateMasterList(); 00087 void updateColorList(); 00088 void updateSaturationList(); 00089 void applyMasterColorMap(); 00090 void applyMasterIntensityRange(); 00091 Colormap* generateColorMap( ImageInterface<float>* img, 00092 QColor baseColor, bool individualMap ); 00093 void setComboIndex( QComboBox* combo, int index ); 00094 void removeImageFromList( QList<ImageView*>& imageList ); 00095 void initializeScrollArea( QWidget* holder, ImageScrollWidget*& scrollArea ); 00096 bool getIntensityMinMax( ImageInterface<float>* img, 00097 double* intensityMin, double* intensityMax ); 00098 bool isControlEligible( QtDisplayData* qdd ) const; 00099 ColormapDefinition* generateSaturationMap( double minIntensity, double maxIntensity, 00100 QColor baseColor ); 00101 void updateImageList(QComboBox* combo ); 00102 DisplayDataHolder* openHolder; 00103 DisplayDataHolder* allImages; 00104 Ui::ImageManagerDialogClass ui; 00105 ImageScrollWidget* openScroll; 00106 ImageScrollWidget* displayedScroll; 00107 const String SINGLE_COLOR_MAP; 00108 const String MASTER_COLOR_MAP; 00109 }; 00110 00111 } 00112 00113 #endif // IMAGEMANAGERDIALOG_QO_H