casa::WorldCanvasHolder Class Reference
[Display]

#include <WorldCanvasHolder.h>

Inheritance diagram for casa::WorldCanvasHolder:

Inheritance graph
[legend]
Collaboration diagram for casa::WorldCanvasHolder:

Collaboration graph
[legend]
List of all members.

Detailed Description

A holder to interface between DisplayDatas and a WorldCanvas.

Intended use:

Part of API

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The WorldCanvasHolder "holds" a WorldCanvas and some number of DisplayDatas which are "registered" on the WorldCanvas. It actually registers itself to handle the WC events, and passes the events on to the DDs.

Synopsis

Example

Motivation

Definition at line 79 of file WorldCanvasHolder.h.

Public Member Functions

 WorldCanvasHolder (WorldCanvas *canvas)
 Constructor.
virtual ~WorldCanvasHolder ()
 Destructor.
virtual WorldCanvasworldCanvas () const
 Return the WorldCanvas which is held by this WorldCanvasHolder.
virtual void addDisplayData (DisplayData *dData)
 Add a DisplayData object to the list of DisplayDatas registered on the held WorldCanvas by this WorldCanvasHolder.
virtual void removeDisplayData (DisplayData &dData, Bool ignoreRefresh=False)
 Remove a DisplayData from the list of DisplayDatas which are registered by this WorldCanvasHolder for display on the held WorldCanvas.
virtual const uInt nDisplayDatas () const
 How many DisplayDatas are registered?
virtual const Bool existRestriction (const String &name) const
 Check if a named restriction exists.
virtual const AttributeBufferrestrictionBuffer () const
 Return the buffer of restrictions installed on this WorldCanvasHolder.
virtual void refresh (const Display::RefreshReason &reason=Display::UserCommand, const Bool &explicitrequest=True)
 Invoke a refresh on the WorldCanvas, ie.
virtual Bool executeSizeControl (WorldCanvas *wCanvas)
 Handle size control requests originating from the WorldCanvas.
virtual void operator() (const WCPositionEvent &ev)
 Distribute a WCPositionEvent originating from the held WorldCanvas over the DisplayDatas.
virtual void operator() (const WCRefreshEvent &ev)
 Distribute a WCRefreshEvent originating from the held WorldCanvas over the DisplayDatas.
virtual void operator() (const WCMotionEvent &ev)
 Distribute a WCMotionEvent originating from the held WorldCanvas over the DisplayDatas.
virtual void handleEvent (DisplayEvent &ev)
 Handle other, generic types of events.
virtual uInt nWorldAxes () const
 Return the number of world axes, which is hard-wired to 2.
virtual const uInt nelements ()
 Maximum number of animation frames of all registered DDs which are valid for the WC's current CS state.
virtual void cleanup ()
 Force a cleanup of all the DisplayDatas which are registered with this WorldCanvasHolder.
virtual const DisplayDatacsMaster () const
 The DD in charge of setting WC coordinate state (0 if none).
virtual Bool isCSmaster (const DisplayData *dd) const
 Is the specified DisplayData the one in charge of WC state? (During DD::sizeControl() execution, it means instead that the DD has permission to become CSmaster, if it can).
virtual Bool wasCSmaster (DisplayData *dd=0) const
 Was the passed DD the last CS master (or, if no DD passed, was there any CS master)? For convenience of the DDs during the next sizeControl execution, in determining whether a CS master change is occurring, and whether anyone was master before.
virtual Bool syncCSmaster (const WorldCanvasHolder *wch)
 used by PanelDisplay on new WCHs to keep a consistent CS master on all its main display WC[H]s.
virtual void setRestriction (const Attribute &restriction)
 Install a single restriction, or a buffer of restrictions, on the WorldCanvasHolder which DisplayData must match in order that they be allowed to draw themselves.
virtual void setRestrictions (const AttributeBuffer &resBuff)
virtual void removeRestriction (const String &restrictionNAme)
 Remove the named restriction, or all restrictions, from the WorldCanvasHolder.
virtual void removeRestrictions ()
virtual Bool matchesRestriction (const Attribute &restriction) const
 Determine whether the restrictions installed on the WorldCanvasHolder match the given restriction or buffer of restrictions.
