MultiWCHolder.h

Classes

MultiWCHolder -- A holder of WorldCanvasHolders to use for panelling applications. (full description)

class MultiWCHolder

Interface

Public Members
MultiWCHolder()
MultiWCHolder(WorldCanvasHolder& holder)
virtual ~MultiWCHolder()
virtual void addWCHolder(WorldCanvasHolder& holder)
virtual void removeWCHolder(WorldCanvasHolder& holder)
virtual void removeWCHolders()
virtual void addDisplayData(DisplayData& displaydata)
virtual void removeDisplayData(DisplayData& displaydata)
virtual void removeDisplayDatas()
virtual void setRestriction(const Attribute& restriction)
virtual void setRestrictions(const AttributeBuffer& restrictions)
virtual void removeRestriction(const String& name)
virtual void removeRestrictions()
virtual void setLinearRestrictions(AttributeBuffer &restrictions, const AttributeBuffer &increments)
virtual void hold()
virtual void release()
virtual void refresh(const Display::RefreshReason &reason = Display::UserCommand)
virtual uInt zLength()
virtual Int bLength()
virtual Int bIndex()
virtual Bool isBlinkDD(DisplayData *dd)
Protected Members
virtual void setBIndexName()
virtual void adjustBIndexName(AttributeBuffer& rstrs)
Private Members
const Bool isAlreadyRegistered(const WorldCanvasHolder &holder)
const Bool isAlreadyRegistered(const DisplayData &displaydata)
void addAllDisplayDatas(WorldCanvasHolder &holder)
void removeAllDisplayDatas(WorldCanvasHolder &holder, const Bool& permanent = False)
void addToAllWorldCanvasHolders(DisplayData &displaydata)
void removeFromAllWorldCanvasHolders(DisplayData &displaydata)
void distributeRestrictions()
void installRestrictions(WorldCanvasHolder &holder)

Description

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

Member Description

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)
virtual void removeWCHolder(WorldCanvasHolder& holder)
virtual void removeWCHolders()

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 addDisplayData(DisplayData& displaydata)
virtual void removeDisplayData(DisplayData& displaydata)
virtual void removeDisplayDatas()

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

virtual void setRestriction(const Attribute& restriction)
virtual void setRestrictions(const AttributeBuffer& restrictions)
virtual void removeRestriction(const String& name)
virtual void removeRestrictions()

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

virtual void setLinearRestrictions(AttributeBuffer &restrictions, const AttributeBuffer &increments)

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 hold()
virtual void release()

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.

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()

virtual Bool isBlinkDD(DisplayData *dd)

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

virtual void setBIndexName()

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.

virtual void adjustBIndexName(AttributeBuffer& rstrs)

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

const Bool isAlreadyRegistered(const WorldCanvasHolder &holder)
const Bool isAlreadyRegistered(const DisplayData &displaydata)

Do we already have this WorldCanvasHolder/DisplayData registered?

void addAllDisplayDatas(WorldCanvasHolder &holder)
void removeAllDisplayDatas(WorldCanvasHolder &holder, const Bool& permanent = False)

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

void addToAllWorldCanvasHolders(DisplayData &displaydata)
void removeFromAllWorldCanvasHolders(DisplayData &displaydata)

Add/remove a DisplayData to/from all WorldCanvasHolders.

void distributeRestrictions()

Distribute restrictions to all WorldCanvasHolders.

void installRestrictions(WorldCanvasHolder &holder)

Set restrictions on a particular WorldCanvasHolder.