00001 //# Copyright (C) 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 QTVIEWER_CURSORTRACKINGHOLDER_H_ 00026 #define QTVIEWER_CURSORTRACKINGHOLDER_H_ 00027 00028 #include <QtGui/QWidget> 00029 #include <display/QtViewer/InActiveDock.qo.h> 00030 #include <display/QtViewer/CursorTrackingHolder.ui.h> 00031 #include <vector> 00032 00033 namespace casa { 00034 00035 class QtDisplayPanelGui; 00036 class QtDisplayData; 00037 class PrincipalAxesDD; 00038 class Record; 00039 class TrackBox; 00040 00044 class CursorTrackingHolder : public InActiveDock, protected Ui::CursorTrackingHolder { 00045 Q_OBJECT 00046 00047 public: 00048 CursorTrackingHolder( QtDisplayPanelGui *panel, QWidget *parent = 0); 00049 ~CursorTrackingHolder( ); 00050 00051 void arrangeTrackBoxes( ); 00052 TrackBox *addTrackBox( QtDisplayData *, int position = -1 ); 00053 void removeTrackBox( QtDisplayData * ); 00054 void display( const Record &trackingRec ); 00055 void cursorUpdate( const std::vector<double> &, QtDisplayData * ); 00056 00057 QSize sizeHint( ) const { return find_size( ); } 00058 QSize minimumSizeHint( ) const { return find_size( ); } 00059 00060 void dismiss( ); 00061 00062 //Overriden because if the cursor tracker was not shown, images were loaded, 00063 //and then the cursor tracker was shown, it was not resizing properly. 00064 void setVisible( bool visible ); 00065 00066 protected: 00067 void closeEvent ( QCloseEvent * event ); 00068 00069 private slots: 00070 void handle_folding( bool, QtDisplayData * ); 00071 void handle_visibility(bool); 00072 00073 private: 00074 QSize find_size( ) const; 00075 void update_size( ); 00076 QtDisplayPanelGui *panel_; 00077 00078 bool dismissed; 00079 }; 00080 } 00081 #endif