virtual Bool matchesRestrictions (const AttributeBuffer &buffer) const
virtual Bool linToWorld (Vector< Double > &world, const Vector< Double > &lin)
 Coordinate conversion routines, handled for the WorldCanvas.
virtual Bool worldToLin (Vector< Double > &lin, const Vector< Double > &world)
 transform the world point (N-dimensional) into a lin coordinate (2-dimensional), returning False if the coordinate could not be transformed.
virtual Bool linToWorld (Matrix< Double > &world, Vector< Bool > &failures, const Matrix< Double > &lin)
 Batch transformation where each row of lin is a coordinate that is transformed into each row of world.
virtual Bool worldToLin (Matrix< Double > &lin, Vector< Bool > &failures, const Matrix< Double > &world)
 Batch transformation where each row of world is a coordinate that is transformed into each row of lin.
virtual Vector< StringworldAxisNames ()
 Return the names and units of the world coordinate axes.
virtual Vector< StringworldAxisUnits ()

Private Attributes

WorldCanvasitsWorldCanvas
 The WorldCanvas that is held by this WorldCanvasHolder.
List< DisplayData * > itsDisplayList
 A list containing the DisplayDatas that are registered on this WorldCanvasHolder.
AttributeBuffer itsRestrictions
 A buffer to contain the restrictions that DisplayDatas must match if they are to be allowed to draw themselves.
DisplayDataitsCSmaster
 [First] responder to 'sizeControl', responsible for setting WC CS, zoom window and draw area.
void * itsLastCSmaster
 The CS master in effect after executeSizeControl was last run (0 if none).


Constructor & Destructor Documentation

casa::WorldCanvasHolder::WorldCanvasHolder ( WorldCanvas canvas  ) 

Constructor.

A WorldCanvas must be provided for the constructed WorldCanvasHolder to "hold".

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

Destructor.


Member Function Documentation

virtual WorldCanvas* casa::WorldCanvasHolder::worldCanvas (  )  const [inline, virtual]

Return the WorldCanvas which is held by this WorldCanvasHolder.

Definition at line 95 of file WorldCanvasHolder.h.

References itsWorldCanvas.

virtual void casa::WorldCanvasHolder::addDisplayData ( DisplayData dData  )  [virtual]

Add a DisplayData object to the list of DisplayDatas registered on the held WorldCanvas by this WorldCanvasHolder.

virtual void casa::WorldCanvasHolder::removeDisplayData ( DisplayData dData,
Bool  ignoreRefresh = False 
) [virtual]

Remove a DisplayData from the list of DisplayDatas which are registered by this WorldCanvasHolder for display on the held WorldCanvas.

ignoreRefresh tells the DD not to refresh just to clean up DMs

virtual const uInt casa::WorldCanvasHolder::nDisplayDatas (  )  const [virtual]

How many DisplayDatas are registered?

virtual void casa::WorldCanvasHolder::setRestriction ( const Attribute restriction  )  [virtual]

Install a single restriction, or a buffer of restrictions, on the WorldCanvasHolder which DisplayData must match in order that they be allowed to draw themselves.

virtual void casa::WorldCanvasHolder::setRestrictions ( const AttributeBuffer resBuff  )  [virtual]

virtual const Bool casa::WorldCanvasHolder::existRestriction ( const String name  )  const [virtual]

Check if a named restriction exists.

virtual void casa::WorldCanvasHolder::removeRestriction ( const String restrictionNAme  )  [virtual]

Remove the named restriction, or all restrictions, from the WorldCanvasHolder.

virtual void casa::WorldCanvasHolder::removeRestrictions (  )  [virtual]

virtual Bool casa::WorldCanvasHolder::matchesRestriction ( const Attribute restriction  )  const [virtual]

Determine whether the restrictions installed on the WorldCanvasHolder match the given restriction or buffer of restrictions.

virtual Bool casa::WorldCanvasHolder::matchesRestrictions ( const AttributeBuffer buffer  )  const [virtual]

Referenced by casa::DisplayData::conformsToRstrs().

virtual const AttributeBuffer* casa::WorldCanvasHolder::restrictionBuffer (  )  const [virtual]

