casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
casa::MultiWCHolder Class Reference

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

#include <MultiWCHolder.h>

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

List of all members.

Public Member Functions

 MultiWCHolder ()
 Constructor which makes an empty MultiWCHolder.
 MultiWCHolder (WorldCanvasHolder &holder)
 Constructor which makes a MultiWCHolder containing the single specified WorldCanvasHolder.
virtual ~MultiWCHolder ()
 Destructor.
virtual void addWCHolder (WorldCanvasHolder &holder)
 Add or remove a WorldCanvasHolder, or remove all WorldCanvasHolders on this MultiWCHolder.
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.
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.
virtual void setRestrictions (const AttributeBuffer &restrictions)
virtual void removeRestriction (const String &name)
virtual void removeRestrictions ()
virtual void setLinearRestrictions (AttributeBuffer &restrictions, const AttributeBuffer &increments)
 Incrementally distribute restrictions to all of the WorldCanvasHolders.
virtual void hold ()
 Hold and release response to refreshes requested with the refresh() member function.
virtual void release ()
virtual void refresh (const Display::RefreshReason &reason=Display::UserCommand)
 Distribute a refresh event to all the held WorldCanvasHolders.
virtual uInt zLength ()
virtual Int bLength ()
 These orrespond to 'zIndex, zLength' for animator's 'blink mode'.
virtual Int bIndex ()
void setBlinkMode (bool blinkMode)
 Sets whether the viewer is in blink mode.
virtual Bool isBlinkDD (DisplayData *dd)
 Determines which DDs will be restricted, which are always active.
virtual Bool conforms (DisplayData *dd, Bool testRstrs=True, Bool testCS=True, Bool testZ=True, 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).
virtual Int nWCHs ()
 Return number of WCHs (subpanels).
virtual void clear ()
 Clear PC in MWCH's area (not implemented on this level).
List< DisplayData * > * displayDatas ()
 Added to collect region statistics from MultiRectTool::update_stats( )...

Protected Member Functions

virtual void setBIndexName ()
 Copy constructor - construct a new MultiWCHolder from other.
virtual void adjustBIndexName (AttributeBuffer &rstrs)
 Adjust name of "bIndex" Attribute (if any) to indlude ID of this MWCH.

Private Member Functions

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

Private Attributes

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

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 95 of file MultiWCHolder.h.


Constructor & Destructor Documentation

Constructor which makes an empty MultiWCHolder.

Constructor which makes a MultiWCHolder containing the single specified WorldCanvasHolder.

virtual casa::MultiWCHolder::~MultiWCHolder ( ) [virtual]

Destructor.


Member Function Documentation

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.

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) [protected, virtual]

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

virtual Int casa::MultiWCHolder::bIndex ( ) [virtual]
virtual Int casa::MultiWCHolder::bLength ( ) [virtual]

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

virtual void casa::MultiWCHolder::clear ( ) [inline, virtual]

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

Reimplemented in casa::PanelDisplay.

Definition at line 197 of file MultiWCHolder.h.

virtual Bool casa::MultiWCHolder::conforms ( DisplayData dd,
Bool  testRstrs = True,
Bool  testCS = True,
Bool  testZ = True,
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.

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

Definition at line 200 of file MultiWCHolder.h.

References itsDDList.

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.

Set restrictions on a particular WorldCanvasHolder.

Do we already have this WorldCanvasHolder/DisplayData registered?

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

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

virtual Int casa::MultiWCHolder::nWCHs ( ) [inline, virtual]

Return number of WCHs (subpanels).

Definition at line 194 of file MultiWCHolder.h.

References itsWCHList, and casa::List< t >::len().

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 Bool permanent = False 
) [private]
virtual void casa::MultiWCHolder::removeDisplayData ( DisplayData displaydata) [virtual]
virtual void casa::MultiWCHolder::removeDisplayDatas ( ) [virtual]
virtual void casa::MultiWCHolder::removeRestriction ( const 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 ( ) [protected, virtual]

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 uInt casa::MultiWCHolder::zLength ( ) [virtual]

Member Data Documentation

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

Definition at line 250 of file MultiWCHolder.h.

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 238 of file MultiWCHolder.h.

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 246 of file MultiWCHolder.h.

Number of DDs above.

Definition at line 234 of file MultiWCHolder.h.

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

This should actually be a Block<DisplayData*>.

Definition at line 231 of file MultiWCHolder.h.

The list of DisplayDatas that are managed by this MultiWCHolder.

Definition at line 226 of file MultiWCHolder.h.

Referenced by displayDatas().

The reason for the held-up refresh event.

Definition at line 262 of file MultiWCHolder.h.

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 256 of file MultiWCHolder.h.

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

Definition at line 259 of file MultiWCHolder.h.

The list of WorldCanvasHolders that are managed by this MultiWCHolder.

Reimplemented in casa::PanelDisplay.

Definition at line 223 of file MultiWCHolder.h.

Referenced by nWCHs().


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