casa::WorldCanvasHolder Class Reference

A holder to interface between DisplayDatas and a WorldCanvas. More...

#include <WorldCanvasHolder.h>

Inheritance diagram for casa::WorldCanvasHolder:
casa::WCRefreshEH casa::WCMotionEH casa::WCPositionEH casa::WCSizeControlHandler casa::WCCoordinateHandler casa::DisplayEH

List of all members.

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, int position)
 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 uInt nDisplayDatas () const
 How many DisplayDatas are registered?
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.
void setRestrictions (const AttributeBuffer &resBuff)
Bool existRestriction (const String &name) const
 Check if a named restriction exists.
void setBlinkMode (bool mode)
 Set whether or not the viewer is in blink mode.
void removeRestriction (const String &restrictionName)
 Remove the named restriction, or all restrictions, from the WorldCanvasHolder.
void removeRestrictions ()
Bool matchesRestriction (const Attribute &restriction) const
 Determine whether the restrictions installed on the WorldCanvasHolder match the given restriction or buffer of restrictions.
Bool matchesRestrictions (const AttributeBuffer &buffer) const
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 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 uInt nWorldAxes () const
 Return the number of world axes, which is hard-wired to 2.
virtual 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.
const DisplayDatacsMaster () const
 The DD in charge of setting WC coordinate state (0 if none).
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).
void clearCSMasterSettings (WorldCanvas *wCanvas, bool clearZoom=true)
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.
bool setCSMaster (DisplayData *dd)
const std::list< DisplayData * > & displaylist () const
Float getDrawUnit () const
 Returns the current pgp draw unit, which depends on the x-range of the data currently being displayed.
std::string errorMessage () const

Static Public Attributes

static const String BLINK_MODE

Private Member Functions

String getTitleDDName (const Vector< Bool > &conforms) const
DisplayDatagetTitleDDBlink (const Vector< Bool > &conforms) const
DisplayDatagetTitleDDNormal (const Vector< Bool > &conforms) const
String getTitle (DisplayData *dd) const
void labelAxes (const Vector< Bool > &conforms, const WCRefreshEvent &ev)
void labelAxesBlink (const Vector< Bool > &conforms, const WCRefreshEvent &ev)
void labelAxesNormal (const Vector< Bool > &conforms, const WCRefreshEvent &ev)
void setControllingTitle (const Vector< Bool > &conforms)
void clearSubstituteTitles ()
Vector< Bool > getConformance () const

Private Attributes

bool blinkMode
 True if the viewer is in blink mode.
WorldCanvasitsWorldCanvas
 The WorldCanvas that is held by this WorldCanvasHolder.
std::list< DisplayData * > itsDisplayList
 A list containing the DisplayDatas that are registered on this WorldCanvasHolder.
DisplayDatacontrollingDD
void * itsLastCSmaster
 The CS master in effect after executeSizeControl was last run (0 if none).
Float drawUnit
std::string error_string

Detailed Description

A holder to interface between DisplayDatas and a WorldCanvas.

Intended use:

Public interface

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.


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 void casa::WorldCanvasHolder::addDisplayData ( DisplayData dData,
int  position 
) [virtual]

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

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

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

void casa::WorldCanvasHolder::clearCSMasterSettings ( WorldCanvas wCanvas,
bool  clearZoom = true 
)
void casa::WorldCanvasHolder::clearSubstituteTitles (  )  [private]
const DisplayData* casa::WorldCanvasHolder::csMaster (  )  const [inline]

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

Definition at line 227 of file WorldCanvasHolder.h.

References casa::WorldCanvas::csMaster(), and itsWorldCanvas.

const std::list<DisplayData*>& casa::WorldCanvasHolder::displaylist (  )  const [inline]

Definition at line 255 of file WorldCanvasHolder.h.

References itsDisplayList.

std::string casa::WorldCanvasHolder::errorMessage (  )  const [inline, virtual]

Implements casa::WCCoordinateHandler.

Definition at line 267 of file WorldCanvasHolder.h.

References error_string.

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

Handle size control requests originating from the WorldCanvas.

Implements casa::WCSizeControlHandler.

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

Check if a named restriction exists.

Definition at line 128 of file WorldCanvasHolder.h.

References casa::WorldCanvas::existRestriction(), and itsWorldCanvas.

