28 #ifndef QTDISPLAYPANEL_H
29 #define QTDISPLAYPANEL_H
62 class QtDisplayPanelGui;
68 class MWCPolylineTool;
69 class MWCRulerlineTool;
70 class MWCPositionVelocityTool;
72 class DParameterChoice;
74 class QtRegionShapeManager;
77 class RegionToolManager;
100 const std::string &
name( )
const {
128 const colormap_state *
colormap(
const std::string &s )
const;
140 const std::list<std::string> &args = std::list<std::string>( ) );
142 const std::list<std::string> &args = std::list<std::string>( ) );
185 return pc_->contents();
188 return pc_->getBackBuffer();
253 return modeZ()?
"Normal" :
"Blink";
432 QString restorefiledir=
"");
456 virtual void registerAll(std::list<QtDisplayData*> registerDatas);
473 virtual void setMode(
bool modez,
bool channelCubes =
false);
531 virtual void goTo(
int frm,
bool channelFrame=
false) {
540 virtual void goToZ(
int frm);
541 virtual void goToB(
int frm);
698 void restoring(QDomDocument* restoredoc);
739 virtual void stop_();
744 virtual void goToZ_(
int frm);
745 virtual void goToB_(
int frm);
751 virtual void prev_();
752 virtual void next_();
760 virtual void chgMouseBtn_(std::string tool,
int button);
870 virtual bool ddFileMatch_(
const std::string &
path,
const std::string &dataType,
const std::string &displayType,
871 QtDisplayData*& dd, QString origrestorefile, QString restoredir);
878 QWidget::hideEvent(ev);
1077 if (
pc_)
pc_->setAllowBackToFront(allowed);
1081 if (
pc_)
pc_->setUpdateAllowed(allowed);
1096 pc_->beginLabelAndAxisCaching( );
1099 pc_->endLabelAndAxisCaching( qp );
1107 void construct_( QtPixelCanvas *canvas,
const std::list<std::string> &args );
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.
void registrationChange()
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...
colormap_state(const colormap_state &other)
std::shared_ptr< DisplayDataHolder > displayDataHolder
QDDs registered on this QDP, in registration order.
virtual void unregisterDD(QtDisplayData *)
PanelDisplay * pd_
'Main' panel of pc_, where qdds_ draw themselves.
QSize canvasSize()
Returns the pixel canvas'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 'arrangewedgerequirements'.
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)
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 – "" 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=="".
virtual void resetPanner()
QtDisplayData * getRegistered(int index)
virtual void stopImageMovie()
std::map< ColorBarIndex, casacore::String > settingsMap
virtual void resetRTRegion()
(Will remove mouse-tools' 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.
virtual Type type()
Return the type enum.
void allDDsUnregistered()
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're doing...
Interface implemented by QtDisplayPanel that can add/remove registered DDs and set the controlling Qt...
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
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.
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 'off blink').
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).
const std::string & name() const
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 "linear coordinates", not "pixel coordinates".
void toChannelMovieStart()
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.
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)
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)
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.
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 & 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.
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.
float mainPanelSize_
The portion of the PixelCanvas allocated to the main (image display) PanelDisplay (pd_);...
DisplayDataHolder::DisplayDataIterator beginRegistered() const
Manipulation of the QtDisplayData's.
virtual void goToB_(int frm)
virtual void toImageMovieEnd()
casacore::Vector< float > brightness_
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...
void setBackgroundPS(casacore::String &w, casacore::String &c)
virtual void revStepChannelMovie()
void endLabelAndAxisCaching(QPainter &qp)
Implementation of DisplayParameter to store choice parameters.
float getLabelLineWidth()
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()
casacore::Vector< float > shift_
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.
void beginLabelAndAxisCaching()
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.
void newRegisteredDD(QtDisplayData *)
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.
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 "panelled" displays.
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 >())
String: the storage and methods of handling collections of characters.
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...
void popCurrentDrawingState()
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.
void operator()(const PCPositionEvent &pev)
This callback method is automatically registered with the appropriate PC object, and is not intended ...
virtual void fwdStepChannelMovie()
const std::string & colormap() const
DisplayDataHolder::DisplayDataIterator endRegistered() const
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's limited by valid astronomical coordinates on the sky Hz vs arc...
virtual void ddCreated_(QtDisplayData *, bool autoRegister, int position=-1, bool csMaster=false)
reacts to similar-named signals from QtViewer
virtual void goToB(int frm)
void setLabelLineWidth(float value)