casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
casa::PanelDisplay Class Reference

A class which creates and manages "panelled" displays. More...

#include <PanelDisplay.h>

Inheritance diagram for casa::PanelDisplay:
casa::MultiWCHolder casa::DisplayOptions

Public Types

enum  FillOrder { LEFT_TOP }
 

Public Member Functions

 PanelDisplay (PixelCanvas *pixelcanvas, const casacore::Int nx=3, const casacore::Int ny=2, const casacore::Float xOrigin=0.0, const casacore::Float yOrigin=0.0, const casacore::Float xSize=1.0, const casacore::Float ySize=1.0, const casacore::Float dx=0.0, const casacore::Float dy=0.0, const PanelDisplay::FillOrder order=LEFT_TOP)
 Constructor taking: a pointer to the PixelCanvas on which to lay the panels, the number of panels in the x and y directions, the extent of the PixelCanvas to cover with panels, and the fractional spacing between the panels. More...
 
virtual ~PanelDisplay ()
 Destructor. More...
 
virtual void setDefaultOptions ()
 Install the default options for this PanelDisplay. More...
 
virtual casacore::Bool setOptions (const casacore::Record &rec, casacore::Record &updatedOptions)
 Apply options stored in rec to the PanelDisplay; these get forwarded to all underlying WorldCanvases. More...
 
virtual casacore::Record getOptions () const
 
virtual void setAttributes (AttributeBuffer &at)
 Set attributes on all WolrdCanvases. More...
 
virtual void getAttributeValue (const casacore::String &name, casacore::Int &newValue) const
 
virtual void getGeometry (casacore::Int &nx, casacore::Int &ny, casacore::Float &xOrigin, casacore::Float &yOrigin, casacore::Float &xSize, casacore::Float &ySize, casacore::Float &dx, casacore::Float &dy, PanelDisplay::FillOrder &order) const
 Describe or set the geometry of the panels, either explicitly or in casacore::RecordInterface form. More...
 
virtual void getGeometry (casacore::RecordInterface &rec) const
 
virtual void setGeometry (const casacore::Int nx, const casacore::Int ny, const casacore::Float xOrigin, const casacore::Float yOrigin, const casacore::Float xSize, const casacore::Float ySize, const casacore::Float dx, const casacore::Float dy, const PanelDisplay::FillOrder order)
 
virtual void setGeometry (const casacore::RecordInterface &rec)
 
virtual void clear ()
 Clear our part of the PC. More...
 
virtual WorldCanvasHolderwcHolder (WorldCanvas *wc) const
 
virtual PixelCanvaspixelCanvas ()
 
bool wcsApply (std::function< void(WorldCanvas *)> apply)
 get controlled access to world canvases shared among a number of objects return value indicates if the operation was possible (in the future it may be necessary to serialize access so this function may return false if mutual exclusion prevents access to the world canvas list) More...
 
virtual void addTool (const casacore::String &key, const std::shared_ptr< MultiWCTool > &)
 
virtual void removeTool (const casacore::String &key)
 
virtual void setToolKey (const casacore::String &toolname, const Display::KeySym &keysym)
 
virtual casacore::Bool hasTools ()
 
virtual void updateTools (casacore::Bool remove=true, casacore::Bool add=true)
 
virtual void disableTools ()
 
virtual void enableTools ()
 
virtual void enableTool (const casacore::String &toolname)
 
virtual void disableTool (const casacore::String &toolname)
 
virtual const std::shared_ptr
< MultiWCTool
getTool (const casacore::String &key)
 
virtual casacore::Bool isCSmaster (const DisplayData *dd) const
 Is the specified DisplayData the one in charge of coordinate state of the Panel's WCs? More...
 
void setCSmaster (DisplayData *dd)
 
float getDrawUnit () const
 Returns the current mapping of PGP units to pixel units. More...
 
int getColumnCount () const
 Returns the number of columns of plots that are currently being displayed. More...
 
int getRowCount () const
 Returns the number of rows of plots that are currently being displayed. More...
 
- Public Member Functions inherited from casa::MultiWCHolder
 MultiWCHolder ()
 Constructor which makes an empty MultiWCHolder. More...
 
 MultiWCHolder (WorldCanvasHolder &holder)
 Constructor which makes a MultiWCHolder containing the single specified WorldCanvasHolder. More...
 
virtual ~MultiWCHolder ()
 Destructor. More...
 
virtual void addWCHolder (WorldCanvasHolder &holder)
 Add or remove a WorldCanvasHolder, or remove all WorldCanvasHolders on this MultiWCHolder. More...
 
virtual void removeWCHolder (WorldCanvasHolder &holder)
 
virtual void removeWCHolders ()
 
