QtCanvasManager.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 
00026 #ifndef QTCanvasManager_H
00027 #define QTCanvasManager_H
00028 
00029 #include <casa/aips.h>
00030 #include <display/QtAutoGui/QtAutoGui.qo.h>
00031 #include <display/QtViewer/QtDisplayPanel.qo.h>
00032 #include <display/QtViewer/QtCanvasManager.ui.h>
00033 #include <display/QtViewer/CursorLink.ui.h>
00034 #include <casa/Containers/Record.h>
00035 
00036 #include <graphics/X11/X_enter.h>
00037 /* #  include <QDir> */
00038 /* #  include <QColor> */
00039 /* #  include <QHash> */
00040 #include <QFrame>
00041 #include <QSpacerItem>
00042 #include <graphics/X11/X_exit.h>
00043 
00044 
00045 namespace casa {
00046 
00047         class QtViewer;
00048         class QtCanvasManager;
00049 
00050 // <summary>
00051 // Options widget for single DisplayPanel.
00052 // </summary>
00053 
00054 // <synopsis>
00055 // </synopsis>
00056 
00057         class QtCanvasManagerOptions : public QtAutoGui {
00058                 Q_OBJECT
00059         public:
00060                 QtCanvasManagerOptions( QtDisplayPanel* qdp, QWidget *parent ) : QtAutoGui(parent) {
00061                         loadRecord(qdp->getOptions());
00062                         connect( this, SIGNAL(setOptions(Record)), qdp, SLOT(setOptions(Record)) );
00063                         connect( qdp, SIGNAL(optionsChanged(Record)), SLOT(changeOptions(Record)) );
00064                 }
00065                 ~QtCanvasManagerOptions() {  }
00066         };
00067 
00068         class CursorLink : public QFrame, protected Ui::CursorLink {
00069                 Q_OBJECT
00070         public:
00071                 CursorLink( const std::string &name, QtCanvasManager *mgr, QWidget *parent=0 );
00072                 std::string name( ) const {
00073                         return name_;
00074                 }
00075                 bool isChecked( ) const {
00076                         return link->checkState( ) == Qt::Unchecked ? false : true;
00077                 }
00078                 void setChecked( bool val ) {
00079                         link->setCheckState( val ? Qt::Checked : Qt::Unchecked );
00080                 }
00081                 void setText( const std::string &txt ) {
00082                         link->setText(QString::fromStdString(txt));
00083                 }
00084                 void setDPG( QtDisplayPanelGui *g ) {
00085                         dpg = g;
00086                 }
00087                 QtDisplayPanelGui *getDPG( ) {
00088                         return dpg;
00089                 }
00090                 void setColor( QColor c );
00091 
00092         private slots:
00093                 void setColor( );
00094                 void linkChange(int);
00095 
00096         private:
00097                 QtCanvasManager *mgr;
00098                 QtDisplayPanelGui *dpg;
00099                 std::string name_;
00100                 QColor current_color;
00101         };
00102 
00103         class QtCanvasManager : public QDialog, protected Ui::QtCanvasManager {
00104                 Q_OBJECT
00105         public:
00106 
00107                 QtCanvasManager(QtDisplayPanelGui *dpg);
00108                 ~QtCanvasManager( ) { }
00109                 QtDisplayPanelGui *dpg( ) {
00110                         return dpg_;
00111                 }
00112 
00113         protected:
00114 
00115                 void showEvent( QShowEvent* );
00116                 QtCanvasManagerOptions *options;
00117                 QtDisplayPanelGui *dpg_;
00118         private:
00119                 QVBoxLayout *layout;
00120                 QSpacerItem *spacer;
00121                 std::list<CursorLink*> link_widgets;
00122 
00123         };
00124 
00125 }
00126 
00127 #endif
00128 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1