Vector<Bool> casa::WorldCanvasHolder::getConformance (  )  const [private]
Float casa::WorldCanvasHolder::getDrawUnit (  )  const

Returns the current pgp draw unit, which depends on the x-range of the data currently being displayed.

String casa::WorldCanvasHolder::getTitle ( DisplayData dd  )  const [private]
DisplayData* casa::WorldCanvasHolder::getTitleDDBlink ( const Vector< Bool > &  conforms  )  const [private]
String casa::WorldCanvasHolder::getTitleDDName ( const Vector< Bool > &  conforms  )  const [private]
DisplayData* casa::WorldCanvasHolder::getTitleDDNormal ( const Vector< Bool > &  conforms  )  const [private]
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.

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

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 234 of file WorldCanvasHolder.h.

References casa::WorldCanvas::isCSmaster(), and itsWorldCanvas.

void casa::WorldCanvasHolder::labelAxes ( const Vector< Bool > &  conforms,
const WCRefreshEvent ev 
) [private]
void casa::WorldCanvasHolder::labelAxesBlink ( const Vector< Bool > &  conforms,
const WCRefreshEvent ev 
) [private]
void casa::WorldCanvasHolder::labelAxesNormal ( const Vector< Bool > &  conforms,
const WCRefreshEvent ev 
) [private]
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 202 of file WorldCanvasHolder.h.

References linToWorld().

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.

Referenced by linToWorld().

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

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

Definition at line 152 of file WorldCanvasHolder.h.

References itsWorldCanvas, and casa::WorldCanvas::matchesRestriction().

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

How many DisplayDatas are registered?

virtual 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 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 214 of file WorldCanvasHolder.h.

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

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

Implements casa::WCMotionEH.

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

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

Implements casa::WCRefreshEH.

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

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

Implements casa::WCPositionEH.

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

void casa::WorldCanvasHolder::removeRestriction ( const String &  restrictionName  )  [inline]

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

Definition at line 140 of file WorldCanvasHolder.h.

References itsWorldCanvas, and casa::WorldCanvas::removeRestriction().

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

Definition at line 143 of file WorldCanvasHolder.h.

References itsWorldCanvas, and casa::WorldCanvas::removeRestrictions().

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

Return the buffer of restrictions installed on this WorldCanvasHolder.

Definition at line 162 of file WorldCanvasHolder.h.

References itsWorldCanvas, and casa::WorldCanvas::restrictionBuffer().

void casa::WorldCanvasHolder::setBlinkMode ( bool  mode  )  [inline]

Set whether or not the viewer is in blink mode.

Definition at line 133 of file WorldCanvasHolder.h.

References blinkMode.

void casa::WorldCanvasHolder::setControllingTitle ( const Vector< Bool > &  conforms  )  [private]
bool casa::WorldCanvasHolder::setCSMaster ( DisplayData dd  ) 
void casa::WorldCanvasHolder::setRestriction ( const Attribute restriction  )  [inline]

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.

Definition at line 117 of file WorldCanvasHolder.h.

References casa::Attribute::getName(), casa::Attribute::getType(), itsWorldCanvas, and casa::WorldCanvas::setRestriction().

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

Definition at line 122 of file WorldCanvasHolder.h.

References itsWorldCanvas, and casa::WorldCanvas::setRestrictions().

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.

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

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 244 of file WorldCanvasHolder.h.

References itsLastCSmaster.

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.

Referenced by casa::RSUtils::hasDirectionCoordinate(), and casa::RSUtils::worldSystem().

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 207 of file WorldCanvasHolder.h.

References worldToLin().

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.

Referenced by worldToLin().


Member Data Documentation

const String casa::WorldCanvasHolder::BLINK_MODE [static]

Definition at line 265 of file WorldCanvasHolder.h.

True if the viewer is in blink mode.

Definition at line 271 of file WorldCanvasHolder.h.

Referenced by setBlinkMode().

Definition at line 279 of file WorldCanvasHolder.h.

Definition at line 289 of file WorldCanvasHolder.h.

Definition at line 301 of file WorldCanvasHolder.h.

Referenced by errorMessage().

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

Definition at line 278 of file WorldCanvasHolder.h.

Referenced by displaylist().

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 288 of file WorldCanvasHolder.h.

Referenced by wasCSmaster().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1