virtual void addDisplayData (DisplayData &displaydata, int position=-1)
 Add or remove a DisplayData, or remove all DisplayDatas on this MultiWCHolder. More...
 
virtual void removeDisplayData (DisplayData &displaydata)
 
virtual void removeDisplayDatas ()
 
virtual void setRestriction (const Attribute &restriction)
 Install or remove a single restriction, or a buffer of restrictions, on all of the WorldCanvasHolders managed by this MultiWCHolder. More...
 
virtual void setRestrictions (const AttributeBuffer &restrictions)
 
virtual void removeRestriction (const casacore::String &name)
 
virtual void removeRestrictions ()
 
virtual void setLinearRestrictions (AttributeBuffer &restrictions, const AttributeBuffer &increments)
 Incrementally distribute restrictions to all of the WorldCanvasHolders. More...
 
virtual void hold ()
 Hold and release response to refreshes requested with the refresh() member function. More...
 
virtual void release ()
 
virtual void refresh (const Display::RefreshReason &reason=Display::UserCommand)
 Distribute a refresh event to all the held WorldCanvasHolders. More...
 
virtual casacore::uInt zLength ()
 
virtual casacore::Int bLength ()
 These orrespond to 'zIndex, zLength' for animator's 'blink mode'. More...
 
virtual casacore::Int bIndex ()
 
void setBlinkMode (bool blinkMode)
 Sets whether the viewer is in blink mode. More...
 
virtual casacore::Bool isBlinkDD (DisplayData *dd)
 Determines which DDs will be restricted, which are always active. More...
 
virtual casacore::Bool conforms (DisplayData *dd, casacore::Bool testRstrs=true, casacore::Bool testCS=true, casacore::Bool testZ=true, casacore::Int wchIndex=0)
 Test conformance of a DD to a WCH of this MWCH (by default, test against the first one (WCH 0), which always exists). More...
 
virtual casacore::Int nWCHs ()
 Return number of WCHs (subpanels). More...
 
std::list< DisplayData * > & displayDatas ()
 Added to collect region statistics from MultiRectTool::update_stats()... More...
 
- Public Member Functions inherited from casa::DisplayOptions
 DisplayOptions ()
 Constructor. More...
 
virtual ~DisplayOptions ()
 Destructor. More...
 
