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

A holder of WorldCanvasHolders to use for panelling applications. More...

#include <MultiWCHolder.h>

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

Public Member Functions

 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...
 
virtual void clear ()
 Clear PC in MWCH's area (not implemented on this level). More...
 
std::list< DisplayData * > & displayDatas ()
 Added to collect region statistics from MultiRectTool::update_stats()... More...
 

Protected Member Functions

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...
 

Private Member Functions

casacore::Bool isAlreadyRegistered (const WorldCanvasHolder &holder)
 Do we already have this WorldCanvasHolder/DisplayData registered? More...
 
casacore::Bool isAlreadyRegistered (const DisplayData &displaydata)
 
void addAllDisplayDatas (WorldCanvasHolder &holder)
 Add/remove all the DisplayDatas to/from a WorldCanvasHolder. More...
 
void removeAllDisplayDatas (WorldCanvasHolder &holder, const casacore::Bool &permanent=false)
 
void addToAllWorldCanvasHolders (DisplayData &displaydata, int position)
 Add/remove a DisplayData to/from all WorldCanvasHolders. More...
 
void removeFromAllWorldCanvasHolders (DisplayData &displaydata)
 
void distributeRestrictions ()
 Distribute restrictions to all WorldCanvasHolders. More...
 
void installRestrictions (WorldCanvasHolder &holder)
 Set restrictions on a particular WorldCanvasHolder. More...
 

Private Attributes

std::list< WorldCanvasHolder * > itsWCHList
 The list of WorldCanvasHolders that are managed by this MultiWCHolder. More...
 
std::list< DisplayData * > itsDDList
 The list of DisplayDatas that are managed by this MultiWCHolder. More...
 
casacore::Block< void * > itsBlinkDDs
 Subset of above DDs which will have blinking restrictions added (Countour plots, e.g., do not; they always display). More...
 
casacore::Int itsBLength
 Number of DDs above. More...
 
casacore::Int itsBIndex
 Index of DD to show in first WCH when blink mode is active (it is kept up-to-date in any case). More...
 
casacore::String itsBIndexName
 The (unchanging) name of the blink restriction: "bIndex" followed by an ID unique to this MWCH. More...
 
AttributeBuffer itsAttributes
 The buffer of attributes which are presently installed on the registered WorldCanvasHolders. More...
 
casacore::Int itsHoldCount
 The current hold count of this MultiWCHolder. More...
 
casacore::Bool itsRefreshHeld
 The current state of whether a refresh was held up or not. More...
 
Display::RefreshReason itsHeldReason
 The reason for the held-up refresh event. More...
 

Detailed Description

A holder of WorldCanvasHolders to use for panelling applications.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The MultiWCHolder holds a number of WorldCanvasHolders to simplify panelling operations.

Synopsis

This class is a holder of WorldCanvasHolder objects. It exists to facilitate the management of multiple WorldCanvasHolders having in common a set of restrictions, which for example may be for controlling animation, and on which a common set of DisplayDatas may be registered and displayed.

The basic interface to the MultiWCHolder provides methods for adding and removing individual WorldCanvasHolder objects, for globally registering and unregistering DisplayData objects for display on the WorldCanvasHolder objects, and for applying a set of restrictions to the WorldCanvasHolder objects.

At a more advanced level, functions exist to distribute varying restrictions across all the WorldCanvasHolder objects. For example, the programmer can use linearDistributeRestriction to apply a restriction to each WorldCanvasHolder, where the value of the restriction is incremented by a fixed amount between each WorldCanvasHolder. This would be useful, for example, to easily display a set of planes from a multi-frequency image on a number of WorldCanvases whose WorldCanvasHolders have been added to a MultiWCHolder.

Example

Motivation

Definition at line 99 of file MultiWCHolder.h.

Constructor & Destructor Documentation

casa::MultiWCHolder::MultiWCHolder ( )

Constructor which makes an empty MultiWCHolder.

casa::MultiWCHolder::MultiWCHolder ( WorldCanvasHolder holder)

Constructor which makes a MultiWCHolder containing the single specified WorldCanvasHolder.

virtual casa::MultiWCHolder::~MultiWCHolder ( )
virtual

Destructor.

Member Function Documentation

void casa::MultiWCHolder::addAllDisplayDatas ( WorldCanvasHolder holder)
private

