casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtDisplayPanelGui.qo.h
Go to the documentation of this file.
1 //# QtDisplayPanelGui.qo.h: Qt implementation of main viewer display window.
2 //# with surrounding Gui functionality
3 //# Copyright (C) 2005,2009
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id: QtDisplayPanelGui.qo.h,v 1.7 2006/10/10 21:42:05 dking Exp $
28 
29 #ifndef QTDISPLAYPANELGUI_H
30 #define QTDISPLAYPANELGUI_H
31 
32 #include <casa/aips.h>
33 #include <graphics/X11/X_enter.h>
34 # include <QtCore>
35 # include <QtGui>
36 #include <QStatusBar>
37 #include <QTextEdit>
38 #include <QHash>
39 #include <QFont>
40 
41 //#dk Be careful to put *.ui.h within X_enter/exit bracket too,
42 //# because they'll have Qt includes.
43 //# E.g. <QApplication> needs the X11 definition of 'Display'
44 #include <graphics/X11/X_exit.h>
53 
54 namespace casacore{
55 
56  class String;
57  template <class T> class ImageInterface;
58 }
59 
60 namespace casa { //# NAMESPACE CASA - BEGIN
61 
62  namespace viewer {
63  class ViewerPreferences;
64  class CleanGui;
65  }
66 
67  class QtViewer;
68  class QtViewerPrintGui;
69  class QtMouseToolBar;
70  class QtCanvasManager;
71  class QtAnnotatorGui;
72  class MakeMask;
73  class FileBox;
74  class MakeRegion;
75  class QtProfile;
76  class QtDisplayData;
77  class TrackBox;
78  class QtRegionManager;
79  class QtRegionShapeManager;
80  class QtDataManager;
81  class QtExportManager;
82  class QtDataOptionsPanel;
83  class AnimatorHolder;
84  class BinPlotWidget;
85  class HistogramMain;
86  class Fit2DTool;
87  class SlicerMainWindow;
88  class ColorHistogram;
89  class ImageManagerDialog;
90  class QtDisplayPanelGui;
91  class CursorTrackingHolder;
92  class AboutDialogViewer;
93 
94 
95  class LinkedCursorEH : public QObject, public WCRefreshEH {
96  Q_OBJECT
97  public:
99  virtual ~LinkedCursorEH( );
100  void operator ()(const WCRefreshEvent &ev);
101  void addSource( QtDisplayPanelGui *src, QColor color );
102  void removeSource( QtDisplayPanelGui *src );
103  private slots:
106  private:
107  struct cursor_info_t {
108  cursor_info_t(QColor c) : color(c) { }
109  QColor color;
111  };
112  typedef std::map<QtDisplayPanelGui*,cursor_info_t> sources_list_t;
115  };
116 
117 
118 // <summary>
119 // The main display window for the Qt version of the viewer.
120 // </summary>
121 
123 
124  Q_OBJECT; //# Allows slot/signal definition. Must only occur in
125  //# implement/.../*.h files; also, makefile must include
126  //# name of this file in 'mocs' section.
127 
128  protected:
129  friend class QtViewer;
130  QtDisplayPanelGui( QtViewer *v, QWidget *parent=0, std::string rcstr="dpg",
131  const std::list<std::string> &args = std::list<std::string>( ) );
132  QtDisplayPanelGui( const QtDisplayPanelGui *other, QWidget *parent=0, std::string rcstr="dpg",
133  const std::list<std::string> &args = std::list<std::string>( ) );
134 
135  public:
137 
139 
140  // access to our viewer
141  QtViewer *viewer( ) const {
142  return v_;
143  }
144  int buttonToolState(const std::string &tool) const;
145 
146  // access our logger...
148  return logger;
149  }
150 
151  // enter status information...
152  void status( const std::string &s, const std::string &type="info" );
153 
154  // access to graphics panel 'base'....
156  const QtDisplayPanel* displayPanel() const { return qdp_; }
157 
158  typedef std::list<viewer::Region*> region_list_t;
160  return regionDock_ ? regionDock_->regions( ) : std::list<viewer::Region*>( );
161  }
162  // region coupling between QtRegionDock and QtRegionSource(s)...
164  // may be null at destruction time...
165  if ( qdp_ ) qdp_->revokeRegion(r);
166  }
167 
168 
169  // public toolbars, for inserting custom buttons.
170  QToolBar* customToolBar; //# limited room
171  QToolBar* customToolBar2; //# wider -- in its own row.
172 
173  virtual void setStatsPrint(bool printStats=true) {
174  qdp_->printStats = printStats;
175  }
176 
177  virtual void setUseRegion(bool useRegion=true) {
178  qdp_->useRegion = useRegion;
179  }
180 
181  virtual bool supports( SCRIPTING_OPTION option ) const;
182  virtual QVariant start_interact( const QVariant &input, int id );
183  virtual QVariant setoptions( const QMap<QString,QVariant> &input, int id);
184 
185  // At least for now, colorbars can only be placed horizontally or
186  // vertically, identically for all display panels.
187  // This returns the current value.
189  return colorBarsVertical_;
190  }
191 
192  //# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
193  //# DisplayData functionality brought down from QtViewerBase
194  //# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
195  // Create a new QtDD from given parameters, and add to internal DD list.
196  // (For now) QtViewerBase retains 'ownership' of the QtDisplayData; call
197  // removeDD(qdd) to delete it.
198  // Unless autoregister is set false, all open DisplayPanels will
199  // register the DD for display.
200  // Check return value for 0, or connect to the createDDFailed()
201  // signal, to handle failure.
203  bool autoRegister=true, int insertPosition = -1,
204  bool masterCoordinate = false, bool masterSaturation = false,
205  bool masterHue = false,
208 
209  // Removes the QDD from the list and deletes it (if it existed --
210  // Return value: whether qdd was in the list in the first place).
211  virtual bool removeDD(QtDisplayData*& qdd);
212 
213  // retrieve a copy of the current DD list.
214  //casacore::List<QtDisplayData*> dds() { return qdds_; }
217  bool isEmptyDD() const;
218  // return the number of user DDs.
219  //int nDDs() { return qdds_.len(); }
220 
221  // return a list of DDs that are registered on some panel.
222  //casacore::List<QtDisplayData*> registeredDDs();
223 
224  // return a list of DDs that exist but are not registered on any panel.
225  std::list<QtDisplayData*> unregisteredDDs();
226 
227  // retrieve a DD with given name (0 if none).
228  QtDisplayData* dd(const std::string& name);
229  // retrieve the controlling DD...
230  QtDisplayData* dd( );
231 
232  // Check that a given DD is on the list. Use qdd pointer or its name.
233  //<group>
234  bool ddExists(QtDisplayData* qdd);
235  //bool ddExists(const casacore::String& name) { return dd(name)!=0; }
236  //</group>
237 
238  // Latest error (in createDD, etc.)
240  return errMsg_;
241  }
242 
243  //# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
244  //# DisplayData functionality brought down from QtViewerBase
245  //# ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
246 
247  // the QtDBusViewerAdaptor can handle loading & registering data itself,
248  // but to connect up extra functionality, the upper-level QtDisplayPanelGui
249  // (or in the current case, the derived QtCleanPanelGui) would have to be
250  // notified that data has been added. This will allow it to set up the
251  // callbacks for drawing regions...
252  virtual void addedData( QString type, QtDisplayData * );
253 
255  return qdm_;
256  }
257 
258  // return the id for viewer state for this type of panel
259  virtual std::string rcid( ) const {
260  return rcid_;
261  }
262 
264  return regionDock_;
265  }
266  int numFrames( );
267 
268  // load casa (or DS9?) region files...
269  void loadRegions( const std::string &path, const std::string &datatype );
270  // zero length string indicates OK!
271  std::string outputRegions( std::list<viewer::QtRegionState*> regions, std::string file, std::string format, std::string ds9_csys="pixel" );
272 
273  bool useNewRegions( ) const {
274  return use_new_regions;
275  }
276 
277  // called to indicate application activation state... true -> activated, false -> deactivated
278  void activate( bool );
279 
280  // display cursor information for the specified point (in world coordinates)
282  typedef std::pair<QString, std::shared_ptr<casacore::ImageInterface<float> > > OverplotInterface;
283 
284 #if defined(WITHOUT_DBUS)
285  // Hold and release of refresh. In order to draw, every call to hold()
286  // must be accompanied by a subsequent call to release() (so don't
287  // neglect: beware of exceptions, e.g.). Calls can nest (they are
288  // counted). Panel may be deleted in a held state. Also, excess calls
289  // to release() will have no effect. The calls are propagated to the main
290  // PanelDisplay as well as to those used for color bars (and thence to
291  // their WorldCanvases).
292  //<group>
293  void hold( ) { displayPanel( )->hold( ); }
294  void release( ) { displayPanel( )->release( ); }
295  //</group>
296 #endif
297 
298  public slots:
299 
300  // At least for now, colorbars can only be placed horizontally or vertically,
301  // identically for all display panels. This sets that state for everyone.
302  // Sends out colorBarOrientationChange signal when the state changes.
303  virtual void setColorBarOrientation(bool vertical);
304 
305  virtual QtDisplayPanelGui *createNewPanel( );
306 
307  virtual void showDataManager();
308  virtual void hideDataManager();
309 
310  virtual void showExportManager();
311  virtual void hideExportManager();
312 
313  virtual void showDataOptionsPanel();
314  virtual void hideDataOptionsPanel();
315 
316  virtual void showPreferences( );
317 
318  virtual void removeAllDDs();
319 
320  // Show/hide display panel's auxiliary windows.
321  //<group>
322  virtual void showPrintManager();
323  virtual void hidePrintManager();
324 
325  virtual void showCanvasManager();
326  virtual void hideCanvasManager();
327 
328  virtual void showRegionManager();
329  virtual void hideRegionManager();
330 
331  virtual void showShapeManager();
332  virtual void hideShapeManager();
333 
334  virtual void showAnnotatorPanel();
335  virtual void hideAnnotatorPanel();
336 
337  virtual void showFileBoxPanel();
338  virtual void hideFileBoxPanel();
339 
340  virtual void showMakeRegionPanel();
341  virtual void hideMakeRegionPanel();
342 
343  virtual void showImageProfile();
344  virtual void hideImageProfile();
345  virtual void refreshImageProfile();
346  void resetImageProfile();
347 
348  virtual void hideAllSubwindows();
349  virtual void hideImageMenus();
350 
351  //Increments the channel in the images from the start channel
352  //to the end channel.
353  void movieChannels( int startChannel, int endChannel );
354  void movieChannels( int channel, bool forward, int stepSize, int channelStart, int channelEnd );
355  void movieStop();
356  void registerAllDDs();
357  void unregisterAllDDs();
358  virtual void showStats(const casacore::String&);
359  virtual void hideStats();
360  //</group>
361 
362  // add a new DD
363  virtual QtDisplayData* addDD(casacore::String path, casacore::String dataType, casacore::String displayType, bool autoRegister=true, bool tmpDtata=false, std::shared_ptr<casacore::ImageInterface<float> > img = std::shared_ptr<casacore::ImageInterface<float> >());
364  // go to a specifc channel
365  virtual void doSelectChannel(int channelIndex);
366 
367  // (Attempts to) restore panel state from named file.
368  virtual bool restorePanelState(casacore::String filename);
369 
370  virtual void trackingMoved(Qt::DockWidgetArea);
371  virtual void animatorMoved(Qt::DockWidgetArea);
372  virtual void regionMoved(Qt::DockWidgetArea);
373  virtual void mousetoolbarMoved(bool);
374 
375  // note that 'key' is prefixed with something like "viewer.dpg."...
376  // for both get and put...
377  std::string getrc( const std::string &key );
378  void putrc( const std::string &key, const std::string &val );
381  void disconnectHistogram();
382  void ddClose( QtDisplayData*& removeDD);
383  void ddOpen( const casacore::String& path, const casacore::String& dataType,
384  const casacore::String& displayType, int insertPosition = -1,
385  bool register = true, bool masterCoordinate = false,
386  bool masterSaturation = false, bool masterHue = false);
387 
388  // retrieve the identifier string for this QtDisplayPanelGui...
389  std::string id( ) const {
390  return id_;
391  }
392 
395 
396  signals:
397 
398  void regionChange( viewer::Region *, std::string );
399 
400  void axisToolUpdate( QtDisplayData *controlling_dd );
401 
403 
404  //Notification that the frame has changed.
405  void frameChanged( int );
406 
407  //Profile Overplots
408  void overlay(QList<OverplotInterface>);
409 
411  casacore::String displayType);
412 
413  // The DD now exists, and is on QtViewerBase's list.
414  // autoregister tells DPs whether they are to register the DD.
415  // ***** dd is added to the world canvas holder during *****
416  // ***** the processing of this event... *****
417  void ddCreated(QtDisplayData*, bool autoRegister, int insertPosition, bool csMaster);
418 
419  // The DD is no longer on QtViewerBase's list, but is not
420  // destroyed until after the signal.
421  // ***** dd is removed from the world canvas holder *****
422  // ***** during the processing of this event... *****
423  //void ddRemoved(QtDisplayData*);
424 
425  void closed( const QtDisplayPanelGui * );
426 
429 
430  protected slots:
431 
432  virtual void close( );
433 
434  virtual void quit( );
435 
436  //# overrides of base QMainWindow slots
437 
438  void hideEvent(QHideEvent* ev) {
439  // Note: If the display panel is iconified or the user changes
440  // desktops, isVisible() will remain true here (surprising, but
441  // useful -- see isVisible() doc). Otherwise, in this context,
442  // [I believe] we can assume the display panel has been _closed_;
443  // in that case, we want to 'close' the auxiliary windows as well.
444  // (Note that there is no 'closeEvent' per se).
445  if(!isVisible()) hideAllSubwindows();
446 
447  QMainWindow::hideEvent(ev);
448  }
449 
450 
451  //# purely internal slots
452 
453  /* virtual void toggleAnimExtras_(); */
454  /* virtual void setAnimExtrasVisibility_(); */
455 
456  //# slots reacting to signals from the basic QtDisplayPanel.
457  //# Protected, connected by this object itself.
458 
459  // Respond to QDP::registrationChange() signal
460  virtual void ddRegChange_();
461 
462  // Respond to registration/close menu clicks.
463  //<group>
464  virtual void ddRegClicked_();
465  virtual void ddUnregClicked_();
466  virtual void ddCloseClicked_();
467  //</group>
468 
469  // Reflect animator state [changes] in gui.
470  virtual void updateAnimUi_();
471 
472  // These react to fwd/reverse Play buttons. They allow a single
473  // play button to be used to toggle between play and stop.
474  //<group>
475  virtual void fwdPlayChannelMovie_( ) {
476  if(qdp_->animating()>0) qdp_->stopChannelMovie( );
477  else qdp_->fwdPlayChannelMovie( );
478  }
479  virtual void fwdPlayImageMovie_( ) {
480  if(qdp_->animating()>0) qdp_->stopImageMovie( );
481  else qdp_->fwdPlayImageMovie( );
482  }
483 
484  virtual void revPlayChannelMovie_( ) {
485  if(qdp_->animating()<0) qdp_->stopChannelMovie( );
486  else qdp_->revPlayChannelMovie( );
487  }
488  virtual void revPlayImageMovie_() {
489  if(qdp_->animating()<0) qdp_->stopImageMovie( );
490  else qdp_->revPlayImageMovie();
491  }
492  //</group>
493 
494 
495  // Display tracking data gathered by underlying panel.
496  virtual void displayTrackingData_(casacore::Record trackingRec);
497 
498  // Reacts to QDP registration change signal. If necessary, changes
499  // the set of cursor position tracking boxes being displayed in
500  // trkgWidget_ (creating new TrackBoxes as necessary). A TrackBox
501  // will be shown for each qdd in qdp_->registeredDDs() where
502  // qdd->usesTracking() (in registration order).
503  virtual void arrangeTrackBoxes_();
504 
505  // Deletes the TrackBox for the given QDD, if it exists. (Deletion
506  // automatically removes it from the trkgWidget_ and its layout).
507  // Connected to the ddRemoved() signal of QtViewerBase.
508  virtual void deleteTrackBox_(QtDisplayData* qdd);
509 
510 
511 
512  // Brings up dialog for saving display panel state: reg'd DDs, their
513  // options, etc. Triggered by dpSaveAct_.
514  virtual void savePanelState_();
515 
516  // Brings up dialog for restore file, attempts restore.
517  // Triggered by dpRstrAct_.
518  virtual void restorePanelState_();
519 
520 
521  // Responds to qdp_->creatingRstrDoc(QDomDocument*) signal.
522  // (Recall that qdp_ is unaware of this gui).
523  // Adds gui state to the QDomDocument qdp has created.
524  virtual void addGuiState_(QDomDocument*);
525 
526  // Responds to qdp_->restoring(QDomDocument*) signal.
527  // Sets gui-specific state (most notably, overall window size).
528  virtual void restoreGuiState_(QDomDocument*);
529 
530  protected:
531 
534 
535  // Existing user-visible QDDs
536  //casacore::List<QtDisplayData*> qdds_;
537  std::shared_ptr<DisplayDataHolder> displayDataHolder;
539 
540 
541  QtDataManager* qdm_; //# The window for loading data.
542  QtExportManager* qem_; //# The window for exporting images.
543  QtDataOptionsPanel* qdo_; //# The window for controlling data display.
544 
545  // Keeps current data directory in sync between
546  // casacore::DataManager window and save-restore dialogs.
547  virtual bool syncDataDir_(casacore::String filename);
548 
549  virtual void updateDDMenus_(bool doCloseMenu = true);
550 
551 
552  // scripted (via dbus) panels should override the closeEvent( ) and hide the gui
553  // instead of deleting it when it was created via a dbus script...
554  void closeEvent(QCloseEvent *event);
555 
556  //# ----------------------------DATA----------------------------------
557 
558  // At least for now, colorbars can only be placed horizontally or vertically,
559  // identically for all display panels. Here is where that state is kept for
560  // everyone.
562 
563  QtViewer* v_; //# (Same viewer as qdp_'s)
564  QtDisplayPanel* qdp_; //# Central Widget this window operates.
565  QtViewerPrintGui* qpm_; //# Print dialog for this display panel.
566  QtCanvasManager* qcm_; //# display panel options window.
567  //QtAnnotatorGui* qap_;
571  QtRegionManager* qrm_; //# Region manager window.
572  QtRegionShapeManager* qsm_; //# Region shape manager window.
573  QTextEdit* qst_;
574 
575 
576  QtProfile* profile_; //# Profile window
577  casacore::String savedTool_; //# (for restoring left button)
578  QtDisplayData* profileDD_; //# QDD currently being profiled
579  //# (0 if profiler is not showing).
580 
581  //# GUI LAYOUT
582 
584 
586  *ddOpenAct_, *ddSaveAct_, *ddAdjAct_,/* *ddRegAct_, *ddCloseAct_,*/ *unzoomAct_,
590  *aboutAct_;
591 
592  QToolBar* mainToolBar_;
593  QToolButton *ddRegBtn_, *ddCloseBtn_;
594 
596 
597  // connection to rc file
599  // rc id for this panel type
600  std::string rcid_;
601 
602  private:
606  void construct_( QtDisplayPanel *newpanel, const std::list<std::string> &args );
607 
608  void animationModeChanged( bool modeZ, bool channelCubes);
609 
611 
612  //Animating the channel
618 
619  QTimer movieTimer;
620  void setAnimationRate();
621  int getBoundedChannel( int channelNumber ) const;
622  void updateViewedImage();
623  void profiledImageChange();
626 
627  void clearTools();
629  QtDisplayPanelGui() : rc(viewer::getrc()), linkedCursorHandler(0) { } // (not intended for use)
631  casacore::String displayType, bool autoRegister, int insertPosition,
632  bool masterCoordinate, bool masterSaturation, bool masterHue,
635  void notifyDDRemoval( QtDisplayData* qdd );
636  //Management of the controlling DD
638  //void setControllingDD( QtDisplayData* controlDD );
639 
640 
641  //Methods for letting the animator know whether it should display
642  //the image/channel animator(s) based on the number of images and
643  //and the number of channels in the images.
644  void updateFrameInformation();
647 
648  void updateSliceCorners( int id, const QList<double>& worldX,
649  const QList<double>& worldY );
650  void initAnimationHolder();
651  void initHistogramHolder();
652  void hideHistogram();
653  void initFit2DTool();
654  void hideFit2DTool();
655  void resetHistogram( viewer::Region* qtRegion );
656  viewer::Region* findRegion( int id );
657 
659 
664 
669  std::shared_ptr<ImageManagerDialog> imageManagerDialog;
671 
672  // interactive clean...
673  void initCleanTool( );
675 
676 
677  //Docking/Dock Widgets
678  string addAnimationDockWidget();
679 
680  QDockWidget* histogramDockWidget_;
683 
687 
689 
690  std::string id_;
691  static std::string idGen( );
692 
693  private slots:
694  void to_image_mode( bool channelCubes );
695  void to_channel_mode( );
696  void loadRegions( const QString &path, const QString &type );
697  void incrementMovieChannel();
698  void clear_status_bar( );
699  void reset_status_bar( );
701  void initializeProfile( );
702  void showHistogram();
703  void showAboutDialog();
704  void showSlicer();
705  void resetListenerImage();
707  void showFitInteractive();
708  void showCleanTool( );
709  void addSkyComponentOverlay(casacore::String path, const QString& colorName);
711  void add2DFitOverlay( QList<RegionShape*> fitMarkers );
712  void remove2DFitOverlay( QList<RegionShape*> fitMarkers );
714  virtual void addDDSlot(casacore::String path, casacore::String dataType, casacore::String displayType,
715  bool autoRegister=true, bool tmpData=false,
716  std::shared_ptr<casacore::ImageInterface<float> > img = std::shared_ptr<casacore::ImageInterface<float> >());
717  void sliceChanged( int regionId, viewer::region::RegionChanges change,
718  const QList<double> & worldX, const QList<double> & worldY,
719  const QList<int> &pixelX, const QList<int> & pixelY );
720  void addSlice( int id, const QString& shape, const QString&, const QList<double>& worldX,
721  const QList<double>& worldY, const QList<int>& pixelX, const QList<int>& pixelY,
722  const QString&, const QString&, const QString&, int, int);
723  void showColorHistogram(QtDisplayData* displayData);
724  void globalColorSettingsChanged( bool global );
725  void globalOptionsChanged( QtDisplayData* originator, casacore::Record opts );
726  void updateColorHistogram( const QString& ddName );
727  void showImageManager();
728  void sliceMarkerVisibilityChanged(int regionId, bool visible);
729  void sliceMarkerPositionChanged(int regionId, int segmentIndex, float percentage);
742  void animationImageChanged( int index );
743 
744  void registerDD( QtDisplayData* dd, int position );
745  void unregisterDD( QtDisplayData* dd );
746  // used to manage generation of the updateAxes( ) signal...
747  void replaceControllingDD( QtDisplayData* oldControllingDD, QtDisplayData* newControllingDD);
748 
749  //Change the image that is being viewed in the blink
750  //animator.
751  void setAnimatedImage( int index );
752  void createRGBImage( QtDisplayData* coordinateMaster,
753  QtDisplayData* redImage, QtDisplayData* greenImage,
754  QtDisplayData* blueImage );
755 
756 
757  public:
758 
759  // true by default. Set false to disable auto-raise of the Data
760  // Options panel whenever the first DD is created.
761  //# Users want to see this panel automatically when there are DDs
762  //# to tweak. (Apps like clean can turn v_->autoOptionsRaise off,
763  //# if desired (yes, is is (gasp!) public data)).
765 
766  // Intended for use only by QtDataManager (or other data dialogs such as for
767  // save-restore), to inform QtDisplayPanel of the directory currently
768  // selected for data retrieval, if any ("" if none).
770 
771  };
772 
773 
774  namespace viewer {
775  namespace hidden {
776  // Qt's meta object features not supported for nested classes...
777  // so this class cannot be nested in QtDisplayPanelGui...
778  class display_panel_gui_status : public QStatusBar {
779  Q_OBJECT;
780  public:
781  display_panel_gui_status( QWidget *parent = 0 ) : QStatusBar(parent) { }
783  signals:
784  void enter( );
785  void leave( );
786 
787  protected:
788  void enterEvent( QEvent* );
789  void leaveEvent( QEvent* );
790  };
791  }
792  }
793 
794 
795 } //# NAMESPACE CASA - END
796 
797 #endif
viewer::QtRegionDock * regionDock_
virtual bool supports(SCRIPTING_OPTION option) const
void to_image_mode(bool channelCubes)
AnimatorHolder * animationHolder
Dock widget which manages the cursor tracking dialogs...
QtDisplayData * createDD(casacore::String path, casacore::String dataType, casacore::String displayType, bool autoRegister=true, int insertPosition=-1, bool masterCoordinate=false, bool masterSaturation=false, bool masterHue=false, const viewer::DisplayDataOptions &ddo=viewer::DisplayDataOptions(), const viewer::ImageProperties &props=viewer::ImageProperties())
Create a new QtDD from given parameters, and add to internal DD list.
virtual void showExportManager()
virtual void hideDataOptionsPanel()
Class which stores WorldCanvas refresh event information.
void animationImageChanged(int index)
Written in response to CAS-5101.
virtual void addGuiState_(QDomDocument *)
Responds to qdp_-&gt;creatingRstrDoc(QDomDocument*) signal.
virtual void ddRegClicked_()
Respond to registration/close menu clicks.
void cursorPosition(viewer::Position)
void construct_(QtDisplayPanel *newpanel, const std::list< std::string > &args)
portion of construction shared by multiple constructor functions...
std::string outputRegions(std::list< viewer::QtRegionState * > regions, std::string file, std::string format, std::string ds9_csys="pixel")
zero length string indicates OK!
DisplayDataHolder::DisplayDataIterator endDD() const
virtual void showPrintManager()
Show/hide display panel&#39;s auxiliary windows.
virtual void regionMoved(Qt::DockWidgetArea)
LinkedCursorEH * linkedCursorHandler
void showColorHistogram(QtDisplayData *displayData)
std::string getrc(const std::string &key)
note that &#39;key&#39; is prefixed with something like &quot;viewer.dpg.&quot;...
Qt implementation of main viewer supervisory object – Gui level.
Definition: QtViewer.qo.h:79
void removeSkyComponentOverlay(casacore::String path)
LinkedCursorEH(QtDisplayPanelGui *dpg)
virtual void showCanvasManager()
void activate(bool)
called to indicate application activation state...
virtual void hideFileBoxPanel()
virtual void hideCanvasManager()
virtual void doSelectChannel(int channelIndex)
go to a specifc channel
virtual void hideShapeManager()
viewer::QtRegionDock * regionDock()
virtual void fwdPlayChannelMovie_()
These react to fwd/reverse Play buttons.
void axisToolUpdate(QtDisplayData *controlling_dd)
virtual void stopImageMovie()
std::list< QtDisplayData * > unregisteredDDs()
return the number of user DDs.
virtual Type type()
Return the type enum.
void controlling_dd_axis_change(casacore::String, casacore::String, casacore::String, std::vector< int >)
void cursorBoundary(QtDisplayPanel::CursorBoundaryCondition)
virtual casacore::String errMsg()
bool ddExists(const casacore::String&amp; name) { return dd(name)!=0; }
virtual void hidePrintManager()
virtual void displayTrackingData_(casacore::Record trackingRec)
Display tracking data gathered by underlying panel.
virtual void showDataOptionsPanel()
bool colorBarsVertical()
At least for now, colorbars can only be placed horizontally or vertically, identically for all displa...
void histogramRegionChange(int, viewer::region::RegionChanges change=viewer::region::RegionChangeLabel)
void movieChannels(int startChannel, int endChannel)
Increments the channel in the images from the start channel to the end channel.
QToolBar * customToolBar
public toolbars, for inserting custom buttons.
virtual void showRegionManager()
QtDisplayData * processDD(casacore::String path, casacore::String dataType, casacore::String displayType, bool autoRegister, int insertPosition, bool masterCoordinate, bool masterSaturation, bool masterHue, QtDisplayData *qdd, const viewer::DisplayDataOptions &ddo=viewer::DisplayDataOptions())
void removeSource(QtDisplayPanelGui *src)
MakeMask * qap_
QtAnnotatorGui* qap_;.
std::shared_ptr< ImageManagerDialog > imageManagerDialog
void updateFrameInformation()
void setControllingDD(QtDisplayData* controlDD);
virtual QtDisplayData * addDD(casacore::String path, casacore::String dataType, casacore::String displayType, bool autoRegister=true, bool tmpDtata=false, std::shared_ptr< casacore::ImageInterface< float > > img=std::shared_ptr< casacore::ImageInterface< float > >())
add a new DD
viewer::Region * findRegion(int id)
ostream-like interface to creating log messages.
Definition: LogIO.h:167
virtual QtDisplayPanelGui * createNewPanel()
Displays a histogram that allows the user to set the color scale for an image.
virtual void updateAnimUi_()
Reflect animator state [changes] in gui.
virtual void animatorMoved(Qt::DockWidgetArea)
virtual bool syncDataDir_(casacore::String filename)
Keeps current data directory in sync between casacore::DataManager window and save-restore dialogs...
virtual void showPreferences()
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
virtual bool removeDD(QtDisplayData *&qdd)
Removes the QDD from the list and deletes it (if it existed – Return value: whether qdd was in the li...
virtual void savePanelState_()
Brings up dialog for saving display panel state: reg&#39;d DDs, their options, etc.
void globalColorSettingsChanged(bool global)
void updateSliceCorners(int id, const QList< double > &worldX, const QList< double > &worldY)
Manages the Animator display on the viewer that allows users to scroll through either the channels wi...
void createDDFailed(casacore::String errMsg, casacore::String path, casacore::String dataType, casacore::String displayType)
DisplayDataList::const_iterator DisplayDataIterator
void sliceMarkerVisibilityChanged(int regionId, bool visible)
virtual void hideImageMenus()
virtual void ddRegChange_()
Respond to QDP::registrationChange() signal.
QtDisplayPanelGui * dpg_
virtual void setColorBarOrientation(bool vertical)
At least for now, colorbars can only be placed horizontally or vertically, identically for all displa...
std::string rcid_
rc id for this panel type
virtual std::string rcid() const
return the id for viewer state for this type of panel
CursorTrackingHolder * trkgDockWidget_
virtual void deleteTrackBox_(QtDisplayData *qdd)
Deletes the TrackBox for the given QDD, if it exists.
virtual QVariant start_interact(const QVariant &input, int id)
void setAnimatedImage(int index)
Change the image that is being viewed in the blink animator.
virtual void hold()
Hold and release of refresh.
Base class for handling WorldCanvas refresh events.
Definition: WCRefreshEH.h:95
virtual void showAnnotatorPanel()
virtual void showStats(const casacore::String &)
void addSkyComponentOverlay(casacore::String path, const QString &colorName)
Used when the histogram needs to come up as a main window.
void connectRegionSignals(PanelDisplay *ppd)
virtual void fwdPlayImageMovie()
std::string id() const
retrieve the identifier string for this QtDisplayPanelGui...
virtual void setUseRegion(bool useRegion=true)
virtual bool restorePanelState(casacore::String filename)
(Attempts to) restore panel state from named file.
QtRegionShapeManager * qsm_
int movieChannel
Animating the channel.
void ddOpen(const casacore::String &path, const casacore::String &dataType, const casacore::String &displayType, int insertPosition=-1, bool register=true, bool masterCoordinate=false, bool masterSaturation=false, bool masterHue=false)
virtual void hideAnnotatorPanel()
void unregisterDD(QtDisplayData *dd)
void ddClose(QtDisplayData *&removeDD)
void unlinkCursorTracking(QtDisplayPanelGui *)
virtual void hideImageProfile()
void generateHistogramRegionUpdates()
void globalOptionsChanged(QtDisplayData *originator, casacore::Record opts)
virtual void revPlayImageMovie()
All regions are specified in &quot;linear coordinates&quot;, not &quot;pixel coordinates&quot;.
Definition: Region.qo.h:147
void remove2DFitOverlay(QList< RegionShape * > fitMarkers)
void overlay(QList< OverplotInterface >)
Profile Overplots.
void linkCursorTracking(QtDisplayPanelGui *, QColor)
std::pair< QString, std::shared_ptr< casacore::ImageInterface< float > > > OverplotInterface
casacore::String selectedDMDir
Intended for use only by QtDataManager (or other data dialogs such as for save-restore), to inform QtDisplayPanel of the directory currently selected for data retrieval, if any (&quot;&quot; if none).
QtDisplayData * lookForExistingController()
Management of the controlling DD.
Displays information to the user about the viewer.
virtual void addDDSlot(casacore::String path, casacore::String dataType, casacore::String displayType, bool autoRegister=true, bool tmpData=false, std::shared_ptr< casacore::ImageInterface< float > > img=std::shared_ptr< casacore::ImageInterface< float > >())
virtual void updateDDMenus_(bool doCloseMenu=true)
void updateFrameInformationChannel()
void regionChange(viewer::Region *, std::string)
std::string path(const std::string &name)
void status(const std::string &s, const std::string &type="info")
enter status information...
virtual void hideExportManager()
void updateMultiSpectralFitLocation(casacore::Record trackingRec)
virtual void trackingMoved(Qt::DockWidgetArea)
bool isEmptyDD() const
virtual void release()
The main display window for the Qt version of the viewer.
virtual void ddCloseClicked_()
std::list< Region * > regions() const
std::shared_ptr< DisplayDataHolder > displayDataHolder
Existing user-visible QDDs casacore::List&lt;QtDisplayData*&gt; qdds_;
unsigned int showdataoptionspanel_enter_count
void updateColorHistogram(const QString &ddName)
void frameChanged(int)
Notification that the frame has changed.
void replaceControllingDD(QtDisplayData *oldControllingDD, QtDisplayData *newControllingDD)
used to manage generation of the updateAxes() signal...
virtual void showFileBoxPanel()
This class provides a priori image information derived from the image itself.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
void operator()(const WCRefreshEvent &ev)
original handler interface (still used for WCRefreshEvents)
QMenu * ddCloseMenu_
ddRegMenu_,
void sliceMarkerPositionChanged(int regionId, int segmentIndex, float percentage)
virtual void restoreGuiState_(QDomDocument *)
Responds to qdp_-&gt;restoring(QDomDocument*) signal.
void hideEvent(QHideEvent *ev)
virtual void revPlayChannelMovie()
void putrc(const std::string &key, const std::string &val)
void updateCursorInfo(WorldCanvas *wc, casacore::Quantity x, casacore::Quantity y)
display cursor information for the specified point (in world coordinates)
virtual void arrangeTrackBoxes_()
Reacts to QDP registration change signal.
virtual void hideStats()
string addAnimationDockWidget()
Docking/Dock Widgets.
virtual void close()
virtual void mousetoolbarMoved(bool)
Note: The purpose of the SpecFitMonitor interface is to provide a communications interface between th...
Definition: QtProfile.qo.h:93
void addSource(QtDisplayPanelGui *src, QColor color)
const QtDisplayPanel * displayPanel() const
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
virtual void showDataManager()
void revokeRegion(viewer::Region *r)
region coupling between QtRegionDock and QtRegionSource(s)...
void loadRegions(const std::string &path, const std::string &datatype)
load casa (or DS9?) region files...
virtual void hideDataManager()
CursorBoundaryCondition
included in cursor boundary signals...
DisplayDataHolder::DisplayDataIterator beginDD() const
retrieve a copy of the current DD list.
std::map< QtDisplayPanelGui *, cursor_info_t > sources_list_t
void addSlice(int id, const QString &shape, const QString &, const QList< double > &worldX, const QList< double > &worldY, const QList< int > &pixelX, const QList< int > &pixelY, const QString &, const QString &, const QString &, int, int)
virtual void stopChannelMovie()
virtual void addedData(QString type, QtDisplayData *)
the QtDBusViewerAdaptor can handle loading &amp; registering data itself, but to connect up extra functio...
virtual void hideMakeRegionPanel()
int getBoundedChannel(int channelNumber) const
viewer::CleanGui * clean_tool
virtual void showShapeManager()
virtual void removeAllDDs()
bool colorBarsVertical_
At least for now, colorbars can only be placed horizontally or vertically, identically for all displa...
void boundary(QtDisplayPanel::CursorBoundaryCondition)
virtual void showMakeRegionPanel()
QtDisplayData * dd()
retrieve the controlling DD...
SlicerMainWindow * sliceTool
void animationModeChanged(bool modeZ, bool channelCubes)
casacore::LogIO & logIO()
access our logger...
void createRGBImage(QtDisplayData *coordinateMaster, QtDisplayData *redImage, QtDisplayData *greenImage, QtDisplayData *blueImage)
void sliceChanged(int regionId, viewer::region::RegionChanges change, const QList< double > &worldX, const QList< double > &worldY, const QList< int > &pixelX, const QList< int > &pixelY)
QtDisplayPanel * displayPanel()
access to graphics panel &#39;base&#39;....
void addResidualFitImage(casacore::String path)
QtViewer * viewer() const
access to our viewer
AboutDialogViewer * aboutDialog
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
virtual void ddUnregClicked_()
void initCleanTool()
interactive clean...
const Double c
Fundamental physical constants (SI units):
void notifyDDRemoval(QtDisplayData *qdd)
void closed(const QtDisplayPanelGui *)
The DD is no longer on QtViewerBase&#39;s list, but is not destroyed until after the signal.
A class which creates and manages &quot;panelled&quot; displays.
Definition: PanelDisplay.h:79
virtual void showImageProfile()
void registerDD(QtDisplayData *dd, int position)
void resetHistogram(viewer::Region *qtRegion)
virtual QVariant setoptions(const QMap< QString, QVariant > &input, int id)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void fwdPlayChannelMovie()
void revokeRegion(viewer::Region *r)
new Region code – revoke region from region source...
void ddCreated(QtDisplayData *, bool autoRegister, int insertPosition, bool csMaster)
The DD now exists, and is on QtViewerBase&#39;s list.
virtual void setStatsPrint(bool printStats=true)
std::list< viewer::Region * > region_list_t
bool autoDDOptionsShow
true by default.
bool ddExists(QtDisplayData *qdd)
Check that a given DD is on the list.
int buttonToolState(const std::string &tool) const
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
void position(viewer::Position)
static std::string idGen()
void showMomentsCollapseImageProfile()
virtual ~LinkedCursorEH()
viewer::ViewerPreferences * preferences
virtual void hideAllSubwindows()
QtDataOptionsPanel * qdo_
Qt&#39;s meta object features not supported for nested classes...
casacore::Casarc & rc
connection to rc file
Why not use casacore::MDirection? It&#39;s limited by valid astronomical coordinates on the sky Hz vs arc...
Definition: Position.h:41
virtual void hideRegionManager()
virtual void refreshImageProfile()
virtual void restorePanelState_()
Brings up dialog for restore file, attempts restore.
void closeEvent(QCloseEvent *event)
scripted (via dbus) panels should override the closeEvent() and hide the gui instead of deleting it w...
void add2DFitOverlay(QList< RegionShape * > fitMarkers)
Defines nreal time structures used by the VLA table filler.
Definition: nreal.h:100
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42