ImageScroll.qo.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef IMAGESCROLL_QO_H
00026 #define IMAGESCROLL_QO_H
00027
00028 #include <display/QtViewer/ImageManager/ImageView.qo.h>
00029 #include <display/QtViewer/ImageManager/ImageScroll.ui.h>
00030 #include <QtGui/QWidget>
00031
00032 class QDragMoveEvent;
00033 class QDragEnterEvent;
00034 class QDropEvent;
00035 class QMimeData;
00036 class QSpacerItem;
00037 class QFrame;
00038
00039 namespace casa {
00040
00041 class QtDisplayData;
00042
00047 class ImageScroll : public QWidget {
00048 Q_OBJECT
00049
00050 public:
00051 ImageScroll(QWidget *parent = 0);
00052
00053
00054 QList<ImageView*> getViews();
00055
00056 QtDisplayData* getHueMaster() const;
00057
00058 QtDisplayData* getSaturationMaster() const;
00059 QtDisplayData* getCoordinateMaster() const;
00060
00061
00062 int getImageCount() const;
00063
00064 int getRegisteredCount() const;
00065
00066 int getRegisteredIndex( int dropIndex, bool rastersOnly = false )const;
00067
00068 int getIndex( ImageView* view );
00069
00070
00071
00072 void setViewedImage( int registrationIndex );
00073 void setRegisterAll( bool selectAll);
00074 void setColorCombinationMode( ImageView::ColorCombinationMode mode );
00075
00076
00077
00078 void setMasterCoordinateImage( QString masterCoordinateImageName );
00079
00080
00081 void closeImages();
00082 void addDisplayDataLayout( QtDisplayData* displayData, int dropIndex);
00083 void addImageView( QtDisplayData* displayData, bool registered,
00084 ImageView::ColorCombinationMode mode,
00085 int dropIndex = -1, bool masterCoordinate = false,
00086 bool masterSaturation = false, bool masterHue = false,
00087 QColor rgbColor= QColor("#D3D3D3"));
00088 void removeDisplayDataLayout( QtDisplayData* displayData );
00089 void removeImageView( QtDisplayData* displayData );
00090 virtual ~ImageScroll();
00091
00092 signals:
00093
00094 void displayDataRemoved( QtDisplayData* imageData, bool );
00095
00096 void displayDataAdded( QtDisplayData* imageData );
00097
00098 void displayTypeChanged( ImageView* displayData );
00099
00100 void imageOrderingChanged( QtDisplayData* imageData, int dropIndex,
00101 bool registered, bool masterCoordinate
00102 );
00103
00104 void masterCoordinateImageChanged( QtDisplayData* imageData );
00105
00106 void showDataDisplayOptions( QtDisplayData* imageName );
00107
00108 void registrationChange( ImageView* imageView );
00109 void animateToImage( int index );
00110
00111 protected:
00112 void dragEnterEvent( QDragEnterEvent* enterEvent );
00113 void dropEvent( QDropEvent* dropEvent );
00114 void dragMoveEvent( QDragMoveEvent* dragMoveEvent );
00115 void dragLeaveEvent( QDragLeaveEvent* leaveEvent );
00116
00117 private slots:
00118
00119 void closeImage( ImageView* imageView, bool deleteImage = true );
00120
00121
00122
00123 void coordinateSystemChanged( ImageView* imageData );
00124
00125
00126 void masterCoordinateClear();
00127
00128 void hueImageChanged( ImageView* imageData );
00129
00130 void saturationImageChanged( ImageView* imageData );
00131 void viewImage( ImageView* imageView );
00132
00133 private:
00134 ImageScroll( const ImageScroll& other );
00135 ImageScroll operator=( const ImageScroll& other );
00136
00137
00138 void resetMasterCoordinate( ImageView* newMaster );
00139
00140
00141 void addImage( ImageView* imageView, int dropIndex = -1 );
00142 void removeImageViewLayout( ImageView* imageView );
00143 void addImageViewLayout( ImageView* viewerImage, int dropIndex);
00144
00145
00146 int findImageView( QString name, bool exactMatch = true );
00147 QString removeSuffixes( QString name ) const;
00148 QString stripBold( QString name ) const;
00149
00150
00151 int getDropIndex( int dropY );
00152 void insertDragMarker( int position );
00153 void removeDragMarker();
00154 int getDragMarkerLayoutIndex() const;
00155 ImageView* getMimeImageView( const QMimeData* mimeData );
00156
00157 QSpacerItem* spacer;
00158
00159 QFrame* dropMarker;
00160 const int LAYOUT_SPACING;
00161 const int LAYOUT_MARGIN;
00162 QList<ImageView*> images;
00163 QWidget* scrollWidget;
00164 Ui::ImageScrollClass ui;
00165 };
00166
00167 }
00168
00169 #endif // IMAGESCROLL_QO_H