Return the buffer of restrictions installed on this WorldCanvasHolder.

Referenced by casa::DisplayData::conformsToZIndex().

virtual void casa::WorldCanvasHolder::refresh ( const Display::RefreshReason reason = Display::UserCommand,
const Bool explicitrequest = True 
) [virtual]

Invoke a refresh on the WorldCanvas, ie.

this is a shorthand for WorldCanvasHolder->worldCanvas()->refresh(reason);.

virtual Bool casa::WorldCanvasHolder::executeSizeControl ( WorldCanvas wCanvas  )  [virtual]

Handle size control requests originating from the WorldCanvas.

Implements casa::WCSizeControlHandler.

virtual void casa::WorldCanvasHolder::operator() ( const WCPositionEvent ev  )  [virtual]

Distribute a WCPositionEvent originating from the held WorldCanvas over the DisplayDatas.

Reimplemented from casa::WCPositionEH.

virtual void casa::WorldCanvasHolder::operator() ( const WCRefreshEvent ev  )  [virtual]

Distribute a WCRefreshEvent originating from the held WorldCanvas over the DisplayDatas.

Reimplemented from casa::WCRefreshEH.

virtual void casa::WorldCanvasHolder::operator() ( const WCMotionEvent ev  )  [virtual]

Distribute a WCMotionEvent originating from the held WorldCanvas over the DisplayDatas.

Reimplemented from casa::WCMotionEH.

virtual void casa::WorldCanvasHolder::handleEvent ( DisplayEvent ev  )  [virtual]

Handle other, generic types of events.

As with the handlers above, WCH handles these new events by simply passing them on to the DisplayDatas registered on it. WorldCanvasHolder inherits this new-style event handling interface from DisplayEH, via WCRefreshEH.

Reimplemented from casa::DisplayEH.

virtual Bool casa::WorldCanvasHolder::linToWorld ( Vector< Double > &  world,
const Vector< Double > &  lin 
) [virtual]

Coordinate conversion routines, handled for the WorldCanvas.

In future, they should be handled on the WC itself, via its own CS. At present, these requests are forwarded to the CSmaster DD, which should be equivalent in most cases.

Implements casa::WCCoordinateHandler.

virtual Bool casa::WorldCanvasHolder::worldToLin ( Vector< Double > &  lin,
const Vector< Double > &  world 
) [virtual]

transform the world point (N-dimensional) into a lin coordinate (2-dimensional), returning False if the coordinate could not be transformed.

Derived classes should override.

Implements casa::WCCoordinateHandler.

virtual Bool casa::WorldCanvasHolder::linToWorld ( Matrix< Double > &  world,
Vector< Bool > &  failures,
const Matrix< Double > &  lin 
) [inline, virtual]

Batch transformation where each row of lin is a coordinate that is transformed into each row of world.

On input, if the i'th position in the failures vector is true, the i'th transformation is not attempted. If the j'th transformation fails, the j'th position in the failures vector will be set. The return value is True only when the failures vector has no position set to True; This function is implemented in this base class by making repeated calls to the Vector<Double> version of linToWorld.

Reimplemented from casa::WCCoordinateHandler.

Definition at line 178 of file WorldCanvasHolder.h.

References casa::WCCoordinateHandler::linToWorld().

virtual Bool casa::WorldCanvasHolder::worldToLin ( Matrix< Double > &  lin,
Vector< Bool > &  failures,
const Matrix< Double > &  world 
) [inline, virtual]

Batch transformation where each row of world is a coordinate that is transformed into each row of lin.

On input, if the i'th position in the failures vector is true, the i'th transformation is not attempted. If the j'th transformation fails, the j'th position in the failures vector will be set. The return value is True only when the failures vector has no position set to True; This function is implemented in this base class by making repeated calls to the Vector<Double> version of worldToLin.

Reimplemented from casa::WCCoordinateHandler.

Definition at line 182 of file WorldCanvasHolder.h.

References casa::WCCoordinateHandler::worldToLin().

virtual Vector<String> casa::WorldCanvasHolder::worldAxisNames (  )  [virtual]

Return the names and units of the world coordinate axes.

Implements casa::WCCoordinateHandler.

