AnimatorHolder.qo.h

Go to the documentation of this file.
00001 //# Copyright (C) 2005,2013
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 ANIMATORHOLDER_QO_H
00026 #define ANIMATORHOLDER_QO_H
00027 
00028 #include <QtGui/QWidget>
00029 #include <display/QtViewer/InActiveDock.qo.h>
00030 #include <display/QtViewer/AnimatorHolder.ui.h>
00031 #include <display/QtViewer/AnimatorWidget.qo.h>
00032 
00033 namespace casa {
00034 
00035     class QtDisplayPanelGui;
00040     class AnimatorHolder : public InActiveDock, protected Ui::AnimatorHolder {
00041                 Q_OBJECT
00042 
00043         public:
00044                 const static bool BLINK_MODE;
00045                 const static bool NORMAL_MODE;
00046                 AnimatorHolder( QtDisplayPanelGui *qdp, QWidget *parent = 0 );
00047                 void setFrameInformation( bool mode, int frm, int len );
00048                 void setRateInformation( bool mode, int minr, int maxr, int rate );
00049                 void setModeEnabled( int count );
00050                 void setChannelModeEnabled( int count, bool select=true);
00051                 int getRate( bool mode ) const;
00052                 int getLowerBoundChannel() const;
00053                 int getUpperBoundChannel() const;
00054 
00055                 int getChannelCount() const;
00056                 int getImageCount() const;
00057 
00058                 void setChannelZAxis( const QString& zAxisTite );
00059 
00060                 void foldChannel( );
00061                 void unfoldChannel( );
00062                 void foldImage( );
00063                 void unfoldImage( );
00064 
00065                 ~AnimatorHolder();
00066 
00067                 void dismiss( );
00068 
00069         protected:
00070                 void closeEvent ( QCloseEvent * event );
00071 
00072         signals:
00073 
00074                 //--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
00075                 // animation for channels
00076                 //--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
00077                 void setChannelMode( );
00078 /*goTo*///displayPanel
00079                 void goToChannel( int channel );
00080 /*frameNumberEdited*/
00081                 void channelNumEdited( int frame );
00082 /*channelSelect*/
00083                 void selectChannel( int channel );
00084 /*movieChannels*/
00085                 void channelMovieState( int currentFrame, bool direction, int stepSize, int frameStart, int frameEnd );
00086 /*stopMovie*///display
00087                 //void stopChannelMovie( );
00088 /*setRate*///displayPanel
00089                 void setChannelMovieRate( int frame );
00090 /*toStart*///displayPanel
00091                 void toChannelMovieStart( );
00092 /*revStep*///displayPanel
00093                 void revStepChannelMovie( );
00094 /*revPlay*/
00095                 void revPlayChannelMovie( );
00096 /*stop*///displayPanel
00097                 void stopChannelMovie( );
00098 /*fwdStep*///displayPanel
00099                 void fwdStepChannelMovie( );
00100 /*fwdPlay*/
00101                 void fwdPlayChannelMovie( );
00102 /*toEnd*///displayPanel
00103                 void toChannelMovieEnd( );
00104 
00105                 //--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
00106                 // animation for images
00107                 //--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
00108                 void setImageMode( bool channelCubes );
00109 /*goTo*///displayPanel
00110                 void goToImage( int image );
00111 /*frameNumberEdited*/
00112                 void imageNumEdited( int frame );
00113 /*channelSelect*/
00114                 void selectImage( int channel );
00115 /*movieChannels*/
00116                 void imageMovieState( int currentFrame, bool direction, int stepSize, int frameStart, int frameEnd );
00117 /*stopMovie*/
00118                 void stopImageMovie( );
00119 /*setRate*///setImageMovieRate
00120                 void setImageMovieRate( int frame );
00121 /*toStart*///displayPanel
00122                 void toImageMovieStart( );
00123 /*revStep*///displayPanel
00124                 void revStepImageMovie( );
00125 /*revPlay*/
00126                 void revPlayImageMovie( );
00127 /*stop*///displayPanel
00128                 //void stopImageMovie( );
00129 /*fwdStep*///displayPanel
00130                 void fwdStepImageMovie( );
00131 /*fwdPlay*/
00132                 void fwdPlayImageMovie( );
00133 /*toEnd*///displayPanel
00134                 void toImageMovieEnd( );
00135 
00136                 void lowerBoundAnimatorImageChanged( int );
00137                 void upperBoundAnimatorImageChanged(int);
00138                 void stepSizeAnimatorImageChanged(int);
00139                 void lowerBoundAnimatorChannelChanged( int );
00140                 void upperBoundAnimatorChannelChanged(int);
00141                 void stepSizeAnimatorChannelChanged(int);
00142                 void animationImageChanged(int);
00143 
00144         private slots:
00145                 void gotochannel_p(int frame);
00146                 void setRateChannel(int frame);
00147                 void toStartChannel();
00148                 void frameNumberEditedChannel( int frame );
00149                 void revStepChannel();
00150                 void fwdPlayChannel();
00151                 void revPlayChannel();
00152                 void stopChannel();
00153                 void fwdStepChannel();
00154                 void toEndChannel();
00155                 void upperBoundChangedChannel(int);
00156                 void lowerBoundChangedChannel(int);
00157                 void stepSizeChangedChannel(int);
00158                 void gotoimage_p(int frame);
00159                 void setRateImage(int frame);
00160                 void toStartImage();
00161                 void frameNumberEditedImage( int frame );
00162                 void revStepImage();
00163                 void revPlayImage();
00164                 void stopImage();
00165                 void fwdStepImage();
00166                 void fwdPlayImage();
00167                 void toEndImage();
00168                 void lowerBoundChangedImage(int);
00169                 void upperBoundChangedImage(int);
00170                 void stepSizeChangedImage(int);
00171                 void modeChange();
00172 
00173         void handle_folding( bool visible );
00174                 void handle_visibility(bool);
00175 
00176         private:
00177                 void initChannel();
00178                 void initImage();
00179         void sizeGroupBox( QGroupBox* );
00180                 int getAnimationCount() const;
00181                 void addRemoveChannelAnimatorBasedOnFrameCount();
00182         int find_height( ) const;
00183 
00184                 enum Mode {CHANNEL_MODE, IMAGE_MODE, CHANNEL_IMAGES_MODE, END_MODE };
00185                 void modeChanged(Mode mode );
00186                 void changePalette( QGroupBox* box, QColor color );
00187                 void emitMovieChannels( bool direction );
00188                 void setSelected( bool mode );
00189 
00190                 //Because the user can switch between image and channel mode by
00191                 //just pressing the play button, there must be a way to turn a previous
00192                 //play off if one was running.  The following two methods do that.
00193                 void stopImagePlay();
00194                 void stopChannelPlay();
00195 
00196                 Mode previousMode;
00197                 AnimatorWidget* animatorChannel;
00198                 AnimatorWidget* animatorImage;
00199                 QColor selectedColor;
00200                 QColor backgroundColor;
00201 
00202         QtDisplayPanelGui *panel_;
00203 
00204                 bool dismissed;
00205         };
00206 }
00207 #endif // ANIMATORHOLDER_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