casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QtDisplayPanel.qo.h
Go to the documentation of this file.
1 //# QtDisplayPanel.qo.h: Qt implementation of viewer display Widget.
2 //# Copyright (C) 2005
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 QTDISPLAYPANEL_H
29 #define QTDISPLAYPANEL_H
30 
31 #include <casa/aips.h>
33 #include <list>
47 
48 #include <stack>
49 
50 #include <graphics/X11/X_enter.h>
51 # include <QtCore>
52 # include <QtGui>
53 # include <QTimer>
54 # include <QDebug>
55 # include <QtXml>
56 #include <graphics/X11/X_exit.h>
57 
58 
59 namespace casa { //# NAMESPACE CASA - BEGIN
60 
61 
62  class QtDisplayPanelGui;
63  class QtDisplayData;
64  class DisplayData;
65  class PCITFiddler;
66 //class MWCCrosshairTool;
67  class MWCPannerTool;
68  class MWCPolylineTool;
69  class MWCRulerlineTool;
70  class MWCPositionVelocityTool;
71 //class MWCPTRegion;
72  class DParameterChoice;
73  class RegionShape;
74  class QtRegionShapeManager;
75 
76  namespace viewer {
77  class RegionToolManager;
78  class Region;
79  }
80 
81  class QtDisplayPanel : public QWidget,
82  public WCMotionEH, public PCPositionEH, public ImageDisplayer {
83 
84  Q_OBJECT //# Allows slot/signal definition. Must only occur in
85  //# implement/.../*.h files; also, makefile must include
86  //# name of this file in 'mocs' section.
87 
88  public:
89 
90  // included in cursor boundary signals...
92 
93  class panel_state {
94  public:
95 
97  public:
98  colormap_state( const std::string &n, const casacore::Vector<float> &s, const casacore::Vector<float> &b ) : name_(n), shift_(s), brightness_(b) { }
99  colormap_state( const colormap_state &other ) : name_(other.name_), shift_(other.shift_), brightness_(other.brightness_) { }
100  const std::string &name( ) const {
101  return name_;
102  }
103  const casacore::Vector<float> &shift( ) const {
104  return shift_;
105  }
107  return brightness_;
108  }
109  const std::string &colormap( ) const {
110  return name_;
111  }
112  private:
113  std::string name_;
116  };
117 
118  typedef std::pair<casacore::Vector<double>,casacore::Vector<double> > zoom_state;
119  typedef std::map<std::string,colormap_state> colormap_map;
120 
121  panel_state( const panel_state &other ) : zoom_(other.zoom_) { }
122  const casacore::Vector<double> &blc( ) const {
123  return zoom_.first;
124  }
125  const casacore::Vector<double> &trc( ) const {
126  return zoom_.second;
127  }
128  const colormap_state *colormap( const std::string &s ) const;
129 
130  private:
131  panel_state( const zoom_state &z_, const colormap_map &cm ) : zoom_(z_), colormaps_(cm) { }
132 
135 
136  friend class QtDisplayPanel;
137  };
138 
139  QtDisplayPanel( QtDisplayPanelGui *panel, const QtDisplayPanel *other, QWidget* parent=0,
140  const std::list<std::string> &args = std::list<std::string>( ) );
141  QtDisplayPanel( QtDisplayPanelGui *panel, QWidget* parent=0,
142  const std::list<std::string> &args = std::list<std::string>( ) );
143 
144  ~QtDisplayPanel();
145 
146  bool isEmptyRegistered() const;
147  int getRegisteredCount() const;
148  //Manipulation of the QtDisplayData's.
152  QtDisplayData* getDD( const std::string& name ) const;
153  QtDisplayData* getDD( const DisplayData *dd ) const;
154  std::shared_ptr<DisplayDataHolder> getDataHolder() const;
155  bool isCoordinateMaster( QtDisplayData* displayData ) const;
156  void setControllingDD( QtDisplayData* controllingDD );
157  // true if DD is on our list. (It may _not_ be on viewer's list
158  // any longer, in particular when reacting to ddRemoved signal).
159  // Either qdd pointer or its name can be given.
160  //<group>
161  virtual bool isRegistered(QtDisplayData*);
162  //</group>
164 
165 
166  //Returns the DD that will be animating the channels
167  //in normal mode.
168  QtDisplayData* getChannelDD( int index ) const;
169 
170  //Reorders panels in response to a change in the registration order.
172 
173  // Return Options record (of margins and no.-of-panels settings, e.g.)
174  // The form of the record is suitable for automatically creating
175  // controlling user interface. These options are set with the
176  // corresponding setOptions() slot (below).
177  virtual casacore::Record getOptions();
178 
179 
180  /* QtViewerBase* viewer() { return v_; } */
181 
182  // Return a QPixmap* with a copy of currently-displayed widget contents.
183  // Caller is responsible for deleting.
184  virtual QPixmap* contents() {
185  return pc_->contents();
186  }
187  virtual QPixmap* getBackBuffer() {
188  return pc_->getBackBuffer();
189  }
190 
191  // Return underlying library PanelDisplay (used by Annotations, e.g.)
192  // (You better know what you're doing if you reach underneath the Qt layer.
193  // You are responsible for consistency between the layers, etc...).
195  return pd_;
196  }
197 
198  // Hold and release of refresh. In order to draw, every call to hold()
199  // must be accompanied by a subsequent call to release() (so don't
200  // neglect: beware of exceptions, e.g.). Calls can nest (they are
201  // counted). Panel may be deleted in a held state. Also, excess calls
202  // to release() will have no effect. The calls are propagated to the main
203  // PanelDisplay as well as to those used for color bars (and thence to
204  // their WorldCanvases).
205  //<group>
206  virtual void hold();
207  virtual void release();
208  //</group>
209 
210  // Return names of resident mouse tools (order is a suggestion
211  // for order in gui).
213  return mouseToolNames_;
214  }
215 
216 
217  // This callback method is automatically registered with the
218  // appropriate objects, and is not intended for general use (it
219  // has a similar role to a protected, self-connected slot).
220  // Overrides (null) base WCMotionEH operator to forward cursor
221  // position tracking events from any of the panel's WorldCanvases
222  // as Qt signals.
223  virtual void operator()(const WCMotionEvent &ev);
224 
225  // This callback method is automatically registered with the
226  // appropriate PC object, and is not intended for general use (it
227  // has a similar role to a protected, self-connected slot).
228  void operator()(const PCPositionEvent &pev) {
229  //# (Its only current role is to toggle a
230  //# freeze of cursor tracking via the space bar).
231  if(pev.key()==Display::K_space) tracking_ = !tracking_;
232  }
233 
234 
235  // Return total number of (main) subpanels (e.g. 12 for 3x4-panel display).
236  int nPanels() {
237  return pd_->nWCHs();
238  }
239 
240 
241  //# animation
242 
243  //# ( Updates to user interface will likely need only these:
244  //# modeZ() (or mode()),
245  //# nFrames(), frame(),
246  //# startFrame(), lastFrame(), step(),
247  //# animRate(), minRate(), maxRate(), animating() ).
248 
249  virtual bool modeZ() {
250  return modeZ_;
251  }
252  virtual casacore::String mode() {
253  return modeZ()? "Normal" : "Blink";
254  }
255 
256  virtual int nFrames() {
257  return modeZ()? nZFrames() : nBFrames();
258  }
259  virtual int nZFrames() {
260  return zLen_;
261  }
262  virtual int nBFrames() {
263  return bLen_;
264  }
265 
266  virtual int frame() {
267  return index();
268  }
269  virtual int index() {
270  return modeZ()? zIndex() : bIndex();
271  }
272  virtual int zIndex() {
273  return zIndex_;
274  }
275  virtual int bIndex() {
276  return bIndex_;
277  }
278 
279  virtual int startFrame() {
280  return modeZ()? zStart() : bStart();
281  }
282  virtual int zStart() {
283  return zStart_;
284  }
285  virtual int bStart() {
286  return bStart_;
287  }
288 
289  virtual int lastFrame() {
290  return endFrame()-1;
291  }
292  virtual int endFrame() {
293  return modeZ()? zEnd() : bEnd();
294  }
295  virtual int zEnd() {
296  return zEnd_;
297  }
298  virtual int bEnd() {
299  return bEnd_;
300  }
301  //# NB: frame() < endFrame() (<--used internally)
302  //# but frame() <= lastFrame() (<--shown in ui)
303 
304  virtual int step() {
305  return modeZ()? zStep() : bStep();
306  }
307  virtual int zStep() {
308  return zStep_;
309  }
310  virtual int bStep() {
311  return bStep_;
312  }
313 
314  virtual int animRate() {
315  return animRate_;
316  }
317  virtual int minRate() {
318  return minRate_;
319  }
320  virtual int maxRate() {
321  return maxRate_;
322  }
323  virtual int animating() {
324  return animating_;
325  }
326 
327 
328 
329 
330  //# region management
331 
332 
333  // Transform origPath to a plausible pathname for a new image region file.
334  // Assures the filename ends in '.rgn' and that no such file already exists.
336 
337  // Save the last region created (via an image DD) with the mouse.
338  // Return value indicates success.
339  // (The casacore::ImageRegion is transformed to a casacore::TableRecord then saved via casacore::AipsIO).
341 
342  // same as above except it is saved in the last registered image as a keyword
343 
345 
346  // Delete the region regname from last registered image
347  // does not care if its casacore::RegionHandler::Masks or casacore::RegionHandler::Regions
349 
350  // give the regions already stored in last dd image
351  // a coma separated list
353  // a vector list
355  // get an casacore::ImageRegion from active Image
357 
358  // Set current extension policy to use to for (subsequent) image region
359  // creation (and for printed region statistics):
360  // 0: Region should apply to viewed plane only.
361  // 1: Extend to all channels (iff spectral axis not on display).
362  // 2: Extend along all non-displayed axes.
363  // (The mouse polygon/rectangle always determines the region on the
364  // displayed axes).
365  //
366  // The default policy is 0.
367  void setRegionExtent(int ext) {
368  rgnExtent_ = casacore::max(0, casacore::min(2, ext ));
369  }
370 
371  // Return the last region created (via an image DD) with the mouse.
373  return lastRgn_;
374  }
375 
376  bool hasRegion() {
377  return hasRgn_;
378  }
379 
380 
381 
382 
383  //# 'region' Shapes (unrelated to mouse regions / ImageRegions;
384  //# more like annotations.)
385 
386 
387  // Sets the region shape manager from QtDisplayPanelGui.
388  void setShapeManager(QtRegionShapeManager* manager);
389 
390  // Register the given RegionShape on this display panel.
392 
393  // Unregister the given RegionShape on this display panel.
395 
396  // Returns true if the given RegionShape is registered on this display panel,
397  // false otherwise.
398  bool isRegistered(RegionShape* rs);
399 
400 
401 
402 
403  //# save-restore
404 
405 
406  // Suggest name for restore file (based on first-registered DD).
408 
409  // Returns an xml casacore::String of displayPanel state. This includes registered
410  // DDs and their options, panel options, animation and zoom state, etc.
411  // (QtDisplayPanelGui adds some gui/window state to this, and has
412  // file-saving interface).
413  // If a restorefilename where you intend to store the state is given, it
414  // will be set as attribute 'restorefile' of the root node. This allows
415  // data files to be moved and still restored later, relative to the restore
416  // file location.
417  casacore::String dpState(casacore::String restorefilename="");
418 
419  // Save panel state to a file (as xml). State is also stored to an
420  // internal lastSavedState_ casacore::String (only there, if filename=="").
421  // By default, the file will be overwritten if necessary.
422  virtual bool savePanelState(casacore::String filename="", bool overwrite=true);
423 
424  // Restore panel state from a file or from lastSavedState_ if filename=="".
425  virtual bool restorePanelState(casacore::String filename="");
426 
427  // set panel state from xml casacore::String (lastSavedState_, by default).
428  virtual bool setPanelState(casacore::String xmlState="");
429 
430  // [re]set panel state from a QDomDocument.
431  virtual bool setPanelState(QDomDocument& restoredoc,
432  QString restorefiledir="");
433 
434  panel_state getPanelState( ) const;
435  void setPanelState( const panel_state & );
436 
437  // *new* Region code -- load casa (or DS9?) region files...
438  void loadRegions( const std::string &path, const std::string &type );
439  // *new* Region code -- revoke region from region source...
440  void revokeRegion( viewer::Region *r );
441 
442  // called to indicate application activation state... true -> activated, false -> deactivated
443  void activate( bool );
444 
445 
446  public slots:
447 
448  //respond to region manager to set casacore::ImageRegion extension
450 
451  // Register / unregister [all] DDs created by user through QtViewer.
452  //<group>
453  virtual void registerDD(QtDisplayData*, int postion = -1);
454  virtual void unregisterDD(QtDisplayData*);
455  virtual void unregisterAll();
456  virtual void registerAll(std::list<QtDisplayData*> registerDatas);
457  //</group>
458 
459  // Set display panel options such as margins or number of panels. The
460  // form of the record (along with current settings) is returned by
461  // getOptions(). (These Records are an older form of 'parameter sets'
462  // which are used in various places within the display library).
463  // Set emitAll = true if the call was not initiated by the options gui
464  // itself (e.g. via scripting or save-restore); that will assure that
465  // the options gui does receive all option updates (via the optionsChanged
466  // signal) and updates its user interface accordingly.
467  virtual void setOptions(casacore::Record opts, bool emitAll=false);
468 
469 
470 
471  //# animation
472 
473  virtual void setMode(bool modez, bool channelCubes = false);
474  virtual void setMode(casacore::String mode) {
475  setMode(downcase(mode)=="normal");
476  }
477 
478  void toChannelMovieStart( ) { goTo( zStart( ) ); }
479  void toImageMovieStart( ) { goTo( bStart( ) ); }
480 
481  virtual void toChannelMovieEnd() {
482  setMode(true);
483  goTo(lastFrame());
484  }
485  virtual void toImageMovieEnd() {
486  setMode(false);
487  goTo(lastFrame());
488  }
489  virtual void revStepChannelMovie( ) {
490  stop_();
491  setMode(true);
492  prev_();
493  }
494  virtual void revStepImageMovie( ) {
495  stop_();
496  setMode(false);
497  prev_();
498  }
499  virtual void fwdStepChannelMovie( ) {
500  stop_();
501  setMode(true);
502  next_();
503  }
504  virtual void fwdStepImageMovie( ) {
505  stop_();
506  setMode(false);
507  next_();
508  }
509  virtual void revPlayChannelMovie( );
510  virtual void revPlayImageMovie( );
511  virtual void fwdPlayChannelMovie( );
512  virtual void fwdPlayImageMovie( );
513  virtual void stopChannelMovie( ); // slots corresp. to tapedeck buttons.
514  virtual void stopImageMovie( );
515 
517  void setChannelMovieRate(int);
518  void setImageMovieRate(int);
519 
520  void lowerBoundAnimatorImageChanged( int );
526 
527 
528  void goToChannel( int channel ) { goToZ(channel); }
529  void goToImage( int image ) { goToB(image); }
530 
531  virtual void goTo(int frm, bool channelFrame=false) {
532  if(modeZ() || channelFrame ) goToZ(frm);
533  else goToB(frm);
534  }
535  //# Note: connected to std Qt signal which takes 'int'.
536  //# As of Qt4.1.3, declaring goTo(int frm) will no longer
537  //# do (which is a bit of a pain...). (Actually, though,
538  //# it is very unclear to me that having casa Ints, Floats,
539  //# et. al. buys us anything at all...).
540  virtual void goToZ(int frm);
541  virtual void goToB(int frm);
542 
543  virtual void emitAnimState() {
544  emit animatorChange();
545  }
546 
547  //# mouse tools
548 
549  // (Will remove mouse-tools' own visual feedback from screen;
550  // usually called after selection has been processed).
551 
552  //<group>
553  virtual void resetRTRegion();
554  virtual void resetPTRegion();
555  virtual void resetETRegion();
556  virtual void resetZoomer(); //# (NB: != unzoom(); no zoom effect).
557  virtual void resetCrosshair();
558  virtual void resetPolyline();
559  virtual void resetPanner();
560 
561  virtual void resetRegionTools();
562  virtual void resetSelectionTools();
563 
564  virtual void resetTool(casacore::String toolname);
565  virtual void resetTools();
566  //</group>
567 
568 
569  // Expose Zoomer functions: zoom in/out, zoom out to whole image.
570  //<group>
571  virtual void zoomIn (double fctr=2.) {
572  if(zoom_!=0) zoom_->zoomIn (fctr);
573  }
574  virtual void zoomOut(double fctr=2.) {
575  if(zoom_!=0) zoom_->zoomOut(fctr);
576  }
577  virtual void zoom (const casacore::Vector<double> &blc, const casacore::Vector<double> &trc ) {
578  if ( zoom_ != 0 ) zoom_->zoom( blc, trc );
579  }
580  virtual void unzoom() {
581  if(zoom_!=0) zoom_->unzoom();
582  }
583  //</group>
584 
585 
587 
588  // Returns the pixel canvas's current size.
589  QSize canvasSize() {
590  return pc_->size();
591  }
592 
593 
594 
595  // Refresh everything: main panel and colorbar panels (if any).
596  virtual void refresh() {
597  pd_->refresh();
599  }
600  virtual void setBlen_(int len);
601 
603 
604  signals:
605 
606 
607 
608  void animatorChange();
609  //# (Updating entire animator gui when any animator
610  //# change occurs is plenty fast, it turns out...).
611 
612 
613  // signals from registration methods.
614  //
615  // If you connect to any of these registrationChange signals
616  // and/or to ddCreated or ddRemoved signals (from QtViewerBase),
617  // the following are true when the slot is invoked:
618  // * Any removed QDD still exists until after the signal's
619  // _directly_ connected slots have returned.
620  // * Any new QDD has been created before the corresp. signal is emitted.
621  // * The list of existing QDDs (QtViewerBase::dds()) and [un]registered
622  // QDDS (registeredDDs(), unregisteredDDs()) reflect the new state.
623  //
624  // However, if you connect to a registrationChange signal _and_ to
625  // ddCreated or ddRemoved, it is not certain which slot will be
626  // invoked first.
627  //<group>
628 
629  //#dk (These signals are the ones most suitable for the regMenu and
630  //#dk other parts of the gui to react to.... They are emitted
631  //#dk _after_ respective action has taken place, but QDD still exists).
632  void oldDDRegistered(QtDisplayData*); //# reg. status change
633  void oldDDUnregistered(QtDisplayData*); //# on pre-existing DDs.
634  void newRegisteredDD(QtDisplayData*); //# new DD creation, with
635  void newUnregisteredDD(QtDisplayData*); //# new reg. status.
636  void RegisteredDDRemoved(QtDisplayData*); //# DD removal from viewer,
637  void UnregisteredDDRemoved(QtDisplayData*); //# with former reg. status.
638  void allDDsRegistered(); //# (may be emitted _instead_ of
639  void allDDsUnregistered(); //# oldDD[Un]registered, above).
640 
641  void registrationChange(); //# Any of above occurred; usually
642  //# simplest just to connect to this one.
643  //</group>
644 
645 
646  //# signals arising from 'region' mouse tools.
647 
648  // This raw mouse region signal is probably less useful to connect
649  // to than the ones processed through the DDs (below), which contain
650  // true 'image regions'.
652 
653 
654  // Higher-level (casacore::ImageRegion) signal. ddName is the name() of a
655  // registered [casacore::Lattice] QDD which conforms to the panel's current
656  // state (see DD:conformsTo()) and can compute true-region information
657  // from the latest 'mouse tool region event'. The ImageRegion
658  // parameter has the dimensions [and CS] of the DD's Image
659  // (currently, only Image PADDs are supported). It will correspond
660  // to the 2-D mouse region on its display axes. On 'animator' and
661  // 'hidden' axes (if any), the region will be 1 element wide, positioned
662  // at the current 'slice' for each of these axes.
664 
665 
666 
667 
668  // signal from cursor position tracking. The field names are the
669  // names of registered QDDs with tracking info; corresponding values
670  // are Strings with the formatted tracking information.
671  void trackingInfo(casacore::Record trackingRec);
672 
673 
674 
675  // signal from option setting (probably unused at present).
676  void optionsChanged(casacore::Record chgOpt);
677 
678  // Emitted when this QDP is hidden (closed).
679  void dpHidden(QtDisplayPanel* dp);
680 
681 
682  // Emitted when a new casacore::ImageRegion has been stored internally (in lastRgn_).
683  // It can be saved to disk with saveLastRegion().
684  void newRegion(casacore::String imagePath);
685 
686 
687  // Emitted when the panel has been resized.
688  void resized(QSize panelSize, QSize canvasSize);
689 
690 
691  // Emitted when creating a restore xml doc. QtDisplayPanelGui (in
692  // particular) can process by adding intormation to restoredoc.
693  void creatingRstrDoc(QDomDocument* restoredoc);
694 
695  // Emitted when restoring panel state from an xml doc. QtDisplayPanelGui
696  // (in particular) can respond by setting its own state from certain
697  // elements of restoredoc.
698  void restoring(QDomDocument* restoredoc);
699 
701 
702  // signal cursor boundary transitions
705 
706  protected slots:
707 
708  //# I.e., only this class creates the connections to these,
709  //# (though the signals _may_ come from outside...).
710 
711  //# Protected counterparts to public slots/routines generally are
712  //# 'workhorse' parts of the public routines. They do the indicated
713  //# task, but without assuring consistency with other state/interface,
714  //# or sending signals for that purpose. Those jobs are left to the
715  //# public parts, mostly.
716 
717 
718  //# registration
719 
720  // reacts to similar-named signals from QtViewer
721  // <group>
722  virtual void ddCreated_(QtDisplayData*, bool autoRegister, int position=-1, bool csMaster = false);
723  virtual void ddRemoved_(QtDisplayData*);
724  // </group>
725 
726 
727  //# animation
728 
729  virtual void setAnimatorOptions_(casacore::Record opts);
730  virtual void setAnimator_(casacore::Record sarec);
731 
732  virtual void setLen_(int len) { //# (probably unneeded).
733  if(modeZ()) setZlen_(len);
734  else setBlen_(len);
735  }
736  virtual void setZlen_(int len);
737 
738 
739  virtual void stop_();
740  virtual void goTo_(int frm) {
741  if(modeZ()) goToZ_(frm);
742  else goToB_(frm);
743  }
744  virtual void goToZ_(int frm);
745  virtual void goToB_(int frm);
746 
747  virtual void playStep_() {
748  if(animating_<0) prev_();
749  else if(animating_>0) next_();
750  }
751  virtual void prev_(); //# (Like fwdStep, revStep, but these don't stop
752  virtual void next_(); //# the animation; they are _used_ by animation)
753 
754 
755 
756  //# mouse tools
757 
758  // Connected to QtMouseToolState::mouseBtnChg() signal: changes
759  // button assignment for a mouse tool.
760  virtual void chgMouseBtn_(std::string tool, int button);
761 
762  // Connected to corresp. signals from 'region' mouse tools. Emits that
763  // signal verbatum, but also processes it through the registered DDs,
764  // and emits higher-level 'Image Regions' from those DDs which can
765  // create one from the 'mouse region' record.
766  virtual void mouseRegionReady_(casacore::Record mouseRegion, WorldCanvasHolder*);
767 
768 
769 
770  //# color bar maintenance.
771 
772  virtual void reorientColorBars_() {
773  arrangeColorBars_(true);
774  }
775  virtual void checkColorBars_() {
776  arrangeColorBars_(false);
777  }
778  virtual void pcResizing_() {
779  arrangeColorBars_(false, true);
780  }
781 
782 
783 
784  //# position tracking
785 
786  // triggered by internal dd change (not mouse movement;
787  // see operator()(WCMotionEvent) for that.)
788  virtual void refreshTracking_(QtDisplayData* qdd=0);
789 
791 
792  protected:
793 
794  // Called during construction.
795  virtual void setupMouseTools_( bool new_region_tools );
796 
797  // The workhorse part of [un]registering; these do not send the
798  // highest-level signals.
799  // Called internally when the DD is new or being removed, or from
800  // corresponding public methods.
801  // <group>
802  virtual void registerDD_(QtDisplayData* qdd, int position = -1);
803  virtual void unregisterDD_(QtDisplayData* qdd);
804  // </group>
805 
806  // Maintain monitors of events on underlying canvases. Called during
807  // construction/destruction, or when the set of canvases might change.
808  // <group>
809  virtual void installEventHandlers_();
810  virtual void removeEventHandlers_();
811  // </group>
812 
813  // Utility function: is the given wc one belonging to the main pd_?
814  virtual bool myWC_(const WorldCanvas* wc);
815 
816 
817  //# color bar maintenance.
818 
819  // This routine corresponds to the old viewerdisplaypanel.g routine called
820  // 'arrangewedgerequirements'. It responds to events which may require
821  // change to the relative placement or number of colorbars and their panels.
822  // 'reorient' is true if color bars are changing from horizontal to vertical
823  // (or vise versa); it helps determine how much action (if any) this routine
824  // needs to take.
825  // Only the pcResizing_() slot should set resizing=true; in this case,
826  // arrangeColorBars_ lets the PC take care of refresh.
827  virtual void arrangeColorBars_(bool reorient=false, bool resizing=false);
828 
829 
830  // Update Lists of registered DDs which have color bar display
831  // activated (allColorBarDDs_ and colorBarDDsToDisplay_).
832  // Used by arrangeColorBars_().
833  virtual void updateColorBarDDLists_();
834 
835 
836  // Used by arrangeColorBars_().
837  // Return the margin to give to dd's colorbar panel on the side where
838  // colorbar labelling is done (right margin for vertical bars, e.g.).
839  // shrink will usually be 1.; in rare cases where many colorbars are
840  // crowding the main panel and each other, it may be less (and then
841  // the returned margin allowance may also be less than ideal...).
842  virtual int marginb_(QtDisplayData* dd, float shrink=1.);
843 
844 
845  // Used by arrangeColorBars_().
846  // Return the nominal proportion of the PixelCanvas to use for dd's
847  // colorbar panel. (This is allocated along the direction of the
848  // colorbar's thickness; in the direction its length the panel uses
849  // the entire PC size).
850  virtual float cbPanelSpace_(QtDisplayData* dd);
851 
852 
853  // Refresh (only) the colorbar panels (if any). (An attempt to reduce
854  // flashing during blink animation).
855  virtual void refreshCBPanels_();
856 
857 
858  //# save-restore
859 
860  // Tries to find existing DD (or create one from a file) that matches
861  // the given path. Used for restoring DDs from a restore file.
862  // Several directories are checked, not just the one in path, to
863  // provide flexibility. If dd is non-zero, it is tested for suitability
864  // to path, datatype and displaytype. If dd is zero, the filesystem
865  // is searched and an attempt is made to create dd from a matching file
866  // (if any); if creation succeeds, dd will contain the new DD.
867  // Note: the DD will _not_ be registered automatically.
868  // origrestorefile and (current) restoredir aid in locating data files
869  // relative to the current restore file location.
870  virtual bool ddFileMatch_( const std::string &path, const std::string &dataType, const std::string &displayType,
871  QtDisplayData*& dd, QString origrestorefile, QString restoredir);
872 
873 
874 
875  //# Qt Widget event handlers
876 
877  void hideEvent(QHideEvent* ev) {
878  QWidget::hideEvent(ev);
879  emit dpHidden(this);
880  }
881 
882  // (emits Qt signal with QDP and PC sizes. (You probably really want
883  // to take action on QPC resizeEvents (based on QPC size) instead...))
884  void resizeEvent(QResizeEvent* ev);
885 
886 
887  // central (unique) viewer object: for viewer-global state / methods.
889 
890  // 'Main' panel of pc_, where qdds_ draw themselves.
892 
893  // The entire display canvas for this object
894  //(the area with black (default) background).
895  QtPixelCanvas* pc_; //# QtDisplayPanel is basically just enhanced
896  //# state and functional interface on top of
897  //# this PixelCanvas. Its own QWidget
898  //# is just a container for the PC's.
899 
900  // QDDs registered on this QDP, in registration order.
901  // (casacore::List of _all_ (user-loaded) QDDs is v_->dds()).
902  //casacore::List<QtDisplayData*> qdds_;
903  std::shared_ptr<DisplayDataHolder> displayDataHolder;
904 
905  //# mouse tools.
907 
908  //<group>
911 
916 
918 
920 
923 
926  //</group>
927 
929 
930 
931 
932  QTimer tmr_;
933 
934  bool tracking_; //# Won't send out tracking signals when false.
935 
936 
937  //# animation state
938 
939  bool modeZ_; //# true (default) == normal mode; else blink.
940  int zLen_, bLen_; //# total number of frames for each mode.
941  int zIndex_, bIndex_; //# current frame (0-based).
942 
943  int animRate_; //# frames / sec. for play.
944  int minRate_, maxRate_; //# limits to above:
945  //# 1 <= minRate_ <= animRate_ <= maxRate_.
946  int animating_; //# -1: reverse play 0: stopped 1: fwd. play
947 
948 
949 
950  //# color bar state
951 
952  // Registered QDDs which have color bar display activated (in registration
953  // order). See arrangeColorBars_() and updateColorBarDDLists_().
954  std::list<QtDisplayData*> allColorBarDDs_;
955 
956  // Subset of the list above: those which should actually display now
957  // (which would exclude, e.g., a DD which is 'off blink'). These DDs
958  // are ordered so that in multipanel blink displays the order of images
959  // in panels is the same as the display order of their corresponding
960  // colorbars.
961  std::list<QtDisplayData*> colorBarDDsToDisplay_;
962 
963  // Corresponding casacore::List of PanelDisplays in which color bars are placed
964  // -- one for each QDD in colorBarDDsToDisplay_. Assignment of QDDs
965  // to panels is maintained in the order of list above.
966  std::list<PanelDisplay*> colorBarPanels_;
967 
968  // A panel that takes unused PC space in the colorbar area, if any.
969  // just to see that it's cleared when appropriate.
971 
972  // Proportion of the pc_ that each color bar panel will use along the
973  // direction of colorbar thickness (e.g., along the horizontal axis for
974  // a vertical bar). arrangeColorBars_() gets nominal sizes for colorbar
975  // panels from cbPanelSpace_(), and that is usually what they get.
977 
978  // The portion of the PixelCanvas allocated to the main (image display)
979  // PanelDisplay (pd_);
981 
982  // The following are used (only) by arrangeColorBars_() and its
983  // auxiliary routines, and are set for current conditions every time
984  // arrangeColorBars_() is called. The margins (in 'pgp chars') are
985  // set onto the colorbar panels. PixelCanvas current sizes are in
986  // screen pixels. marginUnit_ is 1/65 of the PC's minimum dimansion.
987  // 'ln' and 'th' refer to the directions along the colorbar's length
988  // and thickness, respectively; 'ln' corresponds to vertical / horizontal
989  // according to the current orientation of color bars. mrgna_, mrgnb_
990  // are margins in the colorbar thickness direction; mrgnb_ is where
991  // labelling occurs.
993  float marginUnit_;
995 
996 
997 
998  //# region management state
999 
1000  // The last region created with a mouse tool.
1002 
1003  // path (if any) to image of DD that produced the region (needed?)
1005 
1006  // Has any such region (ever) been saved?
1007  bool hasRgn_;
1008 
1009  // Extension policy to use to for saved region (and for statistics:
1010  // 0: Region applies to viewed plane only.
1011  // 1: Extend to all channels (iff spectral axis not on display).
1012  // 2: Extend along all non-displayed axes.
1013  // (The mouse polygon/rectangle always determines the region on the
1014  // displayed axes).
1016 
1017 
1018 
1019  //# 'Region Shape' state (unrelated to mouse region / casacore::ImageRegion state
1020  //# above; more like annotations.)
1021 
1022  // RegionShapes registered on this display panel, in registration order.
1023  std::list<RegionShape*> rshapes_;
1024 
1025  // Pointer to shape manager.
1026  // (within this class, please do not assume qsm_ has been set.)
1028 
1029 
1030 
1031  //# save-restore state
1032 
1033  // last saved state for this panel (this session -- "" if none).
1034  // Used for fast 'clipboard' save-restore.
1035  // (Note: No user interface for this yet...).
1037 
1038 
1039 
1040  //# position tracking state
1041 
1042  // last valid mouse motion event; for use by refreshTracking_() in
1043  // case something besides mouse motion dictates that tracking
1044  // data should be refreshed.
1046 
1047 
1048 
1049  //# misc.
1050 
1051  // User interface parsing object for background/foreground color.
1052  // (Used in get/setOptions(), shows up in QDPG's 'Panel Display Options'
1053  // window).
1055 
1056 
1057 
1058  //image region extension flags
1061 
1062  // keep track or where the (USER) cursor currently is...
1065 
1066  public:
1067 
1068  //# This (public) bool is probably temporary. true by default.
1069  //# Set it false to disable stats printing.
1071 
1073 
1074  //# Printing utilities
1075 
1076  void setAllowBackToFront(bool allowed=true) {
1077  if (pc_) pc_->setAllowBackToFront(allowed);
1078  }
1079 
1080  void setUpdateAllowed(bool allowed=true) {
1081  if (pc_) pc_->setUpdateAllowed(allowed);
1082  }
1083 
1084  void pushCurrentDrawingState( );
1085  void popCurrentDrawingState( );
1086 
1087  float getLabelLineWidth( );
1088  void setLabelLineWidth( float value );
1089  float getTickLength( );
1090  void setTickLength( float value );
1091 
1092  void setLineWidthPS(float &w);
1094 
1096  pc_->beginLabelAndAxisCaching( );
1097  }
1098  void endLabelAndAxisCaching( QPainter &qp ) {
1099  pc_->endLabelAndAxisCaching( qp );
1100  }
1101 
1102 
1103  private:
1107  void construct_( QtPixelCanvas *canvas, const std::list<std::string> &args );
1108 
1113  void processTracking( const casacore::Record& trackingRec, const WCMotionEvent& ev );
1114 
1124  void setColorBarMargins( bool vertical, float plotPercentage, PanelDisplay* cbp, bool resizing );
1125 
1132  void setPanelGeometry( PanelDisplay* pd, float orgn, float siz );
1133 
1141  void setPanelMargins( PanelDisplay* pd, int marginA =LEFT_MARGIN_SPACE_DEFAULT,
1142  int marginB = RIGHT_MARGIN_SPACE_DEFAULT,
1143  int lengthMarginA = BOTTOM_MARGIN_SPACE_DEFAULT,
1144  int lengthMarginB = TOP_MARGIN_SPACE_DEFAULT);
1145  /*
1146  * Attempts to set an appropriate font size for plot axis
1147  * labels based on the number of plots that are displayed.
1148  */
1149  void setLabelFontSize( );
1150 
1155  void setMarginSize( );
1156 
1157  //# DATA
1158  //An estimate for the number of pixels that correspond to one
1159  //PGP plot unit.
1160  const int PGP_MARGIN_UNIT;
1163  };
1164 
1165  std::map<ColorBarIndex,casacore::String> settingsMap;
1166 
1171  void initializeSettingsMap( bool vertical );
1172 
1178 
1179  //Used for coming up with estimates for the new font and margin
1180  //sizes.
1186 
1187  //Default sizes for the margins
1188  static const int LEFT_MARGIN_SPACE_DEFAULT;
1190  static const int TOP_MARGIN_SPACE_DEFAULT;
1191  static const int RIGHT_MARGIN_SPACE_DEFAULT;
1192 
1193  //# Start_, End_ are current user-defined animator limits;
1194  //# The user can now set her/her own desired limits.
1195  //# 0 <= Start_ <=Index_ < End_ <=Len_ and 1 <= Step_ <= Len_.
1198 
1199  std::stack<casacore::Record*> drawing_state;
1200 
1201  };
1202 
1203 
1204 
1205 } //# NAMESPACE CASA - END
1206 
1207 #endif
casacore::String saveRegionInImage(casacore::String regname, const casacore::ImageRegion &imreg)
same as above except it is saved in the last registered image as a keyword
void stepSizeAnimatorChannelChanged(int)
Multi WorldCanvas event-based zoomer.
Definition: MWCRTZoomer.h:72
virtual void resetTool(casacore::String toolname)
void oldDDRegistered(QtDisplayData *)
signals from registration methods.
casacore::String dpState(casacore::String restorefilename="")
Returns an xml casacore::String of displayPanel state.
void upperBoundAnimatorChannelChanged(int)
WCMotionEvent * lastMotionEvent_
last valid mouse motion event; for use by refreshTracking_() in case something besides mouse motion d...
std::shared_ptr< DisplayDataHolder > displayDataHolder
QDDs registered on this QDP, in registration order.
virtual void unregisterDD(QtDisplayData *)
PanelDisplay * pd_
&#39;Main&#39; panel of pc_, where qdds_ draw themselves.
QSize canvasSize()
Returns the pixel canvas&#39;s current size.
virtual casacore::String mode()
virtual bool savePanelState(casacore::String filename="", bool overwrite=true)
Save panel state to a file (as xml).
virtual void arrangeColorBars_(bool reorient=false, bool resizing=false)
This routine corresponds to the old viewerdisplaypanel.g routine called &#39;arrangewedgerequirements&#39;.
void mouseRegionReady(casacore::Record mouseRegion, WorldCanvasHolder *)
This raw mouse region signal is probably less useful to connect to than the ones processed through th...
void plotCountChangeAdjustment()
Fixes a bug where the color bar disappears if the number of plots that are displayed decreases...
virtual void zoomIn(casacore::Double factor=2.)
zoom in/out by given factor
TableExprNode downcase(const TableExprNode &node)
Definition: ExprNode.h:1430
void goToChannel(int channel)
DParameterChoice * bkgdClrOpt_
User interface parsing object for background/foreground color.
bool saveLastRegion(casacore::String path)
Save the last region created (via an image DD) with the mouse.
QtPixelCanvas * pc_
The entire display canvas for this object (the area with black (default) background).
viewer::RegionToolManager * toolMgr()
casacore::ImageRegion lastRegion()
Return the last region created (via an image DD) with the mouse.
QtDisplayData * getChannelDD(int index) const
Returns the DD that will be animating the channels in normal mode.
virtual void zoomIn(double fctr=2.)
Expose Zoomer functions: zoom in/out, zoom out to whole image.
casacore::String lastSavedState_
last saved state for this panel (this session – &quot;&quot; if none).
virtual void installEventHandlers_()
Maintain monitors of events on underlying canvases.
virtual bool ddFileMatch_(const std::string &path, const std::string &dataType, const std::string &displayType, QtDisplayData *&dd, QString origrestorefile, QString restoredir)
Tries to find existing DD (or create one from a file) that matches the given path.
casacore::String listRegions()
give the regions already stored in last dd image a coma separated list
void UnregisteredDDRemoved(QtDisplayData *)
void oldDDUnregistered(QtDisplayData *)
QtOldCrossTool * ocrosshair_
colormap_state(const std::string &n, const casacore::Vector< float > &s, const casacore::Vector< float > &b)
casacore::Vector< casacore::String > listRegionsInImage()
a vector list
MWCPolylineTool * polyline_
virtual void pcResizing_()
std::list< QtDisplayData * > allColorBarDDs_
Registered QDDs which have color bar display activated (in registration order).
void setTickLength(float value)
panel_state(const panel_state &other)
static const int BOTTOM_MARGIN_SPACE_DEFAULT
virtual float cbPanelSpace_(QtDisplayData *dd)
Used by arrangeColorBars_().
virtual bool restorePanelState(casacore::String filename="")
Restore panel state from a file or from lastSavedState_ if filename==&quot;&quot;.
virtual void resetPanner()
QtDisplayData * getRegistered(int index)
virtual void stopImageMovie()
std::map< ColorBarIndex, casacore::String > settingsMap
virtual void resetRTRegion()
(Will remove mouse-tools&#39; own visual feedback from screen; usually called after selection has been pr...
void loadRegions(const std::string &path, const std::string &type)
new Region code – load casa (or DS9?) region files...
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
Base class for handling WorldCanvas motion events.
Definition: WCMotionEH.h:70
virtual Type type()
Return the type enum.
casacore::String extChan_
image region extension flags
std::list< PanelDisplay * > colorBarPanels_
Corresponding casacore::List of PanelDisplays in which color bars are placed – one for each QDD in co...
void setPanelGeometry(PanelDisplay *pd, float orgn, float siz)
Stores the x-offset and side length of the passed in panel.
void setMarginSize()
Attempts to set appropriate plot margins based on the number of plots that are displayed.
void newUnregisteredDD(QtDisplayData *)
virtual void setAnimatorOptions_(casacore::Record opts)
virtual Display::KeySym key() const
Which key was pressed or released?
virtual PanelDisplay * panelDisplay()
Return underlying library PanelDisplay (used by Annotations, e.g.) (You better know what you&#39;re doing...
Interface implemented by QtDisplayPanel that can add/remove registered DDs and set the controlling Qt...
Definition: ImageTracker.h:57
void newRegion(casacore::String imagePath)
Emitted when a new casacore::ImageRegion has been stored internally (in lastRgn_).
virtual void removeEventHandlers_()
void clicked(casacore::Record)
void goToImage(int image)
virtual void fwdStepImageMovie()
viewer::RegionToolManager * toolmgr
void setImageMovieRate(int)
void setControllingDD(QtDisplayData *controllingDD)
virtual void zoomOut(double fctr=2.)
const int PGP_MARGIN_UNIT
An estimate for the number of pixels that correspond to one PGP plot unit.
virtual void refreshTracking_(QtDisplayData *qdd=0)
triggered by internal dd change (not mouse movement; see operator()(WCMotionEvent) for that...
casacore::Vector< float > colorBarPanelSizes_
Proportion of the pc_ that each color bar panel will use along the direction of colorbar thickness (e...
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 void reorientColorBars_()
void trackingInfo(casacore::Record trackingRec)
signal from cursor position tracking.
static const int LEFT_MARGIN_SPACE_DEFAULT
Default sizes for the margins.
virtual void refresh()
Refresh everything: main panel and colorbar panels (if any).
viewer::QtRegionSourceFactory * region_source_factory
Latin 1 Byte 3 = 0.
Definition: DisplayEnums.h:761
virtual void resetZoomer()
void setPanelMargins(PanelDisplay *pd, int marginA=LEFT_MARGIN_SPACE_DEFAULT, int marginB=RIGHT_MARGIN_SPACE_DEFAULT, int lengthMarginA=BOTTOM_MARGIN_SPACE_DEFAULT, int lengthMarginB=TOP_MARGIN_SPACE_DEFAULT)
Sets the margins of the passed in panel to the indicated amounts.
virtual int marginb_(QtDisplayData *dd, float shrink=1.)
Used by arrangeColorBars_().
std::stack< casacore::Record * > drawing_state
DisplayDataList::const_iterator DisplayDataIterator
virtual casacore::Record getOptions()
Return Options record (of margins and no.
void hideEvent(QHideEvent *ev)
virtual bool myWC_(const WorldCanvas *wc)
Utility function: is the given wc one belonging to the main pd_?
casacore::ImageRegion getRegion(const casacore::String &name)
get an casacore::ImageRegion from active Image
const casacore::Vector< double > & blc() const
int getRegisteredCount() const
virtual void mouseRegionReady_(casacore::Record mouseRegion, WorldCanvasHolder *)
Connected to corresp.
Base class for WorldCanvas event-based polyline tools.
virtual void hold()
Hold and release of refresh.
std::list< QtDisplayData * > colorBarDDsToDisplay_
Subset of the list above: those which should actually display now (which would exclude, e.g., a DD which is &#39;off blink&#39;).
casacore::String suggestedRestoreFilename()
Suggest name for restore file (based on first-registered DD).
void registerRegionShape(RegionShape *rs)
Register the given RegionShape on this display panel.
virtual casacore::Int nWCHs()
Return number of WCHs (subpanels).
void stepSizeAnimatorImageChanged(int)
virtual void resetETRegion()
virtual void fwdPlayImageMovie()
QtDisplayData * getDD(const std::string &name) const
panel_state(const zoom_state &z_, const colormap_map &cm)
const casacore::Vector< double > & trc() const
CursorBoundaryState
keep track or where the (USER) cursor currently is...
virtual void resetPTRegion()
PanelDisplay * blankCBPanel_
A panel that takes unused PC space in the colorbar area, if any.
void restoring(QDomDocument *restoredoc)
Emitted when restoring panel state from an xml doc.
void cursorBoundary(QtDisplayPanel::CursorBoundaryCondition)
signal cursor boundary transitions
void lowerBoundAnimatorChannelChanged(int)
void setAllowBackToFront(bool allowed=true)
virtual void registerDD(QtDisplayData *, int postion=-1)
Register / unregister [all] DDs created by user through QtViewer.
MWCPositionVelocityTool * pvtool_
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
virtual void zoomOut(casacore::Double factor=2.)
virtual void refresh(const Display::RefreshReason &reason=Display::UserCommand)
Distribute a refresh event to all the held WorldCanvasHolders.
virtual void revPlayImageMovie()
virtual void operator()(const WCMotionEvent &ev)
This callback method is automatically registered with the appropriate objects, and is not intended fo...
All regions are specified in &quot;linear coordinates&quot;, not &quot;pixel coordinates&quot;.
Definition: Region.qo.h:147
virtual void goTo_(int frm)
QtDisplayPanelGui * panel_
central (unique) viewer object: for viewer-global state / methods.
virtual void setOptions(casacore::Record opts, bool emitAll=false)
Set display panel options such as margins or number of panels.
Class which stores WorldCanvas motion event information.
Definition: WCMotionEvent.h:79
virtual void chgMouseBtn_(std::string tool, int button)
Connected to QtMouseToolState::mouseBtnChg() signal: changes button assignment for a mouse tool...
virtual void resetCrosshair()
MWCRulerlineTool * rulerline_
const casacore::Vector< float > & shift() const
int pcthsz_
The following are used (only) by arrangeColorBars_() and its auxiliary routines, and are set for curr...
casacore::String rgnImgPath_
path (if any) to image of DD that produced the region (needed?)
virtual QPixmap * getBackBuffer()
void setChannelMovieRate(int)
virtual void setRate(int rate);
std::string path(const std::string &name)
virtual void unregisterAll()
virtual QPixmap * contents()
Return a QPixmap* with a copy of currently-displayed widget contents.
virtual void setMode(casacore::String mode)
casacore::String extPol_
void pushCurrentDrawingState()
virtual void revStepImageMovie()
virtual casacore::Vector< casacore::String > mouseToolNames()
Return names of resident mouse tools (order is a suggestion for order in gui).
casacore::Vector< casacore::String > mouseToolNames_
virtual void goTo(int frm, bool channelFrame=false)
virtual void release()
void setShapeManager(QtRegionShapeManager *manager)
Sets the region shape manager from QtDisplayPanelGui.
The main display window for the Qt version of the viewer.
virtual void registerAll(std::list< QtDisplayData * > registerDatas)
virtual void setAnimator_(casacore::Record sarec)
virtual void unzoom()
This function resets the zoom.
int rgnExtent_
Extension policy to use to for saved region (and for statistics: 0: Region applies to viewed plane on...
virtual void updateColorBarDDLists_()
Update Lists of registered DDs which have color bar display activated (allColorBarDDs_ and colorBarDD...
virtual void setLen_(int len)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
casacore::ImageRegion lastRgn_
The last region created with a mouse tool.
void upperBoundAnimatorImageChanged(int)
void processTracking(const casacore::Record &trackingRec, const WCMotionEvent &ev)
Sends a signal containing information about the data pinpointed by the mouse &amp; displays flyover infor...
void setLineWidthPS(float &w)
void lowerBoundAnimatorImageChanged(int)
QtOldRectTool * ortregion_
virtual void refreshCBPanels_()
Refresh (only) the colorbar panels (if any).
const colormap_state * colormap(const std::string &s) const
CursorBoundaryState cursorBoundaryState
Parent class for all RegionShapes.
Definition: RegionShape.h:223
QtOldEllipseTool * oelregion_
std::shared_ptr< DisplayDataHolder > getDataHolder() const
void imageRegionReady(casacore::ImageRegion imgRegion, casacore::String ddName)
Higher-level (casacore::ImageRegion) signal.
void resized(QSize panelSize, QSize canvasSize)
Emitted when the panel has been resized.
PixelCanvas Event Handler for managing keyboard and mouse button events.
Definition: PCPositionEH.h:74
float mainPanelSize_
The portion of the PixelCanvas allocated to the main (image display) PanelDisplay (pd_);...
DisplayDataHolder::DisplayDataIterator beginRegistered() const
Manipulation of the QtDisplayData&#39;s.
virtual void goToB_(int frm)
virtual void toImageMovieEnd()
virtual void revPlayChannelMovie()
void extendRegion(casacore::String, casacore::String)
respond to region manager to set casacore::ImageRegion extension
void setUpdateAllowed(bool allowed=true)
virtual void resetRegionTools()
void construct_(QtPixelCanvas *canvas, const std::list< std::string > &args)
portion of construction shared by multiple constructor functions...
Multi WorldCanvas event-based ruler line tool.
MWCPannerTool * panner_
void setBackgroundPS(casacore::String &w, casacore::String &c)
virtual void revStepChannelMovie()
void endLabelAndAxisCaching(QPainter &qp)
Implementation of DisplayParameter to store choice parameters.
void setRegionExtent(int ext)
Set current extension policy to use to for (subsequent) image region creation (and for printed region...
std::list< RegionShape * > rshapes_
RegionShapes registered on this display panel, in registration order.
virtual void resetPolyline()
virtual bool setPanelState(casacore::String xmlState="")
set panel state from xml casacore::String (lastSavedState_, by default).
const casacore::Vector< float > & brightness() const
void setColorBarMargins(bool vertical, float plotPercentage, PanelDisplay *cbp, bool resizing)
Estimates appropriate margins for the color bars in the long direction.
void optionsChanged(casacore::Record chgOpt)
signal from option setting (probably unused at present).
static const int RIGHT_MARGIN_SPACE_DEFAULT
CursorBoundaryCondition
included in cursor boundary signals...
void RegisteredDDRemoved(QtDisplayData *)
virtual void setBlen_(int len)
virtual void unregisterDD_(QtDisplayData *qdd)
virtual bool isRegistered(QtDisplayData *)
true if DD is on our list.
int nPanels()
Return total number of (main) subpanels (e.g.
Class to hold a region of interest in an image.
Definition: ImageRegion.h:86
virtual void stopChannelMovie()
static const int TOP_MARGIN_SPACE_DEFAULT
float oldPlotPercentage
Used for coming up with estimates for the new font and margin sizes.
virtual void resetSelectionTools()
Colormap fiddling on the PixelCanvas.
Definition: PCITFiddler.h:45
void newRegisteredDD(QtDisplayData *)
virtual void playStep_()
std::map< std::string, colormap_state > colormap_map
virtual void goToZ(int frm)
void removeRegionInImage(casacore::String regname)
Delete the region regname from last registered image does not care if its casacore::RegionHandler::Ma...
void creatingRstrDoc(QDomDocument *restoredoc)
Emitted when creating a restore xml doc.
void registrationOrderChanged()
Reorders panels in response to a change in the registration order.
virtual void emitAnimState()
Class which stores PixelCanvas position event information.
bool isCoordinateMaster(QtDisplayData *displayData) const
A holder to interface between DisplayDatas and a WorldCanvas.
QtOldPolyTool * optregion_
static casacore::String regionPathname(casacore::String origPath)
Transform origPath to a plausible pathname for a new image region file.
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
virtual void zoom(const casacore::Vector< casacore::Double > &linBlc, const casacore::Vector< casacore::Double > &linTrc)
This function zooms with a given blc,trc.
const Double c
Fundamental physical constants (SI units):
void resizeEvent(QResizeEvent *ev)
(emits Qt signal with QDP and PC sizes.
A class which creates and manages &quot;panelled&quot; displays.
Definition: PanelDisplay.h:79
void initializeSettingsMap(bool vertical)
Initializes the settings map based on whether the color bar is vertical or horizontal.
panel_state getPanelState() const
virtual void goToZ_(int frm)
bool worldToLin(casacore::Vector< double > &lin, const casacore::Vector< double > &world)
QtDisplayPanel(QtDisplayPanelGui *panel, const QtDisplayPanel *other, QWidget *parent=0, const std::list< std::string > &args=std::list< std::string >())
virtual void stop_()
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void toChannelMovieEnd()
virtual void fwdPlayChannelMovie()
std::pair< casacore::Vector< double >, casacore::Vector< double > > zoom_state
void revokeRegion(viewer::Region *r)
new Region code – revoke region from region source...
virtual void ddRemoved_(QtDisplayData *)
virtual void resetTools()
void activate(bool)
called to indicate application activation state...
void dpHidden(QtDisplayPanel *dp)
Emitted when this QDP is hidden (closed).
virtual void setMode(bool modez, bool channelCubes=false)
virtual void checkColorBars_()
virtual void setupMouseTools_(bool new_region_tools)
Called during construction.
void unregisterRegionShape(RegionShape *rs)
Unregister the given RegionShape on this display panel.
Base class for display objects.
Definition: DisplayData.h:317
void operator()(const PCPositionEvent &pev)
This callback method is automatically registered with the appropriate PC object, and is not intended ...
virtual void fwdStepChannelMovie()
DisplayDataHolder::DisplayDataIterator endRegistered() const
virtual void prev_()
virtual void next_()
bool hasRgn_
Has any such region (ever) been saved?
virtual void zoom(const casacore::Vector< double > &blc, const casacore::Vector< double > &trc)
QtRegionShapeManager * qsm_
Pointer to shape manager.
QtDisplayData * getControllingDD() const
virtual void registerDD_(QtDisplayData *qdd, int position=-1)
The workhorse part of [un]registering; these do not send the highest-level signals.
bool isEmptyRegistered() const
void cursorPosition(viewer::Position)
virtual void setZlen_(int len)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
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 ddCreated_(QtDisplayData *, bool autoRegister, int position=-1, bool csMaster=false)
reacts to similar-named signals from QtViewer
virtual void goToB(int frm)
Multi WorldCanvas event-based position velocity tool.
void setLabelLineWidth(float value)
the RegionCreator class now has static members which allow for the retrieval of lists of RegionCreato...