casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtCleanPanelGui2.qo.h
Go to the documentation of this file.
1 //# QtCleanPanelGui2.qo.h: interactive clean display panel
2 //# Copyright (C) 2005,2009
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef QTCLEANPANELGUI2_H_
29 #define QTCLEANPANELGUI2_H_
30 
31 #include <casa/aips.h>
32 #include <casa/BasicSL/String.h>
33 #include <casa/Containers/Record.h>
34 #include <casa/Arrays/Vector.h>
37 
38 #include <graphics/X11/X_enter.h>
39 # include <QObject>
40 # include <QGroupBox>
41 # include <QRadioButton>
42 # include <QPushButton>
43 # include <QHBoxLayout>
44 # include <QVBoxLayout>
45 # include <QLineEdit>
46 #include <graphics/X11/X_exit.h>
48 
49 
50 namespace casacore{
51 
52  class ImageRegion;
53 }
54 
55 namespace casa {
56 
57  class QtViewer;
58  class QtDisplayPanel;
59  class QtDisplayData;
60  class WorldCanvasHolder;
61 
62  // <synopsis>
63  // Demo class to encapsulate 'serial' running of qtviewer into callable
64  // methods of a class; this example also applies it to the task of
65  // interactive selection of CLEAN boxes.
66  // </synopsis>
68 
69  Q_OBJECT //# Allows slot/signal definition. Must only occur in
70  //# implement/.../*.h files; also, makefile must include
71  //# name of this file in 'mocs' section.
72 
73 
74  protected:
75  friend class QtViewer;
76  QtCleanPanelGui2( QtViewer* v, QWidget* parent=0,
77  const std::list<std::string> &args = std::list<std::string>( ) );
78 
79  public:
81 
82  bool supports( SCRIPTING_OPTION option ) const;
83  QVariant start_interact( const QVariant &input, int id );
84  QVariant setoptions( const QMap<QString,QVariant> &input, int id);
85 
86  // the QtDBusViewerAdaptor can handle loading & registering data itself,
87  // but to connect up extra functionality, the upper-level QtDisplayPanelGui
88  // (or in the current case, the derived QtCleanPanelGui2) would have to be
89  // notified that data has been added. This will allow it to set up the
90  // callbacks for drawing regions...
91  void addedData( QString type, QtDisplayData * );
92 
93  protected slots:
94 
95  virtual void exitStop();
96  virtual void exitDone();
97  virtual void exitNoMore();
98 
99  // Connected to the rectangle region mouse tools new rectangle signal.
100  // Accumulates [/ displays] selected boxes.
101  virtual void newMouseRegion(casacore::Record mouseRegion, WorldCanvasHolder* wch);
102 
103  virtual void changeMaskAxis(casacore::String, casacore::String, casacore::String, std::vector<int> );
104  virtual void changeImageAxis(casacore::String, casacore::String, casacore::String, std::vector<int> );
106 
107  signals:
108  void interact( QVariant );
109 
110  protected:
111 
112  // scripted (via dbus) panels should override the closeEvent( ) and hide the gui
113  // instead of deleting it when it was created via a dbus script...
114  void closeEvent(QCloseEvent *event);
115 
116  std::list<QWidget*> disabled_widgets;
117 
118  QRadioButton* addRB_;
119  QRadioButton* eraseRB_;
120  QRadioButton* allChanRB_;
121  QRadioButton* thisPlaneRB_;
122  QRadioButton* allHiddenRB_;
123  QRadioButton* thisHiddenRB_;
124  QPushButton* maskNoMorePB_;
125  QPushButton* maskDonePB_;
126  QPushButton* stopPB_;
127  QLineEdit* niterED_;
128  QLineEdit* cycleniterED_;
129  QLineEdit* threshED_;
130  QLineEdit* cyclethreshED_;
132 
133  // standard palette...
134  QPalette default_palette;
135  // palette used when input is expected for clean...
136  QPalette input_palette;
137 
138  private:
141 
142  void writeRegionText(const casacore::ImageRegion& imageReg, const casacore::String& filename, float value);
143 
145  QtDisplayData* maskdd_; // later: to display clean region.
146  std::string axis_change;
147 
150 
151  };
152 
153 
154 } //# NAMESPACE CASA - END
155 
156 #endif
157 
158 
std::list< QWidget * > disabled_widgets
virtual void exitDone()
casacore::DirectionCoordinate dirCoord_p
QVariant start_interact(const QVariant &input, int id)
Qt implementation of main viewer supervisory object – Gui level.
Definition: QtViewer.qo.h:79
casacore::Record buttonState_
virtual Type type()
Return the type enum.
DisplayCoordinateSystem csys_p
void closeEvent(QCloseEvent *event)
scripted (via dbus) panels should override the closeEvent() and hide the gui instead of deleting it w...
bool supports(SCRIPTING_OPTION option) const
QPalette default_palette
standard palette...
virtual void newMouseRegion(casacore::Record mouseRegion, WorldCanvasHolder *wch)
Connected to the rectangle region mouse tools new rectangle signal.
Interconvert pixel positions and directions (e.g. RA/DEC).
virtual void changeMaskAxis(casacore::String, casacore::String, casacore::String, std::vector< int >)
The main display window for the Qt version of the viewer.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
void interact(QVariant)
virtual void changeImageAxis(casacore::String, casacore::String, casacore::String, std::vector< int >)
Class to hold a region of interest in an image.
Definition: ImageRegion.h:86
virtual void exitNoMore()
A holder to interface between DisplayDatas and a WorldCanvas.
QtCleanPanelGui2(QtViewer *v, QWidget *parent=0, const std::list< std::string > &args=std::list< std::string >())
void writeRegionText(const casacore::ImageRegion &imageReg, const casacore::String &filename, float value)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void exitStop()
virtual void changeMaskSelectionText(casacore::String x, casacore::String y, casacore::String z)
void addedData(QString type, QtDisplayData *)
the QtDBusViewerAdaptor can handle loading &amp; registering data itself, but to connect up extra functio...
QPalette input_palette
palette used when input is expected for clean...
QVariant setoptions(const QMap< QString, QVariant > &input, int id)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42