casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ImageView.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 
00026 #ifndef IMAGEVIEW_QO_H
00027 #define IMAGEVIEW_QO_H
00028 
00029 #include <QtGui/QFrame>
00030 #include <display/QtViewer/ImageManager/ImageView.ui.h>
00031 
00032 
00033 
00034 namespace casa {
00035 
00036 class QtDisplayData;
00037 
00043 class ImageView : public QFrame
00044 {
00045     Q_OBJECT
00046 
00047 public:
00048     ImageView(QtDisplayData* data, QWidget *parent = 0);
00049     QString getName() const;
00050     QtDisplayData* getData() const;
00051     QString getDataDisplayTypeName() const;
00052     bool isImageSelected() const;
00053     void setImageSelected( bool selected );
00054     void setImageColorsEnabled( bool enabled );
00055     void setDisplayedColor( QColor imageColor );
00056     void emitDisplayColorsChanged();
00057     QColor getDisplayedColor() const;
00058     void makeDrag();
00059     ~ImageView();
00060 
00061 signals:
00062         void imageSelected(ImageView*);
00063         void displayTypeChanged( ImageView* dd );
00064         void displayColorsChanged( ImageView* dd );
00065 
00066 protected:
00067     virtual void mouseMoveEvent( QMouseEvent* event );
00068 
00069 private slots:
00070         void openCloseDisplay();
00071         void showColorDialog();
00072         void imageSelectionChanged( bool selected );
00073         void displayTypeChanged();
00074 
00075 private:
00076         ImageView( const ImageView& other );
00077         ImageView operator=( const ImageView& other );
00078         void setBackgroundColor( QColor color );
00079         void minimizeDisplay();
00080         void maximizeDisplay();
00081         void initDisplayType();
00082 
00083         void setButtonColor( QColor color );
00084         QColor getButtonColor() const;
00085 
00086         enum DisplayType { DISPLAY_RASTER, DISPLAY_CONTOUR, DISPLAY_VECTOR, DISPLAY_MARKER };
00087         DisplayType getDataDisplayType() const;
00088 
00089     bool selected;
00090     bool minimized;
00091     QColor selectedColor;
00092     QColor normalColor;
00093 
00094     QtDisplayData* imageData;
00095     QButtonGroup* displayGroup;
00096     Ui::ImageViewClass ui;
00097 };
00098 
00099 }
00100 
00101 #endif // IMAGEVIEW_QO_H