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 DISPLAYDATAHOLDER_H_ 00027 #define DISPLAYDATAHOLDER_H_ 00028 00029 #include <list> 00030 #include <string> 00031 namespace casa { 00032 00033 class DisplayData; 00034 class QtDisplayData; 00035 class ImageTracker; 00036 class ImageDisplayer; 00037 00042 class DisplayDataHolder { 00043 public: 00044 DisplayDataHolder(); 00045 00046 //Adds the DisplayData. 00047 void addDD( QtDisplayData* dd, int position, bool autoRegister, 00048 bool masterCoordinate = false, bool masterSaturation= false, 00049 bool masterHue=false); 00050 00051 // Removes the QDD from the list and deletes it (if it existed -- 00052 // Return value: whether qdd was in the list in the first place). 00053 bool removeDD(QtDisplayData* qdd); 00054 void removeDDAll(); 00055 00056 // Insert and discard to basically the same thing as add/remove 00057 // except that they perform the operation through a GUI level 00058 // if one is available. 00059 void insertDD( QtDisplayData* dd, int position, bool registered ); 00060 void discardDD( QtDisplayData* dd ); 00061 00062 //Iteration support 00063 typedef std::list<QtDisplayData *> DisplayDataList; 00064 typedef DisplayDataList::const_iterator DisplayDataIterator; 00065 int getCount() const; 00066 bool isEmpty() const; 00067 bool isCoordinateMaster( QtDisplayData* displayData) const; 00068 DisplayDataIterator beginDD () const; 00069 DisplayDataIterator endDD () const; 00070 00071 //Controlling DD 00072 QtDisplayData* getDDControlling( ); 00073 void setDDControlling( QtDisplayData* controllingDD ); 00074 00075 //Returns the DD that will be animating the channels in 00076 //normal mode. 00077 QtDisplayData* getChannelDD( int index ) const; 00078 00079 // retrieve a DD with given name (0 if none). 00080 QtDisplayData* getDD(const std::string& name) const; 00081 QtDisplayData *getDD( const DisplayData *dd ) const; 00082 QtDisplayData* getDD( int index ); 00083 00084 // Check that a given DD is on the list. 00085 bool exists(QtDisplayData* qdd) const; 00086 00087 void setImageTracker( ImageTracker* tracker ); 00088 void setImageDisplayer( ImageDisplayer* displayer ); 00089 00090 void registrationOrderChanged(); 00091 virtual ~DisplayDataHolder(); 00092 private: 00093 DisplayDataHolder( const DisplayDataHolder& displayDataHolder ); 00094 DisplayDataHolder operator=( const DisplayDataHolder& displayDataHolder ); 00095 ImageTracker* imageTracker; 00096 ImageDisplayer* imageDisplayer; 00097 QtDisplayData *controlling_dd; 00098 std::list<QtDisplayData*> dataList; 00099 }; 00100 00101 } /* namespace casa */ 00102 #endif /* DISPLAYDATAHOLDER_H_ */