virtual Vector<String> casa::WorldCanvasHolder::worldAxisUnits (  )  [virtual]

Implements casa::WCCoordinateHandler.

virtual uInt casa::WorldCanvasHolder::nWorldAxes (  )  const [inline, virtual]

Return the number of world axes, which is hard-wired to 2.

Implements casa::WCCoordinateHandler.

Definition at line 194 of file WorldCanvasHolder.h.

virtual const uInt casa::WorldCanvasHolder::nelements (  )  [virtual]

Maximum number of animation frames of all registered DDs which are valid for the WC's current CS state.

virtual void casa::WorldCanvasHolder::cleanup (  )  [virtual]

Force a cleanup of all the DisplayDatas which are registered with this WorldCanvasHolder.

virtual const DisplayData* casa::WorldCanvasHolder::csMaster (  )  const [inline, virtual]

The DD in charge of setting WC coordinate state (0 if none).

Definition at line 207 of file WorldCanvasHolder.h.

References itsCSmaster.

Referenced by isCSmaster().

virtual Bool casa::WorldCanvasHolder::isCSmaster ( const DisplayData dd  )  const [inline, virtual]

Is the specified DisplayData the one in charge of WC state? (During DD::sizeControl() execution, it means instead that the DD has permission to become CSmaster, if it can).

Definition at line 212 of file WorldCanvasHolder.h.

References csMaster().

Referenced by casa::MSAsRaster::conformsToCS().

virtual Bool casa::WorldCanvasHolder::wasCSmaster ( DisplayData dd = 0  )  const [inline, virtual]

Was the passed DD the last CS master (or, if no DD passed, was there any CS master)? For convenience of the DDs during the next sizeControl execution, in determining whether a CS master change is occurring, and whether anyone was master before.

This affects whether any old zoom window is retained or completely reset.

Definition at line 220 of file WorldCanvasHolder.h.

References itsLastCSmaster.

virtual Bool casa::WorldCanvasHolder::syncCSmaster ( const WorldCanvasHolder wch  )  [virtual]

used by PanelDisplay on new WCHs to keep a consistent CS master on all its main display WC[H]s.

Sets [default] CS master dd to that of passed wch (if that dd is registered here), and gets it to reset WC coordinate state.


Member Data Documentation

WorldCanvas* casa::WorldCanvasHolder::itsWorldCanvas [private]

The WorldCanvas that is held by this WorldCanvasHolder.

Definition at line 233 of file WorldCanvasHolder.h.

Referenced by worldCanvas().

List<DisplayData *> casa::WorldCanvasHolder::itsDisplayList [private]

A list containing the DisplayDatas that are registered on this WorldCanvasHolder.

Definition at line 237 of file WorldCanvasHolder.h.

AttributeBuffer casa::WorldCanvasHolder::itsRestrictions [private]

A buffer to contain the restrictions that DisplayDatas must match if they are to be allowed to draw themselves.

Definition at line 241 of file WorldCanvasHolder.h.

DisplayData* casa::WorldCanvasHolder::itsCSmaster [private]

[First] responder to 'sizeControl', responsible for setting WC CS, zoom window and draw area.

It will be 0 initially, and whenever the old master is unregistered (until a new master responds). This is a further attempt toward a coherent sense of 'who's in charge' of WC[H] state (there is more to do).

Some day, the WC CS should be directly responsible for all the Canvas's coordinate conversions. For now at least we'll know that they're done by the DD below (which should be equivalent).

Definition at line 252 of file WorldCanvasHolder.h.

Referenced by csMaster().

void* casa::WorldCanvasHolder::itsLastCSmaster [private]

The CS master in effect after executeSizeControl was last run (0 if none).

For determining (via wasCSmaster(), above) whether a CS master change is occurring, and whether anyone was master before. This affects whether the old zoom window is retained or completely reset. (Note void*, rather than DD*, type: it is not intended to be dereferenced, just compared for equality. The original DD may not even exist by the time it is used).

Definition at line 261 of file WorldCanvasHolder.h.

Referenced by wasCSmaster().


The documentation for this class was generated from the following file:
Generated on Tue Aug 26 22:36:43 2008 for NRAOCASA by  doxygen 1.5.1