casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtCleanPanelGui.qo.h
Go to the documentation of this file.
1 //# QtCleanPanelGui.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 QTCLEANPANELGUI_H_
29 #define QTCLEANPANELGUI_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  QtCleanPanelGui( 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 QtCleanPanelGui) 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* ncyclesED_;
129  QLineEdit* threshED_;
131 
132  // standard palette...
133  QPalette default_palette;
134  // palette used when input is expected for clean...
135  QPalette input_palette;
136 
137  private:
140 
141  void writeRegionText(const casacore::ImageRegion& imageReg, const casacore::String& filename, float value);
142 
144  QtDisplayData* maskdd_; // later: to display clean region.
145  std::string axis_change;
146 
149 
150  };
151 
152 
153 } //# NAMESPACE CASA - END
154 
155 #endif
156 
157 
virtual void changeMaskAxis(casacore::String, casacore::String, casacore::String, std::vector< int >)
virtual void newMouseRegion(casacore::Record mouseRegion, WorldCanvasHolder *wch)
Connected to the rectangle region mouse tools new rectangle signal.
Qt implementation of main viewer supervisory object – Gui level.
Definition: QtViewer.qo.h:79
void closeEvent(QCloseEvent *event)
scripted (via dbus) panels should override the closeEvent() and hide the gui instead of deleting it w...
virtual void exitDone()
virtual Type type()
Return the type enum.
void addedData(QString type, QtDisplayData *)
the QtDBusViewerAdaptor can handle loading &amp; registering data itself, but to connect up extra functio...
casacore::Record buttonState_
void writeRegionText(const casacore::ImageRegion &imageReg, const casacore::String &filename, float value)
QVariant start_interact(const QVariant &input, int id)
Interconvert pixel positions and directions (e.g. RA/DEC).
The main display window for the Qt version of the viewer.
QRadioButton * thisHiddenRB_
A hierarchical collection of named fields of various types.
Definition: Record.h:180
DisplayCoordinateSystem csys_p
virtual void exitNoMore()
casacore::DirectionCoordinate dirCoord_p
bool supports(SCRIPTING_OPTION option) const
Class to hold a region of interest in an image.
Definition: ImageRegion.h:86
std::list< QWidget * > disabled_widgets
QtCleanPanelGui(QtViewer *v, QWidget *parent=0, const std::list< std::string > &args=std::list< std::string >())
QPalette input_palette
palette used when input is expected for clean...
A holder to interface between DisplayDatas and a WorldCanvas.
virtual void changeImageAxis(casacore::String, casacore::String, casacore::String, std::vector< int >)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
QVariant setoptions(const QMap< QString, QVariant > &input, int id)
virtual void exitStop()
QPalette default_palette
standard palette...
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual void changeMaskSelectionText(casacore::String x, casacore::String y, casacore::String z)
void interact(QVariant)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42