template<class T >
casacore::Bool readOptionRecord (casacore::Vector< T > &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 Find the field fieldname in casacore::Record rec, containing the requested type (casacore::Bool, casacore::String, casacore::Float, casacore::Int) in itself or its "value" sub-field, and return the value in target. More...
 
template<class T >
casacore::Bool readOptionRecord (T &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 
virtual casacore::Bool readOptionRecord (casacore::String &target, casacore::Bool &unsetTarget, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const
 Find the field fieldname in casacore::Record rec, containing the requested type (casacore::String) in itself or its "value" sub-field, and return the value in target. More...
 
casacore::Record unset () const
 Return a casacore::Record which is an "unset" casacore::Record, ie. More...
 
casacore::Bool isUnset (const casacore::Record &rec) const
 Return true or false indicating if the provided casacore::Record is equal to an "unset" Record. More...
 

Static Public Attributes

static const casacore::String X_ORIGIN
 
static const casacore::String Y_ORIGIN
 
static const casacore::String X_SIZE
 
static const casacore::String Y_SIZE
 

Private Member Functions

void unSetupGeometry ()
 unSetup the Geometry. More...
 

Private Attributes

PixelCanvasitsPixelCanvas
 The PixelCanvas on which the panels are laid. More...
 
casacore::Int itsNX
 The number of panels in x and y. More...
 
casacore::Int itsNY
 
casacore::Float itsXOrigin
 The origin and size of the used area of the PixelCanvas. More...
 
casacore::Float itsYOrigin
 
casacore::Float itsXSize
 
casacore::Float itsYSize
 
casacore::Float itsDX
 The offset between each panel. More...
 
casacore::Float itsDY
 
casacore::Int itslpgm
 The pgmargins. More...
 
casacore::Int itsrpgm
 
casacore::Int itstpgm
 
casacore::Int itsbpgm
 
FillOrder itsOrder
 What order do we fill the canvases in? More...
 
casacore::Bool itsGeometrySet
 Whether the geometry is currently setup? More...
 
std::list< WorldCanvas * > itsWCList
 The WorldCanvases which we made, and a convenient iterator. More...
 
std::list< WorldCanvasHolder * > itsWCHList
 The WorldCanvasHolders which we made, and a convenient iterator. More...
 
std::map< casacore::String,
std::shared_ptr< MultiWCTool > > 
itsMWCTools
 

Additional Inherited Members

- Protected Member Functions inherited from casa::MultiWCHolder
virtual void setBIndexName ()
 Copy constructor - construct a new MultiWCHolder from other. More...
 
virtual void adjustBIndexName (AttributeBuffer &rstrs)
 Adjust name of "bIndex" Attribute (if any) to indlude ID of this MWCH. More...
 
- Protected Member Functions inherited from casa::DisplayOptions
 DisplayOptions (const DisplayOptions &other)
 (Required) copy constructor. More...
 
void operator= (const DisplayOptions &other)
 (Required) copy assignment. More...
 

Detailed Description

A class which creates and manages "panelled" displays.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The PanelDisplay class provides a display consisting of a number of panels.

Synopsis

This class uses the MultiWCHolder class to provide a regular set of panels for display multi-view DisplayDatas.

Example

Motivation

Definition at line 79 of file PanelDisplay.h.

Member Enumeration Documentation

Enumerator
LEFT_TOP 

left to right, then top to bottom

others are imaginable

Definition at line 83 of file PanelDisplay.h.

Constructor & Destructor Documentation

casa::PanelDisplay::PanelDisplay ( PixelCanvas pixelcanvas,
const casacore::Int  nx = 3,
const casacore::Int  ny = 2,
const casacore::Float  xOrigin = 0.0,
const casacore::Float  yOrigin = 0.0,
const casacore::Float  xSize = 1.0,
const casacore::Float  ySize = 1.0,
const casacore::Float  dx = 0.0,
const casacore::Float  dy = 0.0,
const PanelDisplay::FillOrder  order = LEFT_TOP 
)

Constructor taking: a pointer to the PixelCanvas on which to lay the panels, the number of panels in the x and y directions, the extent of the PixelCanvas to cover with panels, and the fractional spacing between the panels.

virtual casa::PanelDisplay::~PanelDisplay ( )
virtual

Destructor.

Member Function Documentation

virtual void casa::PanelDisplay::addTool ( const casacore::String key,
const std::shared_ptr< MultiWCTool > &   
)
virtual
virtual void casa::PanelDisplay::clear ( )
virtual

Clear our part of the PC.

(Clears both front and back buffers.)

Reimplemented from casa::MultiWCHolder.

virtual void casa::PanelDisplay::disableTool ( const casacore::String toolname)
virtual
virtual void casa::PanelDisplay::disableTools ( )
virtual
virtual void casa::PanelDisplay::enableTool ( const casacore::String toolname)
virtual
virtual void casa::PanelDisplay::enableTools ( )
virtual
virtual void casa::PanelDisplay::getAttributeValue ( const casacore::String name,
casacore::Int newValue 
) const
virtual
int casa::PanelDisplay::getColumnCount ( ) const

Returns the number of columns of plots that are currently being displayed.

float casa::PanelDisplay::getDrawUnit ( ) const

Returns the current mapping of PGP units to pixel units.

This number varies depending on the data units of the plot.

virtual void casa::PanelDisplay::getGeometry ( casacore::Int nx,
casacore::Int ny,
casacore::Float xOrigin,
casacore::Float yOrigin,
casacore::Float xSize,
casacore::Float ySize,
casacore::Float dx,
casacore::Float dy,
PanelDisplay::FillOrder order 
) const
virtual

Describe or set the geometry of the panels, either explicitly or in casacore::RecordInterface form.

(Note: setGeometry() does not automatically refresh; when called within setOptions it does, though.)

virtual void casa::PanelDisplay::getGeometry ( casacore::RecordInterface rec) const
virtual
virtual casacore::Record casa::PanelDisplay::getOptions ( ) const
virtual
int casa::PanelDisplay::getRowCount ( ) const

Returns the number of rows of plots that are currently being displayed.

virtual const std::shared_ptr<MultiWCTool> casa::PanelDisplay::getTool ( const casacore::String key)
virtual
virtual casacore::Bool casa::PanelDisplay::hasTools ( )
virtual
virtual casacore::Bool casa::PanelDisplay::isCSmaster ( const DisplayData dd) const
virtual

Is the specified DisplayData the one in charge of coordinate state of the Panel's WCs?

virtual PixelCanvas* casa::PanelDisplay::pixelCanvas ( )
inlinevirtual

Definition at line 138 of file PanelDisplay.h.

References itsPixelCanvas.

virtual void casa::PanelDisplay::removeTool ( const casacore::String key)
virtual
virtual void casa::PanelDisplay::setAttributes ( AttributeBuffer at)
virtual

Set attributes on all WolrdCanvases.

void casa::PanelDisplay::setCSmaster ( DisplayData dd)
virtual void casa::PanelDisplay::setDefaultOptions ( )
virtual

Install the default options for this PanelDisplay.

virtual void casa::PanelDisplay::setGeometry ( const casacore::Int  nx,
const casacore::Int  ny,
const casacore::Float  xOrigin,
const casacore::Float  yOrigin,
const casacore::Float  xSize,
const casacore::Float  ySize,
const casacore::Float  dx,
const casacore::Float  dy,
const PanelDisplay::FillOrder  order 
)
virtual
virtual void casa::PanelDisplay::setGeometry ( const casacore::RecordInterface rec)
virtual
virtual casacore::Bool casa::PanelDisplay::setOptions ( const casacore::Record rec,
casacore::Record updatedOptions 
)
virtual

Apply options stored in rec to the PanelDisplay; these get forwarded to all underlying WorldCanvases.

virtual void casa::PanelDisplay::setToolKey ( const casacore::String toolname,
const Display::KeySym keysym 
)
virtual
void casa::PanelDisplay::unSetupGeometry ( )
private

unSetup the Geometry.

virtual void casa::PanelDisplay::updateTools ( casacore::Bool  remove = true,
casacore::Bool  add = true 
)
virtual
virtual WorldCanvasHolder* casa::PanelDisplay::wcHolder ( WorldCanvas wc) const
virtual
bool casa::PanelDisplay::wcsApply ( std::function< void(WorldCanvas *)>  apply)

get controlled access to world canvases shared among a number of objects return value indicates if the operation was possible (in the future it may be necessary to serialize access so this function may return false if mutual exclusion prevents access to the world canvas list)

Member Data Documentation

casacore::Int casa::PanelDisplay::itsbpgm
private

Definition at line 208 of file PanelDisplay.h.

casacore::Float casa::PanelDisplay::itsDX
private

The offset between each panel.

Definition at line 205 of file PanelDisplay.h.

casacore::Float casa::PanelDisplay::itsDY
private

Definition at line 205 of file PanelDisplay.h.

casacore::Bool casa::PanelDisplay::itsGeometrySet
private

Whether the geometry is currently setup?

Definition at line 214 of file PanelDisplay.h.

casacore::Int casa::PanelDisplay::itslpgm
private

The pgmargins.

Definition at line 208 of file PanelDisplay.h.

std::map<casacore::String, std::shared_ptr<MultiWCTool> > casa::PanelDisplay::itsMWCTools
private

Definition at line 231 of file PanelDisplay.h.

casacore::Int casa::PanelDisplay::itsNX
private

The number of panels in x and y.

Definition at line 199 of file PanelDisplay.h.

casacore::Int casa::PanelDisplay::itsNY
private

Definition at line 199 of file PanelDisplay.h.

FillOrder casa::PanelDisplay::itsOrder
private

What order do we fill the canvases in?

Definition at line 211 of file PanelDisplay.h.

PixelCanvas* casa::PanelDisplay::itsPixelCanvas
private

The PixelCanvas on which the panels are laid.

Definition at line 196 of file PanelDisplay.h.

Referenced by pixelCanvas().

casacore::Int casa::PanelDisplay::itsrpgm
private

Definition at line 208 of file PanelDisplay.h.

casacore::Int casa::PanelDisplay::itstpgm
private

Definition at line 208 of file PanelDisplay.h.

std::list<WorldCanvasHolder* > casa::PanelDisplay::itsWCHList
private

The WorldCanvasHolders which we made, and a convenient iterator.

(dk note: you should create a local iterator instead of using member iterators. Otherwise, a call chain may include two methods in the class stepping on each other's iterator use. Even if you think that won't happen currently, it creates a maintenance minefield).

Also note: exactly the same list (with the same name, even) is maintained on MWCH level (to be fixed).

Definition at line 229 of file PanelDisplay.h.

std::list<WorldCanvas*> casa::PanelDisplay::itsWCList
private

The WorldCanvases which we made, and a convenient iterator.

Definition at line 217 of file PanelDisplay.h.

casacore::Float casa::PanelDisplay::itsXOrigin
private

The origin and size of the used area of the PixelCanvas.

Definition at line 202 of file PanelDisplay.h.

casacore::Float casa::PanelDisplay::itsXSize
private

Definition at line 202 of file PanelDisplay.h.

casacore::Float casa::PanelDisplay::itsYOrigin
private

Definition at line 202 of file PanelDisplay.h.

casacore::Float casa::PanelDisplay::itsYSize
private

Definition at line 202 of file PanelDisplay.h.

const casacore::String casa::PanelDisplay::X_ORIGIN
static

Definition at line 185 of file PanelDisplay.h.

const casacore::String casa::PanelDisplay::X_SIZE
static

Definition at line 187 of file PanelDisplay.h.

const casacore::String casa::PanelDisplay::Y_ORIGIN
static

Definition at line 186 of file PanelDisplay.h.

const casacore::String casa::PanelDisplay::Y_SIZE
static

Definition at line 188 of file PanelDisplay.h.


The documentation for this class was generated from the following file: