casa
5.7.0-16
|
A holder to interface between DisplayDatas and a WorldCanvas. More...
#include <WorldCanvasHolder.h>
Public Member Functions | |
WorldCanvasHolder (WorldCanvas *canvas) | |
Constructor. More... | |
virtual | ~WorldCanvasHolder () |
Destructor. More... | |
virtual WorldCanvas * | worldCanvas () const |
Return the WorldCanvas which is held by this WorldCanvasHolder. More... | |
virtual void | addDisplayData (DisplayData *dData, int position) |
Add a DisplayData object to the list of DisplayDatas registered on the held WorldCanvas by this WorldCanvasHolder. More... | |
virtual void | removeDisplayData (DisplayData &dData, casacore::Bool ignoreRefresh=false) |
Remove a DisplayData from the list of DisplayDatas which are registered by this WorldCanvasHolder for display on the held WorldCanvas. More... | |
virtual casacore::uInt | nDisplayDatas () const |
How many DisplayDatas are registered? More... | |
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. More... | |
void | setRestrictions (const AttributeBuffer &resBuff) |
casacore::Bool | existRestriction (const casacore::String &name) const |
Check if a named restriction exists. More... | |
void | setBlinkMode (bool mode) |
Set whether or not the viewer is in blink mode. More... | |
void | removeRestriction (const casacore::String &restrictionName) |
Remove the named restriction, or all restrictions, from the WorldCanvasHolder. More... | |
void | removeRestrictions () |
casacore::Bool | matchesRestriction (const Attribute &restriction) const |
Determine whether the restrictions installed on the WorldCanvasHolder match the given restriction or buffer of restrictions. More... | |
casacore::Bool | matchesRestrictions (const AttributeBuffer &buffer) const |
const AttributeBuffer * | restrictionBuffer () const |
Return the buffer of restrictions installed on this WorldCanvasHolder. More... | |
virtual void | refresh (const Display::RefreshReason &reason=Display::UserCommand, const casacore::Bool &explicitrequest=true) |
Invoke a refresh on the WorldCanvas, ie. More... | |
virtual casacore::Bool | executeSizeControl (WorldCanvas *wCanvas) |
Handle size control requests originating from the WorldCanvas. More... | |
virtual void | operator() (const WCPositionEvent &ev) |
Distribute a WCPositionEvent originating from the held WorldCanvas over the DisplayDatas. More... | |
virtual void | operator() (const WCRefreshEvent &ev) |
Distribute a WCRefreshEvent originating from the held WorldCanvas over the DisplayDatas. More... | |
virtual void | operator() (const WCMotionEvent &ev) |
Distribute a WCMotionEvent originating from the held WorldCanvas over the DisplayDatas. More... | |
virtual void | handleEvent (DisplayEvent &ev) |
Handle other, generic types of events. More... | |
virtual casacore::Bool | linToWorld (casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &lin) |
casacore::Coordinate conversion routines, handled for the WorldCanvas. More... | |
virtual casacore::Bool | worldToLin (casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &world) |
transform the world point (N-dimensional) into a lin coordinate (2-dimensional), returning false if the coordinate could not be transformed. More... | |
virtual casacore::Bool | linToWorld (casacore::Matrix< casacore::Double > &world, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &lin) |
Batch transformation where each row of lin is a coordinate that is transformed into each row of world. More... | |
virtual casacore::Bool | worldToLin (casacore::Matrix< casacore::Double > &lin, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &world) |
Batch transformation where each row of world is a coordinate that is transformed into each row of lin. More... | |
virtual casacore::uInt | nWorldAxes () const |
Return the number of world axes, which is hard-wired to 2. More... | |
virtual casacore::uInt | nelements () |
Maximum number of animation frames of all registered DDs which are valid for the WC's current CS state. More... | |
virtual void | cleanup () |
Force a cleanup of all the DisplayDatas which are registered with this WorldCanvasHolder. More... | |
const DisplayData * | csMaster () const |
The DD in charge of setting WC coordinate state (0 if none). More... | |
casacore::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). More... | |
void | clearCSMasterSettings (WorldCanvas *wCanvas, bool clearZoom=true) |
casacore::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. More... | |
virtual casacore::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. More... | |
bool | setCSMaster (DisplayData *dd) |
const std::list< DisplayData * > & | displaylist () const |
casacore::Float | getDrawUnit () const |
Returns the current pgp draw unit, which depends on the x-range of the data currently being displayed. More... | |
std::string | errorMessage () const |
Public Member Functions inherited from casa::WCRefreshEH | |
WCRefreshEH () | |
Default Constructor Required. More... | |
virtual | ~WCRefreshEH () |
Destructor. More... | |
Public Member Functions inherited from casa::DisplayEH | |
virtual | ~DisplayEH () |
Public Member Functions inherited from casa::WCMotionEH | |
WCMotionEH () | |
Default Constructor Required. More... | |
virtual | ~WCMotionEH () |
Destructor. More... | |
Public Member Functions inherited from casa::WCPositionEH | |
WCPositionEH () | |
Default Constructor Required. More... | |
virtual | ~WCPositionEH () |
Destructor. More... | |
Public Member Functions inherited from casa::WCSizeControlHandler | |
WCSizeControlHandler () | |
Default Constructor Required. More... | |
virtual | ~WCSizeControlHandler () |
Destructor. More... | |
Public Member Functions inherited from casa::WCCoordinateHandler | |
WCCoordinateHandler () | |
Default Constructor Required. More... | |
virtual | ~WCCoordinateHandler () |
Routines that give the axes names and the unit. More... | |
Static Public Attributes | |
static const casacore::String | BLINK_MODE |
Private Member Functions | |
casacore::String | getTitleDDName (const casacore::Vector< casacore::Bool > &conforms) const |
DisplayData * | getTitleDDBlink (const casacore::Vector< casacore::Bool > &conforms) const |
DisplayData * | getTitleDDNormal (const casacore::Vector< casacore::Bool > &conforms) const |
casacore::String | getTitle (DisplayData *dd) const |
void | labelAxes (const casacore::Vector< casacore::Bool > &conforms, const WCRefreshEvent &ev) |
void | labelAxesBlink (const casacore::Vector< casacore::Bool > &conforms, const WCRefreshEvent &ev) |
void | labelAxesNormal (const casacore::Vector< casacore::Bool > &conforms, const WCRefreshEvent &ev) |
void | setControllingTitle (const casacore::Vector< casacore::Bool > &conforms) |
void | clearSubstituteTitles () |
casacore::Vector< casacore::Bool > | getConformance () const |
Private Attributes | |
bool | blinkMode |
true if the viewer is in blink mode. More... | |
WorldCanvas * | itsWorldCanvas |
The WorldCanvas that is held by this WorldCanvasHolder. More... | |
std::list< DisplayData * > | itsDisplayList |
A list containing the DisplayDatas that are registered on this WorldCanvasHolder. More... | |
DisplayData * | controllingDD |
void * | itsLastCSmaster |
The CS master in effect after executeSizeControl was last run (0 if none). More... | |
casacore::Float | drawUnit |
std::string | error_string |
A holder to interface between DisplayDatas and a WorldCanvas.
Public interface
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.
Definition at line 83 of file WorldCanvasHolder.h.
casa::WorldCanvasHolder::WorldCanvasHolder | ( | WorldCanvas * | canvas | ) |
Constructor.
A WorldCanvas must be provided for the constructed WorldCanvasHolder to "hold".
|
virtual |
Destructor.
|
virtual |
Add a DisplayData object to the list of DisplayDatas registered on the held WorldCanvas by this WorldCanvasHolder.
|
virtual |
Force a cleanup of all the DisplayDatas which are registered with this WorldCanvasHolder.
void casa::WorldCanvasHolder::clearCSMasterSettings | ( | WorldCanvas * | wCanvas, |
bool | clearZoom = true |
||
) |
|
private |
|
inline |
The DD in charge of setting WC coordinate state (0 if none).
Definition at line 233 of file WorldCanvasHolder.h.
References casa::WorldCanvas::csMaster(), and itsWorldCanvas.
|
inline |
Definition at line 261 of file WorldCanvasHolder.h.
References itsDisplayList.
|
inlinevirtual |
Implements casa::WCCoordinateHandler.
Definition at line 273 of file WorldCanvasHolder.h.
References error_string.
|
virtual |
Handle size control requests originating from the WorldCanvas.
Implements casa::WCSizeControlHandler.
|
inline |
Check if a named restriction exists.
Definition at line 134 of file WorldCanvasHolder.h.
References casa::WorldCanvas::existRestriction(), and itsWorldCanvas.
|
private |
casacore::Float casa::WorldCanvasHolder::getDrawUnit | ( | ) | const |
Returns the current pgp draw unit, which depends on the x-range of the data currently being displayed.
|
private |
|
private |
|
private |
|
private |
|
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.
|
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 240 of file WorldCanvasHolder.h.
References casa::WorldCanvas::isCSmaster(), and itsWorldCanvas.
|
private |
|
private |
|
private |
|
virtual |
casacore::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.
|
inlinevirtual |
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 casacore::Vector<casacore::Double> version of linToWorld.
Reimplemented from casa::WCCoordinateHandler.
Definition at line 208 of file WorldCanvasHolder.h.
References casa::WCCoordinateHandler::linToWorld().
|
inline |
Determine whether the restrictions installed on the WorldCanvasHolder match the given restriction or buffer of restrictions.
Definition at line 158 of file WorldCanvasHolder.h.
References itsWorldCanvas, and casa::WorldCanvas::matchesRestriction().
|
inline |
Definition at line 161 of file WorldCanvasHolder.h.
References itsWorldCanvas, and casa::WorldCanvas::matchesRestrictions().
|
virtual |
How many DisplayDatas are registered?
|
virtual |
Maximum number of animation frames of all registered DDs which are valid for the WC's current CS state.
|
inlinevirtual |
Return the number of world axes, which is hard-wired to 2.
Implements casa::WCCoordinateHandler.
Definition at line 220 of file WorldCanvasHolder.h.
|
virtual |
Distribute a WCPositionEvent originating from the held WorldCanvas over the DisplayDatas.
Implements casa::WCPositionEH.
|
virtual |
Distribute a WCRefreshEvent originating from the held WorldCanvas over the DisplayDatas.
Implements casa::WCRefreshEH.
|
virtual |
Distribute a WCMotionEvent originating from the held WorldCanvas over the DisplayDatas.
Implements casa::WCMotionEH.
|
virtual |
Invoke a refresh on the WorldCanvas, ie.
this is a shorthand for WorldCanvasHolder->worldCanvas()->refresh(reason);.
|
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
|
inline |
Remove the named restriction, or all restrictions, from the WorldCanvasHolder.
Definition at line 146 of file WorldCanvasHolder.h.
References itsWorldCanvas, and casa::WorldCanvas::removeRestriction().
|
inline |
Definition at line 149 of file WorldCanvasHolder.h.
References itsWorldCanvas, and casa::WorldCanvas::removeRestrictions().
|
inline |
Return the buffer of restrictions installed on this WorldCanvasHolder.
Definition at line 168 of file WorldCanvasHolder.h.
References itsWorldCanvas, and casa::WorldCanvas::restrictionBuffer().
|
inline |
Set whether or not the viewer is in blink mode.
Definition at line 139 of file WorldCanvasHolder.h.
References blinkMode.
|
private |
bool casa::WorldCanvasHolder::setCSMaster | ( | DisplayData * | dd | ) |
|
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 121 of file WorldCanvasHolder.h.
References casacore::String::c_str(), casa::Attribute::getName(), casa::Attribute::getType(), itsWorldCanvas, and casa::WorldCanvas::setRestriction().
|
inline |
Definition at line 128 of file WorldCanvasHolder.h.
References itsWorldCanvas, and casa::WorldCanvas::setRestrictions().
|
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.
|
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 250 of file WorldCanvasHolder.h.
References itsLastCSmaster.
|
inlinevirtual |
Return the WorldCanvas which is held by this WorldCanvasHolder.
Definition at line 99 of file WorldCanvasHolder.h.
References itsWorldCanvas.
Referenced by casa::RSUtils::hasDirectionCoordinate(), and casa::RSUtils::worldSystem().
|
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.
|
inlinevirtual |
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 casacore::Vector<casacore::Double> version of worldToLin.
Reimplemented from casa::WCCoordinateHandler.
Definition at line 213 of file WorldCanvasHolder.h.
References casa::WCCoordinateHandler::worldToLin().
|
static |
Definition at line 271 of file WorldCanvasHolder.h.
|
private |
true if the viewer is in blink mode.
Definition at line 277 of file WorldCanvasHolder.h.
Referenced by setBlinkMode().
|
private |
Definition at line 285 of file WorldCanvasHolder.h.
|
private |
Definition at line 295 of file WorldCanvasHolder.h.
|
private |
Definition at line 307 of file WorldCanvasHolder.h.
Referenced by errorMessage().
|
private |
A list containing the DisplayDatas that are registered on this WorldCanvasHolder.
Definition at line 284 of file WorldCanvasHolder.h.
Referenced by displaylist().
|
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 294 of file WorldCanvasHolder.h.
Referenced by wasCSmaster().
|
private |
The WorldCanvas that is held by this WorldCanvasHolder.
Definition at line 280 of file WorldCanvasHolder.h.
Referenced by csMaster(), existRestriction(), isCSmaster(), matchesRestriction(), matchesRestrictions(), removeRestriction(), removeRestrictions(), restrictionBuffer(), setRestriction(), setRestrictions(), and worldCanvas().