Add/remove all the DisplayDatas to/from a WorldCanvasHolder.

virtual void casa::MultiWCHolder::addDisplayData ( DisplayData displaydata,
int  position = -1 
)
virtual

Add or remove a DisplayData, or remove all DisplayDatas on this MultiWCHolder.

void casa::MultiWCHolder::addToAllWorldCanvasHolders ( DisplayData displaydata,
int  position 
)
private

Add/remove a DisplayData to/from all WorldCanvasHolders.

virtual void casa::MultiWCHolder::addWCHolder ( WorldCanvasHolder holder)
virtual

Add or remove a WorldCanvasHolder, or remove all WorldCanvasHolders on this MultiWCHolder.

holder is added at the end of the list. When a new WorldCanvasHolder is added, it will automatically have all registered DisplayDatas added to it.

virtual void casa::MultiWCHolder::adjustBIndexName ( AttributeBuffer rstrs)
protectedvirtual

Adjust name of "bIndex" Attribute (if any) to indlude ID of this MWCH.

virtual casacore::Int casa::MultiWCHolder::bIndex ( )
virtual
virtual casacore::Int casa::MultiWCHolder::bLength ( )
virtual

These orrespond to 'zIndex, zLength' for animator's 'blink mode'.

virtual void casa::MultiWCHolder::clear ( )
inlinevirtual

Clear PC in MWCH's area (not implemented on this level).

Reimplemented in casa::PanelDisplay.

Definition at line 203 of file MultiWCHolder.h.

virtual casacore::Bool casa::MultiWCHolder::conforms ( DisplayData dd,
casacore::Bool  testRstrs = true,
casacore::Bool  testCS = true,
casacore::Bool  testZ = true,
casacore::Int  wchIndex = 0 
)
virtual

Test conformance of a DD to a WCH of this MWCH (by default, test against the first one (WCH 0), which always exists).

The three aspects of conformance can be selectively tested.

std::list<DisplayData*>& casa::MultiWCHolder::displayDatas ( )
inline

Added to collect region statistics from MultiRectTool::update_stats()...

Definition at line 206 of file MultiWCHolder.h.

References itsDDList.

void casa::MultiWCHolder::distributeRestrictions ( )
private

Distribute restrictions to all WorldCanvasHolders.

virtual void casa::MultiWCHolder::hold ( )
virtual

Hold and release response to refreshes requested with the refresh() member function.

Multiple calls to hold() can be made, and refreshes will not resume until the same number of calls have been made to release(). Note that these functions do not affect whether internally (implicitly) generated refreshes continue to occur. That is, refresh events due to PixelCanvas resize events, or Colormap changes, for example, will continue to be acted upon.

void casa::MultiWCHolder::installRestrictions ( WorldCanvasHolder holder)
private

Set restrictions on a particular WorldCanvasHolder.

casacore::Bool casa::MultiWCHolder::isAlreadyRegistered ( const WorldCanvasHolder holder)
private

Do we already have this WorldCanvasHolder/DisplayData registered?

casacore::Bool casa::MultiWCHolder::isAlreadyRegistered ( const DisplayData displaydata)
private
virtual casacore::Bool casa::MultiWCHolder::isBlinkDD ( DisplayData dd)
virtual

Determines which DDs will be restricted, which are always active.

virtual casacore::Int casa::MultiWCHolder::nWCHs ( )
inlinevirtual

Return number of WCHs (subpanels).

Definition at line 198 of file MultiWCHolder.h.

References itsWCHList.

Referenced by casa::QtDisplayPanel::nPanels().

virtual void casa::MultiWCHolder::refresh ( const Display::RefreshReason reason = Display::UserCommand)
virtual

Distribute a refresh event to all the held WorldCanvasHolders.

Referenced by casa::QtDisplayPanel::refresh().

