ImageManagerDialog.qo.h

Go to the documentation of this file.
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 <display/QtViewer/ImageManager/ImageView.qo.h>
00032 #include <casa/BasicSL/String.h>
00033 
00034 namespace casa {
00035 
00036         class DisplayOptionsDialog;
00037         class QtDisplayData;
00038         //class ImageView;
00039         class ImageScroll;
00040         class DisplayDataHolder;
00041         class ColormapDefinition;
00042         class Colormap;
00043         template <class T> class ImageInterface;
00044 
00050         class ImageManagerDialog : public QDialog, public ImageTracker {
00051                 Q_OBJECT
00052 
00053         public:
00054                 ImageManagerDialog(QWidget *parent = 0);
00055                 //Sets the containers which are the sources for display data, both registered and
00056                 //open.
00057                 void setImageHolders( DisplayDataHolder* displayed, DisplayDataHolder* allImages );
00058 
00059                 //Sets the image that is currently being viewed (on the Animator).  Allows the image
00060                 //manager to indicate the current image on the display.
00061                 void setViewedImage( int registrationIndex );
00062                 void closeImageView( QtDisplayData* image );
00063 
00064                 ~ImageManagerDialog();
00065 
00066                 //-----------------------------------------------------------------------
00067                 //          Image Tracker Interface
00068                 //-----------------------------------------------------------------------
00069                 //Internally, a new master image has been selected.
00070                 void masterImageSelected( QtDisplayData* image );
00071                 //Adds an image to the manager when a new one is opened.
00072                 void imageAdded( QtDisplayData* image, int position,
00073                                 bool autoRegister, bool masterCoordinate,
00074                                 bool masterSaturation, bool masterHue );
00075 
00076         signals:
00077                 void ddClosed( QtDisplayData*& dd );
00078                 void ddOpened( const String& path, const String& dataType,
00079                                const String& displayType,/*, const QColor singleColor*/
00080                                int insertionIndex, bool registered,
00081                                bool masterCoordinate, bool masterSaturation,
00082                                bool masterHue);
00083                 void registerAll();
00084                 void unregisterAll();
00085                 void registerDD( QtDisplayData* dd, int position );
00086                 void unregisterDD( QtDisplayData* dd );
00087                 //Emitted when a new master image for setting the coordinate system has been
00088                 //selected.
00089                 void masterCoordinateChanged( QtDisplayData* oldMaster, QtDisplayData* newMaster );
00090                 void animateToImage( int index );
00091                 void createRGBImage( QtDisplayData* coordinateMaster, QtDisplayData* redImage, QtDisplayData* greenImage, QtDisplayData* blueImage );
00092 
00093         public slots:
00094                 //The ImageView has changed types (raster, contour, vector, etc)
00095                 void displayTypeChanged( ImageView* changedView );
00096 
00097 
00098         private slots:
00099                 //Opens the display data options panel for the specific display data.
00100                 void showDataDisplayOptions( QtDisplayData* );
00101 
00102                 //Apply the color changes the user has specified.
00103                 void applyColorChanges();
00104                 //User has changed the color method for combining multiple images (RGB,Hue/Saturation,etc)
00105                 void colorRestrictionsChanged();
00106 
00107                 //Close/register/unregister
00108                 void closeAll();
00109                 void registerImages();
00110                 void unregisterImages();
00111                 void registrationChange( ImageView* imageView );
00112                 void closeImage( QtDisplayData* image, bool coordinateMaster );
00113 
00114                 //A new image has been designated as the master image for setting the
00115                 //coordinate system.
00116                 void masterImageChanged( QtDisplayData* newMaster );
00117 
00118                 //The user has reordered the images in the display.
00119                 void reorderDisplayImages( QtDisplayData* displayData, int dropIndex, bool registered,
00120                                 bool masterCoordinate/*, bool masterSaturation, bool masterHue, QColor rgbColor*/ );
00121 
00122 
00123         private:
00124                 ImageManagerDialog( const ImageManagerDialog& other );
00125                 ImageManagerDialog operator=( const ImageManagerDialog& other );
00126 
00127                 //Initialization
00128                 void initializeScrollArea();
00129 
00130                 //Coloring
00131                 //Returns the transparency to use when combining images.
00132                 //float getTransparency() const;
00133                 //Get the min and max intensity of the image.
00134                 bool getIntensityMinMax( SHARED_PTR<ImageInterface<float> > img,
00135                                          double* intensityMin, double* intensityMax );
00136         //Generate a color map based on a single base color (RGB mode).
00137                 Colormap* generateColorMap( QColor baseColor);
00138                 //Helper method which generates a color definition based on a single color.
00139                 ColormapDefinition* generateSaturationMap( QColor baseColor );
00140                 //Attempts to set a master hue color map into all of the images.  Used in
00141                 //hue/saturation mode.
00142                 bool applyMasterColor( QString& errorMessage );
00143                 //Worker method that remaps a baseMap with a baseIntensityMin and baseIntensityMap
00144                 //to a new color map definition with intensityMin and intensityMax.  Used in
00145                 //hue/saturation mode.
00146                 Colormap* generateMasterDefinition( ColormapDefinition* baseMap,
00147                         double colorMin, double colorMax, double intensityMin, double intensityMax );
00148                 float getColorFraction( float value, double minValue, double maxValue );
00149                 ImageView::ColorCombinationMode getColorCombinationMode() const;
00150 
00151                 //Enable/disable the "all" buttons based on how many images are
00152                 //registered, unregistered, open.
00153                 void updateAllButtons();
00154 
00155                 //Dialog containing display options for a particular display data.
00156                 DisplayOptionsDialog* displayOptionsDialog;
00157                 //Holds the open images
00158                 DisplayDataHolder* allImages;
00159 
00160                 //Holds the registered images
00161                 DisplayDataHolder* displayedImages;
00162                 Ui::ImageManagerDialogClass ui;
00163                 ImageScroll* imageScroll;
00164                 const String SINGLE_COLOR_MAP;
00165                 const String MASTER_COLOR_MAP;
00166                 const int COLOR_MAP_SIZE;
00167         };
00168 
00169 }
00170 
00171 #endif // IMAGEMANAGERDIALOG_QO_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1