virtual void casa::MultiWCHolder::release ( )
virtual
void casa::MultiWCHolder::removeAllDisplayDatas ( WorldCanvasHolder holder,
const casacore::Bool permanent = false 
)
private
virtual void casa::MultiWCHolder::removeDisplayData ( DisplayData displaydata)
virtual
virtual void casa::MultiWCHolder::removeDisplayDatas ( )
virtual
void casa::MultiWCHolder::removeFromAllWorldCanvasHolders ( DisplayData displaydata)
private
virtual void casa::MultiWCHolder::removeRestriction ( const casacore::String name)
virtual
virtual void casa::MultiWCHolder::removeRestrictions ( )
virtual
virtual void casa::MultiWCHolder::removeWCHolder ( WorldCanvasHolder holder)
virtual
virtual void casa::MultiWCHolder::removeWCHolders ( )
virtual
virtual void casa::MultiWCHolder::setBIndexName ( )
protectedvirtual

Copy constructor - construct a new MultiWCHolder from other.

MultiWCHolder(const MultiWCHolder &other);

Copy assignment using copy semantics. MultiWCHolder &operator==(const MultiWCHolder &other);

(permanently) sets itsBIndexName (below). Called only in constructor.

void casa::MultiWCHolder::setBlinkMode ( bool  blinkMode)

Sets whether the viewer is in blink mode.

virtual void casa::MultiWCHolder::setLinearRestrictions ( AttributeBuffer restrictions,
const AttributeBuffer increments 
)
virtual

Incrementally distribute restrictions to all of the WorldCanvasHolders.

The value of the restrictions are incremented by the given amount for each holder beyond the first one. The given restrictions may have tolerances, and the base types of each restriction and increment must be identical. That is, restriction.getType() == increment.getType(). Other methods to distribute restrictions in other ways are easily imagined, eg. a vector of Attributes is given. After being called, restrictions are equal to the values set on the final WorldCanvasHolder in the list.

virtual void casa::MultiWCHolder::setRestriction ( const Attribute restriction)
virtual

Install or remove a single restriction, or a buffer of restrictions, on all of the WorldCanvasHolders managed by this MultiWCHolder.

virtual void casa::MultiWCHolder::setRestrictions ( const AttributeBuffer restrictions)
virtual
virtual casacore::uInt casa::MultiWCHolder::zLength ( )
virtual

Member Data Documentation

AttributeBuffer casa::MultiWCHolder::itsAttributes
private

The buffer of attributes which are presently installed on the registered WorldCanvasHolders.

Definition at line 258 of file MultiWCHolder.h.

casacore::Int casa::MultiWCHolder::itsBIndex
private

Index of DD to show in first WCH when blink mode is active (it is kept up-to-date in any case).

Definition at line 246 of file MultiWCHolder.h.

casacore::String casa::MultiWCHolder::itsBIndexName
private

The (unchanging) name of the blink restriction: "bIndex" followed by an ID unique to this MWCH.

The ID is because DDs can be registered on more than one MWCH and need a different "bIndex" restriction on each one. Note, however, that when setLinearRestrictions() is used externally to set the blink restriction onto the WCHs, it simply uses the name "bIndex".

Definition at line 254 of file MultiWCHolder.h.

casacore::Int casa::MultiWCHolder::itsBLength
private

Number of DDs above.

Definition at line 242 of file MultiWCHolder.h.

casacore::Block<void*> casa::MultiWCHolder::itsBlinkDDs
private

Subset of above DDs which will have blinking restrictions added (Countour plots, e.g., do not; they always display).

This should actually be a casacore::Block<DisplayData*>.

Definition at line 239 of file MultiWCHolder.h.

std::list<DisplayData*> casa::MultiWCHolder::itsDDList
private

The list of DisplayDatas that are managed by this MultiWCHolder.

Definition at line 234 of file MultiWCHolder.h.

Referenced by displayDatas().

Display::RefreshReason casa::MultiWCHolder::itsHeldReason
private

The reason for the held-up refresh event.

Definition at line 270 of file MultiWCHolder.h.

casacore::Int casa::MultiWCHolder::itsHoldCount
private

The current hold count of this MultiWCHolder.

Whenever new WCHolders are added, their count is increased to this value. Calls to hold() and release() modify this count as well as those per canvas.

Definition at line 264 of file MultiWCHolder.h.

casacore::Bool casa::MultiWCHolder::itsRefreshHeld
private

The current state of whether a refresh was held up or not.

Definition at line 267 of file MultiWCHolder.h.

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

The list of WorldCanvasHolders that are managed by this MultiWCHolder.

Definition at line 231 of file MultiWCHolder.h.

Referenced by nWCHs().


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