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

Base class for display objects. More...

#include <DisplayData.h>

Inheritance diagram for casa::DisplayData:
casa::DisplayOptions casa::DisplayEH casa::DlTarget casa::CachingDisplayData casa::NBody casa::PrincipalAxesDD casa::ActiveCaching2dDD casa::PassiveCachingDD casa::LatticePADisplayData< T > casa::ScrollingRasterDD casa::Histogram2dDD casa::MSAsRaster casa::Profile2dDD casa::TblAsContourDD casa::TblAsRasterDD casa::TblAsXYDD casa::WedgeDD casa::AxesDisplayData casa::DrawingDisplayData casa::PassiveTableDD casa::RegionShape casa::LatticeAsContour< T > casa::LatticeAsMarker< T > casa::LatticeAsRaster< T > casa::LatticeAsVector< T >

List of all members.

Public Types

enum  DisplayState {
  DISPLAYED,
  UNDISPLAYED,
  LIMBO
}

Public Member Functions

 DisplayData ()
 (Required) default constructor.
virtual ~DisplayData ()
 required destructor
virtual Bool linToWorld (Vector< Double > &world, const Vector< Double > &lin)=0
 Coordinate transformations, called by WorldCanvasHolder (Matrix versions not implemented)
virtual Bool worldToLin (Vector< Double > &lin, const Vector< Double > &world)=0
virtual String showPosition (const Vector< Double > &world, const Bool &displayAxesOnly=False)=0
 Format a string containing coordinate information at the given world coordinate.
virtual String showValue (const Vector< Double > &world)=0
 Format a string containing value information at the given world coordinate.
virtual void setDisplayState (DisplayState s)
virtual DisplayState getDisplayState () const
virtual bool isDisplayable () const
virtual Vector< StringworldAxisNames () const =0
 Some routines that give info on the axes names, units etc.
virtual Vector< StringworldAxisUnits () const =0
virtual const uInt nelements (const WorldCanvasHolder &wcHolder) const =0
 Returns the number of elements in this DisplayData (mainly for movie purposes).
virtual const uInt nelements () const =0
 and non-specific
virtual void addRestrictions (AttributeBuffer &otherBuf)
 Add general restrictions or a restriction for item itemNum of this DisplayData.
virtual void addRestriction (Attribute &newRestriction, Bool permanent)
virtual void addElementRestrictions (const uInt itemNum, AttributeBuffer &other)
virtual void addElementRestriction (const uInt itemNum, Attribute &newRestriction, Bool permanent)
virtual void setRestrictions (AttributeBuffer &otherBuf)
 Set general restrictions or a restriction for item itemNum of this DisplayData.
virtual void setRestriction (Attribute &newRestriction)
virtual void setElementRestrictions (const uInt itemNum, AttributeBuffer &other)
virtual void setElementRestriction (const uInt itemNum, Attribute &newRestriction)
virtual void removeRestriction (const String &name)
 Remove a general restriction or a restriction from item itemNum
virtual void removeElementRestriction (const uInt itemNum, const String &name)
virtual void clearRestrictions ()
 Clear all general restrictions or all restrictions of item itemNum (except the ones that are permanent of course...)
virtual void clearElementRestrictions (const uInt itemNum)
virtual Bool existRestriction (const String &name)
 Check if a general restriction or a restriction for item itemNum with name name exists.
virtual Bool existElementRestriction (const uInt itemNum, const String &name)
virtual AttributeBufferrestrictionBuffer ()
 Get a handle to the buffer of general restrictions or of the buffer of restrictions for item itemNum
virtual AttributeBufferelementRestrictionBuffer (const uInt itemNum)
virtual Bool conformsTo (const WorldCanvas *wCanvas)
 Check whether the DD is is compatible with all WC[H] state, including its coordinate state, restrictions, and zIndex (if any).
virtual Bool conformsTo (const WorldCanvas &wc)
virtual Bool conformsToRstrs (const WorldCanvas &wc)
 Determine whether DD restrictions are in conformance with restrictions on the given WCH.
virtual Bool conformsToCS (const WorldCanvas &)
 Determine whether DD is compatible with the WC[H]'s current world coordinates.
virtual Bool conformsToZIndex (const WorldCanvas &wc)
 Determine whether DD is compatible with the current canvas animation (zIndex) position.
virtual Int activeZIndex (const WorldCanvas *wc=0)
 Retrieve 'Active' zIndex.
virtual Bool getFirstZIndex (int &firstZIndex, Int axZrng=-1) const
 Set firstZIndex to minimum zIndex setting from all canvases where this DD is registered.
virtual void addPositionEventHandler (WCPositionEH *positionHandler)
 Add event handlers on the DisplayData.
virtual void addMotionEventHandler (WCMotionEH *motionHandler)
virtual void addRefreshEventHandler (WCRefreshEH *refreshHandler)
virtual void addDisplayEventHandler (DisplayEH *displayHandler)
virtual void removePositionEventHandler (WCPositionEH &positionHandler)
 Remove eventhandlers.
virtual void removeMotionEventHandler (WCMotionEH &motionHandler)
virtual void removeRefreshEventHandler (WCRefreshEH &refreshHandler)
virtual void removeDisplayEventHandler (DisplayEH &displayHandler)
virtual void setColormap (Colormap *cmap, Float weight)
 Set/remove/get a ColourMap (sorry, ColorMap) for this DisplayData setColormap() throw an AipsError is a null pointer is passed.
virtual void removeColormap ()
virtual Colormapcolormap () const
void setAttribute (Attribute &at)
 set an Attribute or Attributes
void setAttributes (AttributeBuffer &at)
Bool getAttributeValue (const String &name, uInt &newValue)
 User interface to get value from the attribute buffer.
Bool getAttributeValue (const String &name, Int &newValue)
Bool getAttributeValue (const String &name, Float &newValue)
Bool getAttributeValue (const String &name, Double &newValue)
Bool getAttributeValue (const String &name, Bool &newValue)
Bool getAttributeValue (const String &name, String &newValue)
Bool getAttributeValue (const String &name, Vector< uInt > &newValue)
Bool getAttributeValue (const String &name, Vector< Int > &newValue)
Bool getAttributeValue (const String &name, Vector< Float > &newValue)
Bool getAttributeValue (const String &name, Vector< Double > &newValue)
Bool getAttributeValue (const String &name, Vector< Bool > &newValue)
Bool getAttributeValue (const String &name, Vector< String > &newValue)
Bool existsAttribute (String &name)
 Check if a certain Attribute exists.
void removeAttribute (String &name)
 Remove an Attribute.
AttValue::ValueType attributeType (String &name)
 Get the type of the Attribute.
void setAttributeOnPrimaryWCHs (Attribute &at)
 Set an attribute on any WorldCanvas for which this DD is CS master.
virtual void notifyRegister (WorldCanvasHolder *wcHolder)
virtual void notifyUnregister (WorldCanvasHolder &wcHolder, Bool ignoreRefresh=False)
 ignoreRefresh tells the DD not to refresh just to clean up DMs
virtual void removeFromAllWCHs ()
 remove this DD everywhere--will stop any more refresh handling by the DD.
virtual void setDefaultOptions ()
 install the default options for this DisplayData
virtual Bool setOptions (Record &rec, Record &recOut)
 apply options stored in val to the DisplayData; return value True means a refresh is needed...
virtual Record getOptions ()
 retrieve the current and default options and parameter types.
virtual void refresh (Bool clean=False)
 an explicit refresh: should be called if the DisplayData is changed such that drawing is required.
virtual Bool labelAxes (const WCRefreshEvent &ev)
 an explicit request to draw the axes and/or labels.
virtual String className ()
 Return the class name of this DisplayData; useful mostly for debugging purposes, and perhaps future use in the glish widget interface.
virtual String description () const
virtual Display::DisplayDataType classType ()=0
 Return the DisplayData type; used by the WorldCanvasHolder to determine the order of drawing.
virtual String dataType () const =0
virtual const IPosition dataShape () const =0
virtual const uInt dataDim () const =0
virtual const Unit dataUnit () const =0
virtual std::vector< int > displayAxes () const =0
virtual ImageAnalysisimageanalysis () const
 Get image analyis about images...
virtual ImageInterface< Float > * imageinterface ()
 Returns a pointer that should not be deleted...
const WorldCanvasHolderfindHolder (const WorldCanvas *wCanvas) const
 Identify the WorldCanvasHolder for the given WorldCanvas.
WorldCanvasHolderfindHolder (const WorldCanvas *wCanvas)
virtual Block< IntallZIndices (Int axZrng=-1) const
 Return a sorted Block of all animation frame numbers currently set onto all WCHs where this DD is registered.
virtual Bool zIndexHint (Int &) const
 Will be called just before registering the [GTk]DD on a [GTk]PanelDisplay which has none registered on it yet.
virtual void handleEvent (DisplayEvent &ev)
 Overide DisplayEH::handleEvent.
virtual Bool isCSmaster (const WorldCanvasHolder *wch=0) const
 Is this DD the CS master of the passed WCH? Defaulting wch to 0 asks whether this DD is CS master of some WCH on which it is registered.
virtual Int uiBase ()
 DD 'Absolute Pixel Coordinates', e.g.
virtual void setUIBase (Int uibase)
virtual Bool getDelTmpData ()
 Get and set method for the flag.
virtual void setDelTmpData (Bool delTmpData)

Static Public Attributes

static const String DATA_MIN
 
   

static const String DATA_MAX

Protected Member Functions

virtual Bool setActiveZIndex_ (Int zindex)
 DDs may override to adjust the internal stored current animation index (activeZIndex_) if necessary, and to set return value False iff the passed zindex won't work for the DD.
Bool conformed ()
 Returns result of last call to conformsTo(WCH&).
Bool isCsAndZIndexConformed ()
 Added so that when two images are loaded with no velocity alignment, they can still show their position coordinates without having to be rstrsConformed.
virtual Bool sizeControl (WorldCanvasHolder &wcHolder, AttributeBuffer &holderBuf)=0
 Set (coordinate) state of WCH's WC.
virtual void delTmpData (String &tmpData)
 Delete temporary data.
virtual const List
< WCPositionEH * > * 
positionEventHandlerList ()
 Retrieve position, motion, refresh and display event handler lists.
virtual const List< WCMotionEH * > * motionEventHandlerList ()
virtual const List
< WCRefreshEH * > * 
refreshEventHandlerList ()
virtual const List< DisplayEH * > * displayEventHandlerList ()
virtual void positionEH (const WCPositionEvent &ev)
 Position, motion and refresh event handlers that will generally be called by a WorldCanvasHolder.
virtual void motionEH (const WCMotionEvent &ev)
virtual void refreshEH (const WCRefreshEvent &ev)=0
virtual void cleanup ()=0
 clean up the memory used by this DisplayData
 DisplayData (const DisplayData &other)
 (Required) copy constructor.
void operator= (const DisplayData &other)
 (Required) copy assignment.

Protected Attributes

AttributeBuffer restrictions
 The Book says that we should not put data members in class that is supposed to only define an interface, but by putting these here, we can implement some of the restriction & eventhandling stuff so that people do not have to repeat it.
AttributeBuffer attributes
 buffer for storing Attributes
PtrBlock< void * > DDelement
 list of DisplayDataElements, which are of type DisplayMethod or derived
Int activeZIndex_
 Indicates the 'current' animation frame, i.e.
Bool delTmpData_
 Flag indicating that temporary data should be removed when deleting the object.
Bool rstrsConformed_
 Somewhat limited-use state, saved here for 'efficiency'.
Bool csConformed_
Bool zIndexConformed_

Private Attributes

DisplayState displaystate
 is this data currently being displayed?
ColormapitsColormap
 Colormap for this DisplayData, and its weight.
Float itsColormapWeight
List< WorldCanvasHolder * > itsWCHList
 A list of WorldCanvasHolders for which this DisplayData works.
List< WCPositionEH * > itsPositionEHList
 Lists of position, motion, refresh and display event handlers.
List< WCMotionEH * > itsMotionEHList
List< WCRefreshEH * > itsRefreshEHList
List< DisplayEH * > itsDisplayEHList
Int uiBase_
 DD 'Absolute Pixel Coordinates', e.g.

Friends

class WorldCanvasHolder
 Protected interface for WorldCanvasHolder, can be called by the friends of DisplayData, but are nobody else's business.

Detailed Description

Base class for display objects.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

A class having "DisplayData" as its base is used to generate "Display"s out of "Data."

Synopsis

The basic drawing devices in the Display Library are the PixelCanvas and the WorldCanvas. These devices know nothing about what real data look like, what kind of object will draw on these devices and in what kind of circumstances these devices will be used. The only thing they define is the interface of how to draw on them and the way they communicate with other objects (the event handlers). Building in no assumptions in the Canvases on how they will be used should give larger flexibility in how one can actually use these Canvases. Since the Canvases know nothing about how real data looks, a class is needed to transform data into objects the Canvases do understand. These are the DisplayData. A DisplayData generates, based on data and some algorithm to represent that data, a number of primitives that it draws on the WorldCanvas. So in a way, 'the data draw themselves'. The definition of how data is represented (image, contour, rendering, list of symbols from a catalogue, etc, etc) is entirely defined by these DisplayData and as long it can be done using the primitives of the WorldCanvas, there are no restrictions. If one finds a new way of representing data, the only thing one has to do is to write a new DisplayData that generates this representation and draws it on the WorldCanvas using the primitives of the WorldCnvas.

To do the administration of a number of DisplayDatas on one WorldCanvas, a bookkeeping class is needed, this is the WorldCnvasHolder.

Some DisplayData will consist of a sequence of display object (eg a set of channels in a data cube). The DisplayData are build with sequences in mind (as is clear from the interface), and the Display Library is designed very strongly with movies in mind. The programmer is free to define what a sequence really means, but it is probably best to keep the structure of the sequence in a DisplayData fairly logical. But there is not requirement on the structure of the sequence.

Before a display object is displayed (ie when a refresh happens), a size control step is performed. The WorldCanvas call a sizeControl event handler. Normally this will be a handler that is installed by the WorldCanvasHolder. All the WorldCanvasHolder does is to call the sizeControl member function of all displayData registered with the WorldCanvasHolder to do the sizeControl. The purpose of the size control is to put the WorldCanvas in a correct state before the objects are actually drawn. For example, for images there can be restrictions on the size of the output array (eg the image is expanded using pixelreplication which means that the draw area of the WorldCanvas must by an integral of the size of the image). For each DisplayData the WorldCanvasHolder calls the sizeControl function, supplying an AttributeBuffer where the DisplayData should set the Attributes it needs to be set. THERE IS ONE IMPORTANT RULE IN THIS: a DisplayData should never overwrite an Attribute that is already set in this buffer. If the WorldCanvas cannot be put in a correct state during the size control, a DisplayData should turn itself off. DisplayData are also responsible for the linear coordinate system of the WorldCanvas and usually setting that up will be done in this step.

(dk 6/04 note on 'size control'). The important WC state set during sizeControl() defines a series of coordinate transformations, ultimately between screen (PixelCanvas) pixels and coordinates in world space. First, there are the limits of the WC's 'draw area', inside the labelling margins, on the PC ('canvasDraw{X,Y}{Size,Offset}' WC Attributes). Second is the 'zoom window': the area of 'linear coordinate' space currently mapped to the draw area ('lin{X,Y}{Min,Max}' WC Attributes). Also stored in linear terms are the maximum extents of the data ('lin{X,Y}{Min,Max}Limit' Attributes), which are used to set the zoom window initially or when 'unzoom' (zoom-to-extent) is requested.

'Linear coordinates' often correspond to indices within the data being displayed, although in principle this is not necessary. They serve to isolate the simple linear scaling/translation (zoom and pan) transformations from the final transformation (often a nonlinear sky projection) between 'linear coordinates' and world space (which is changed less often).

(Also, linear coordinates define an entire plane, although a given sky-coordinate projection to that plane may not be defined everywhere. Keeping zoom windows defined in linear coordinates allows natural display of all-sky images even when sky coordinates are not defined everywhere in the display area. In other words, the existing scheme allows all-sky images to be displayed easily in principle; it does not work currently due to inappropriate insistence of WC::drawImage() that its draw area be given in world coordinates; this is high on the list of bugfix priorities...).

The final transformation makes use of the Coordinate classes (which ultimately use wcslib for any needed sky projection). It defines the current 2D surface on display within some nD world space, as parameterized by the X and Y linear coordinates. State for this purpose includes the 'WorldCanvas CoordinateSystem' or 'WCCS' (WorldCanvas::itsCoordinateSystem) plus 'axis codes' (which have the odd Attribute names '{x,y}axiscode (required match)'). They are intended to define the coordinate values and types for the world space currently of interest.

This latter transformation is not as simple or well-defined as it might appear, however (and in my opinion this area still needs work). First of all, the WCCS is a rather late addition to WC interface, and in most cases is not even used to do WC linear-to-world transformations. Instead, this chore is handed off (via the older WCCoordinateHandler interface) to one of the DDs currently registered on WC's companion object, WorldCanvasHolder. Also, the axis codes do not always provide enough information about the current world space for DDs to determine whether they are designed to draw in that space (which, in my opinion, should be the codes' purpose). They also implicitly assume a 1-to-1 correspondence between linear and world coordinates, which is not very general.

Back to how it works now, though. During the 'sizeControl' step of refresh, the WCH will attempt to determine a 'CS master DD'. (Usually the same DD will remain 'in charge' as long as it is registered). Within the sizeControl routine, DDs should test isCSMaster(wch) to determine whether they have permission to become the CS master. If so, and if they are willing and able to become CS master, they must set all of the WC state above and return True; in all other cases they should return False. Only the CSmaster should set the WC CS or axis codes, and it will be responsible for performing the WC's linToWorld, etc. transformation chores. In other words, it is entirely in charge of the final transformation to world coordinates. In principle, other DDs may perform certain 'slave sizeControl' tweaks (such as aligning the zoom window on data pixel boundaries or redefining maximum zoom extents). No current implementations do anything but return False if they are not the master, however.

Major implementation examples for sizeControl() can be found in the ActiveCaching2dDD and PrincipalAxesDD classes. They should be consulted as well for the conventions for processing WC 'zoom/unzoom' order attributes, another CSmaster responsibility. (<>)

The control of what is displayed in a display application is done with setting restrictions on the WorldCanvasHolder (and possibly on the Displaydata). Restrictions are implemented as Attributes and stored in AttributeBuffers. To define what is displayed, one sets one or more restrictions on the WorldCanvasHolder and calls a refresh on the WorldCanvas. Most DisplayData will have pre-defined restrictions, for example in an ImageDisplayData each image has defined the restriction zIndex (set to the pixelindex of the 'third' axis in the data set) and zValue (set to the 'third' worldcoordinate of the image). So to display channel 13 of a data cube, one only has to set on the WorldCanvasHolder a restriction called zIndex with value 13 and call refresh:

    worldCanvasHolder.setRestriction("zIndex", 13);
    worldCanvas.refresh();

Movies can be made using the Animator class. One way it to use indices, but there is a generic way of defining movies using restrictions. So a sequence does not have to correspond to a 'logical' or 'physical' sequence in some datastructure (channels in a cube for example), but can be made of images from different datasets (e.g. blinking) and display data in different forms. This system is very flexible and there are no real limits to what a movie really means.

The DisplayData also define the coordinate system of the WorldCanvas. If the WorldCanvas has to do a coordinate transformation, it asks a coordinate handler to do this. When a WorldCanvasHolder is created for a WorldCanvas, the WorldCanvasHolder install a coordinate handler on the WorldCanvas. What this coordinate handlers does is to ask the DisplayData that is first in the list of the WorldcanvasHolder to do the transformation. This is quite an indirect way of doing the transformation, but it is very flexible (and the WorldCanvas does not have to know what an Aips++ coordinate system is, or what a DisplayData is, , which makes the WorldCanvas more generic). Most DisplayData will use the coordinate system of the data belonging to this DisplayData to do the transformation, but this is not a requirement. As long as you produce something that can be used as a coordinate system, it does not matter how you compute it. The most important thing is that the DisplayData are responsible for this. At the moment, only the Vector version should be implemented, since efficient transformation of a series of positions is not available in AIPS++. The Matrix versions are handled at the WorldCanvas level at the moment. Most DisplayData will assume that the linear coordinate system of the WorldCanvas corresponds to some underlying pixel array. The way the linear coordinate system is used is that it is the input for the coordinate transformation to world coordinates. The DisplayData are responsible for keeping the linear system correct.

Other event handlers that the DisplayData have to implement are the position- and the motion event handlers. (PositionEH and MotionEH). These are called by the WorldCanvasHolder in response to an event on the WorldCanvas. It is up to the DisplayData what to do with these events.

One can also register position- and motion event handlers on a DisplayData. What kind of event a DisplayData generates in response to an event on the WorldCanvas (passed to the DisplayData by the WorldCanvasHolder by calling PositionEH/MotionEH) is entirely up to the DisplayData, as long as the handlers are derived from WCPositionEH or WCMotionEH. One can also install a refresh handler on a DisplayData, although I have not thought of any use for that (but allowed for it to keep symmetry with the other events).

(1/02) DisplayEH interface has also been added for handling generic DisplayEvents through handleEvent(). It is expected that DDs will handle these events themselves, as needed, or pass them on in an ad-hoc manner. However, nothing prevents implementing a dispatching list for passing on these events too, if needed.

(3/03) One can also register itself as a DisplayEventHandler on a DisplayData. The handleEvent function of DisplayEH is implemented to forward any DisplayEvents its receives to these handlers. Therefore, all DisplayDatas that overide the handleEvent function, should call the handleEvent function of its super class so this forwarding can take place.

A DisplayData also has to implement a refreshEH. This function is called by the WorldCanvasHolder in response to a refresh request of the WorldCanvas. This is a very important function: here the actual drawing has to happen, using the draw primitives of the WorldCanvas. It is a good idea to check the state of the WorldCanvas before the draw is actually done, and decide not to draw if the state (for whatever reason) is not ok. Also be aware that it is a requirement that one DisplayData can work for more than one WorldCanvasHolders at a time, so the DisplayData has to do some administration for that (which WorldCanvasHolders am I working for and which one am I drawing on at the moment, things like that). See ImageDisplayData for an example of that.

DisplayData also have Attributes. These can be used to store whatever information on a DisplayData. The Attributes give a standard interface to do this.

Example

Motivation

An abstract interface between data and canvases was needed

To Do

Definition at line 313 of file DisplayData.h.


Member Enumeration Documentation

Enumerator:
DISPLAYED 
UNDISPLAYED 
LIMBO 

Definition at line 317 of file DisplayData.h.


Constructor & Destructor Documentation

(Required) default constructor.

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

required destructor

casa::DisplayData::DisplayData ( const DisplayData other) [protected]

(Required) copy constructor.


Member Function Documentation

virtual Int casa::DisplayData::activeZIndex ( const WorldCanvas wc = 0) [inline, virtual]

Retrieve 'Active' zIndex.

Not likely to be meaningful/useful unless conformsTo(wch) (or conformsToZIndex(wch)) has been called just prior (and has returned a True result). Those calls make wch the 'active' one; zIndex varies from one wch to another. You can pass a wch, which will force a call to conformsToZIndex(wch).

Definition at line 466 of file DisplayData.h.

References activeZIndex_, and conformsToZIndex().

virtual void casa::DisplayData::addDisplayEventHandler ( DisplayEH displayHandler) [virtual]
virtual void casa::DisplayData::addElementRestriction ( const uInt  itemNum,
Attribute newRestriction,
Bool  permanent 
) [virtual]

Reimplemented in casa::NBody.

virtual void casa::DisplayData::addElementRestrictions ( const uInt  itemNum,
AttributeBuffer other 
) [virtual]

Reimplemented in casa::NBody.

virtual void casa::DisplayData::addMotionEventHandler ( WCMotionEH motionHandler) [virtual]
virtual void casa::DisplayData::addPositionEventHandler ( WCPositionEH positionHandler) [virtual]

Add event handlers on the DisplayData.

I am not sure there is also a need for a refresh handler on a DisplayData, but allowing for it makes things 'symmetric'. These member functions throw an AipsError if a null pointer is passed.

virtual void casa::DisplayData::addRefreshEventHandler ( WCRefreshEH refreshHandler) [virtual]
virtual void casa::DisplayData::addRestriction ( Attribute newRestriction,
Bool  permanent 
) [virtual]
virtual void casa::DisplayData::addRestrictions ( AttributeBuffer otherBuf) [virtual]

Add general restrictions or a restriction for item itemNum of this DisplayData.

Note that the item versions of the restriction interface are not implemented. I am not sure the item versions belong in DisplayData and instead they should only appear in some derived classes.

virtual Block<Int> casa::DisplayData::allZIndices ( Int  axZrng = -1) const [virtual]

Return a sorted Block of all animation frame numbers currently set onto all WCHs where this DD is registered.

The frame numbers returned are guaranteed to be in the range 0 <= zIndex < axZrng, where axZrng is the total number of frames on the Z axis. axZrng can be supplied; the default is nelements().

Referenced by getFirstZIndex().

Get the type of the Attribute.

virtual String casa::DisplayData::className ( ) [inline, virtual]

Return the class name of this DisplayData; useful mostly for debugging purposes, and perhaps future use in the glish widget interface.

Reimplemented in casa::LatticeAsContour< T >, casa::LatticeAsRaster< T >, casa::PrincipalAxesDD, casa::LatticeAsVector< T >, casa::LatticeAsMarker< T >, casa::LatticePADisplayData< T >, casa::LatticePADisplayData< Float >, and casa::ScrollingRasterDD.

Definition at line 592 of file DisplayData.h.

References String.

virtual void casa::DisplayData::cleanup ( ) [protected, pure virtual]
virtual void casa::DisplayData::clearElementRestrictions ( const uInt  itemNum) [virtual]

Reimplemented in casa::NBody.

virtual void casa::DisplayData::clearRestrictions ( ) [virtual]

Clear all general restrictions or all restrictions of item itemNum (except the ones that are permanent of course...)

virtual Colormap* casa::DisplayData::colormap ( ) const [inline, virtual]

Definition at line 514 of file DisplayData.h.

References itsColormap.

Bool casa::DisplayData::conformed ( ) [inline, protected]

Returns result of last call to conformsTo(WCH&).

Methods like showValue() which don't have access to the wch can use it instead, but that shifts the burden elsewhere of being sure that conformsTo() was called for the current WCH. When possible, it is generally better and safer to call conformsTo(wch) directly when needed, rather than querying this.

Definition at line 728 of file DisplayData.h.

References csConformed_, rstrsConformed_, and zIndexConformed_.

Referenced by conformsTo().

virtual Bool casa::DisplayData::conformsTo ( const WorldCanvas wCanvas) [inline, virtual]

Check whether the DD is is compatible with all WC[H] state, including its coordinate state, restrictions, and zIndex (if any).

It also assures that the DD is 'focused' on this WC[H] and its zindex for purposes of drawing or event handling.

Definition at line 423 of file DisplayData.h.

References csConformed_, casa::False, rstrsConformed_, and zIndexConformed_.

virtual Bool casa::DisplayData::conformsTo ( const WorldCanvas wc) [inline, virtual]

Definition at line 427 of file DisplayData.h.

References conformed(), conformsToCS(), conformsToRstrs(), and conformsToZIndex().

virtual Bool casa::DisplayData::conformsToCS ( const WorldCanvas ) [inline, virtual]

Determine whether DD is compatible with the WC[H]'s current world coordinates.

Derived DDs can override according to their individual capabilities (PADD and ACDD match axis codes). Overriding DDs should set csConformed_ to the value returned.

Reimplemented in casa::MSAsRaster, casa::SkyCatOverlayDD, casa::ActiveCaching2dDD, and casa::PrincipalAxesDD.

Definition at line 446 of file DisplayData.h.

References csConformed_, and casa::True.

Referenced by conformsTo().

virtual Bool casa::DisplayData::conformsToRstrs ( const WorldCanvas wc) [inline, virtual]

Determine whether DD restrictions are in conformance with restrictions on the given WCH.

(Note: this will include blink index, if any, but not zIndex. zIndex is an individual DM restriction, not an overall DD restriction).

Definition at line 438 of file DisplayData.h.

References casa::WorldCanvas::matchesRestrictions(), restrictions, and rstrsConformed_.

Referenced by conformsTo().

virtual Bool casa::DisplayData::conformsToZIndex ( const WorldCanvas wc) [inline, virtual]

Determine whether DD is compatible with the current canvas animation (zIndex) position.

(This usually means that it lies within the current number of DD animation frames). (Generally, DDs should probably override setActiveZIndex_() rather than this method).

Definition at line 455 of file DisplayData.h.

References casa::AttributeBuffer::exists(), casa::AttributeBuffer::getValue(), casa::WorldCanvas::restrictionBuffer(), and setActiveZIndex_().

Referenced by activeZIndex(), and conformsTo().

virtual const uInt casa::DisplayData::dataDim ( ) const [pure virtual]
virtual const IPosition casa::DisplayData::dataShape ( ) const [pure virtual]
virtual String casa::DisplayData::dataType ( ) const [pure virtual]
virtual const Unit casa::DisplayData::dataUnit ( ) const [pure virtual]
virtual void casa::DisplayData::delTmpData ( String tmpData) [protected, virtual]

Delete temporary data.

To be called by sub-classe that now the filenames.

Referenced by setDelTmpData().

virtual String casa::DisplayData::description ( ) const [inline, virtual]

Reimplemented in casa::LatticePADisplayData< T >, and casa::LatticePADisplayData< Float >.

Definition at line 593 of file DisplayData.h.

virtual std::vector<int> casa::DisplayData::displayAxes ( ) const [pure virtual]
virtual const List<DisplayEH*>* casa::DisplayData::displayEventHandlerList ( ) [inline, protected, virtual]

Definition at line 755 of file DisplayData.h.

References itsDisplayEHList.

virtual AttributeBuffer* casa::DisplayData::elementRestrictionBuffer ( const uInt  itemNum) [virtual]

Reimplemented in casa::NBody.

virtual Bool casa::DisplayData::existElementRestriction ( const uInt  itemNum,
const String name 
) [virtual]

Reimplemented in casa::NBody.

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

Check if a general restriction or a restriction for item itemNum with name name exists.

Check if a certain Attribute exists.

const WorldCanvasHolder* casa::DisplayData::findHolder ( const WorldCanvas wCanvas) const

Identify the WorldCanvasHolder for the given WorldCanvas.

Return 0 if the DisplayData does not know of a WorldCanvasHolder for the WorldCanvas.

Bool casa::DisplayData::getAttributeValue ( const String name,
uInt newValue 
)

User interface to get value from the attribute buffer.

   
Bool casa::DisplayData::getAttributeValue ( const String name,
Int newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Float newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Double newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Bool newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
String newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Vector< uInt > &  newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Vector< Int > &  newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Vector< Float > &  newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Vector< Double > &  newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Vector< Bool > &  newValue 
)
Bool casa::DisplayData::getAttributeValue ( const String name,
Vector< String > &  newValue 
)
virtual Bool casa::DisplayData::getDelTmpData ( ) [inline, virtual]

Get and set method for the flag.

Definition at line 663 of file DisplayData.h.

References delTmpData_.

virtual DisplayState casa::DisplayData::getDisplayState ( ) const [inline, virtual]

Definition at line 345 of file DisplayData.h.

References displaystate.

virtual Bool casa::DisplayData::getFirstZIndex ( int &  firstZIndex,
Int  axZrng = -1 
) const [inline, virtual]

Set firstZIndex to minimum zIndex setting from all canvases where this DD is registered.

(In the usual case where the DD is registered on one [multi]panel, this will return its animator 'frame #' setting). The routine will return false (and firstZIndex remain unchanged) if there are no registered canvases with zIndex below axZrng--the total number of frames on the Z axis. axZrng can be supplied; the default means 'use nelements()'. (Note: to get the zindex from the 'currently active' wch instead, a DD should check activeZIndex_. Or, if the desired wch is known, it can retrieve the zIndex itself from wch.restrictionBuffer()).

Definition at line 482 of file DisplayData.h.

References allZIndices(), casa::False, casa::Block< T >::nelements(), and casa::True.

virtual Record casa::DisplayData::getOptions ( ) [virtual]
virtual void casa::DisplayData::handleEvent ( DisplayEvent ev) [virtual]

Overide DisplayEH::handleEvent.

This base class on forwards the event on to listeners

Reimplemented from casa::DisplayEH.

Reimplemented in casa::MSAsRaster, and casa::Profile2dDD.

virtual ImageAnalysis* casa::DisplayData::imageanalysis ( ) const [inline, virtual]

Get image analyis about images...

for non-image "DisplayData" this function will return null... Use dataType() to check... Creates a new object (or a null pointer) which may need to be deleted...

Reimplemented in casa::LatticePADisplayData< T >, and casa::LatticePADisplayData< Float >.

Definition at line 609 of file DisplayData.h.

virtual ImageInterface<Float>* casa::DisplayData::imageinterface ( ) [inline, virtual]

Returns a pointer that should not be deleted...

Reimplemented in casa::LatticePADisplayData< T >, and casa::LatticePADisplayData< Float >.

Definition at line 611 of file DisplayData.h.

Added so that when two images are loaded with no velocity alignment, they can still show their position coordinates without having to be rstrsConformed.

Definition at line 733 of file DisplayData.h.

References csConformed_, and zIndexConformed_.

virtual Bool casa::DisplayData::isCSmaster ( const WorldCanvasHolder wch = 0) const [virtual]

Is this DD the CS master of the passed WCH? Defaulting wch to 0 asks whether this DD is CS master of some WCH on which it is registered.

(That option is mostly a kludge, since the DD may be CS master of some WCHs and not others).

virtual bool casa::DisplayData::isDisplayable ( ) const [inline, virtual]

Reimplemented in casa::WedgeDD.

Definition at line 347 of file DisplayData.h.

virtual Bool casa::DisplayData::labelAxes ( const WCRefreshEvent ev) [virtual]

an explicit request to draw the axes and/or labels.

Returns True if axes were drawn, otherwise False;

Reimplemented in casa::MSAsRaster, casa::Profile2dDD, casa::PrincipalAxesDD, casa::ScrollingRasterDD, and casa::WedgeDD.

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

Coordinate transformations, called by WorldCanvasHolder (Matrix versions not implemented)

Implemented in casa::PrincipalAxesDD, casa::NBody, casa::ActiveCaching2dDD, and casa::PassiveCachingDD.

virtual void casa::DisplayData::motionEH ( const WCMotionEvent ev) [protected, virtual]

Reimplemented in casa::NBody, and casa::PrincipalAxesDD.

virtual const List<WCMotionEH*>* casa::DisplayData::motionEventHandlerList ( ) [inline, protected, virtual]

Definition at line 751 of file DisplayData.h.

References itsMotionEHList.

virtual const uInt casa::DisplayData::nelements ( const WorldCanvasHolder wcHolder) const [pure virtual]

Returns the number of elements in this DisplayData (mainly for movie purposes).

First one is no. of elements for specific WCanvas.

Implemented in casa::MSAsRaster, casa::PrincipalAxesDD, casa::NBody, casa::ActiveCaching2dDD, and casa::PassiveCachingDD.

virtual const uInt casa::DisplayData::nelements ( ) const [pure virtual]
virtual void casa::DisplayData::notifyRegister ( WorldCanvasHolder wcHolder) [virtual]
virtual void casa::DisplayData::notifyUnregister ( WorldCanvasHolder wcHolder,
Bool  ignoreRefresh = False 
) [virtual]

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

Reimplemented in casa::PrincipalAxesDD, casa::Profile2dDD, casa::MSAsRaster, casa::WedgeDD, and casa::CachingDisplayData.

void casa::DisplayData::operator= ( const DisplayData other) [protected]

(Required) copy assignment.

virtual void casa::DisplayData::positionEH ( const WCPositionEvent ev) [protected, virtual]

Position, motion and refresh event handlers that will generally be called by a WorldCanvasHolder.

Reimplemented in casa::NBody, and casa::PrincipalAxesDD.

virtual const List<WCPositionEH*>* casa::DisplayData::positionEventHandlerList ( ) [inline, protected, virtual]

Retrieve position, motion, refresh and display event handler lists.

Definition at line 749 of file DisplayData.h.

References itsPositionEHList.

virtual void casa::DisplayData::refresh ( Bool  clean = False) [virtual]

an explicit refresh: should be called if the DisplayData is changed such that drawing is required.

If clean is True, the DD is totally rebuilt, in practice. This is provided for higher level control, even explicit control of refresh where necessary. ..."refresh(True)"... does not seem to work <drs:Mar 21 2013>

virtual void casa::DisplayData::refreshEH ( const WCRefreshEvent ev) [protected, pure virtual]
virtual const List<WCRefreshEH*>* casa::DisplayData::refreshEventHandlerList ( ) [inline, protected, virtual]

Definition at line 753 of file DisplayData.h.

References itsRefreshEHList.

Remove an Attribute.

virtual void casa::DisplayData::removeColormap ( ) [virtual]
virtual void casa::DisplayData::removeDisplayEventHandler ( DisplayEH displayHandler) [virtual]
virtual void casa::DisplayData::removeElementRestriction ( const uInt  itemNum,
const String name 
) [virtual]

Reimplemented in casa::NBody.

virtual void casa::DisplayData::removeFromAllWCHs ( ) [virtual]

remove this DD everywhere--will stop any more refresh handling by the DD.

It is a good idea for top-level DDs to call this first in their destructor.

virtual void casa::DisplayData::removeMotionEventHandler ( WCMotionEH motionHandler) [virtual]
virtual void casa::DisplayData::removePositionEventHandler ( WCPositionEH positionHandler) [virtual]

Remove eventhandlers.

virtual void casa::DisplayData::removeRefreshEventHandler ( WCRefreshEH refreshHandler) [virtual]
virtual void casa::DisplayData::removeRestriction ( const String name) [virtual]

Remove a general restriction or a restriction from item itemNum

Get a handle to the buffer of general restrictions or of the buffer of restrictions for item itemNum

virtual Bool casa::DisplayData::setActiveZIndex_ ( Int  zindex) [inline, protected, virtual]

DDs may override to adjust the internal stored current animation index (activeZIndex_) if necessary, and to set return value False iff the passed zindex won't work for the DD.

zIndexConformed_ should be set to the value returned; activeZIndex_ should also be set appropriately.

Reimplemented in casa::MSAsRaster, and casa::PrincipalAxesDD.

Definition at line 677 of file DisplayData.h.

References activeZIndex_, casa::True, and zIndexConformed_.

Referenced by conformsToZIndex().

set an Attribute or Attributes

Set an attribute on any WorldCanvas for which this DD is CS master.

virtual void casa::DisplayData::setColormap ( Colormap cmap,
Float  weight 
) [virtual]

Set/remove/get a ColourMap (sorry, ColorMap) for this DisplayData setColormap() throw an AipsError is a null pointer is passed.

colormap() returns 0 if no Colormap is registered.

Reimplemented in casa::CachingDisplayData.

virtual void casa::DisplayData::setDefaultOptions ( ) [virtual]
virtual void casa::DisplayData::setDelTmpData ( Bool  delTmpData) [inline, virtual]

Definition at line 664 of file DisplayData.h.

References delTmpData(), and delTmpData_.

virtual void casa::DisplayData::setDisplayState ( DisplayState  s) [inline, virtual]

Definition at line 342 of file DisplayData.h.

References displaystate.

virtual void casa::DisplayData::setElementRestriction ( const uInt  itemNum,
Attribute newRestriction 
) [virtual]

Reimplemented in casa::NBody.

virtual void casa::DisplayData::setElementRestrictions ( const uInt  itemNum,
AttributeBuffer other 
) [virtual]

Reimplemented in casa::NBody.

virtual Bool casa::DisplayData::setOptions ( Record rec,
Record recOut 
) [virtual]
virtual void casa::DisplayData::setRestriction ( Attribute newRestriction) [virtual]
virtual void casa::DisplayData::setRestrictions ( AttributeBuffer otherBuf) [virtual]

Set general restrictions or a restriction for item itemNum of this DisplayData.

Note that the item versions of the restriction interface are not implemented.

virtual void casa::DisplayData::setUIBase ( Int  uibase) [inline, virtual]

Reimplemented in casa::MSAsRaster.

Definition at line 657 of file DisplayData.h.

References uiBase_.

virtual String casa::DisplayData::showPosition ( const Vector< Double > &  world,
const Bool displayAxesOnly = False 
) [pure virtual]

Format a string containing coordinate information at the given world coordinate.

Implemented in casa::MSAsRaster, casa::NBody, casa::PrincipalAxesDD, casa::ActiveCaching2dDD, and casa::PassiveCachingDD.

virtual String casa::DisplayData::showValue ( const Vector< Double > &  world) [pure virtual]
virtual Bool casa::DisplayData::sizeControl ( WorldCanvasHolder wcHolder,
AttributeBuffer holderBuf 
) [protected, pure virtual]

Set (coordinate) state of WCH's WC.

Called by WCH::executeSizeControl(). (See important notes on interface and implementation of this function in the class synopsis above).

Implemented in casa::Profile2dDD, casa::NBody, casa::PrincipalAxesDD, casa::PassiveCachingDD, casa::ActiveCaching2dDD, and casa::ScrollingRasterDD.

virtual Int casa::DisplayData::uiBase ( ) [inline, virtual]

DD 'Absolute Pixel Coordinates', e.g.

channel numbers, are internally 0-based (they begin numbering at 0), but certain external user-interface functions (e.g. showPosition(), used for position tracking) have produced 1-based output traditionally for the glish-based viewer. uiBase_, and related methods uiBase() and setUIBase(), allow newer (python/Qt-based) code to cause external ui functions like showValue() to report 0-based values instead. Unless setUIBase(0) is called, the traditional 1-based reporting behavior is retained by default.

If you are using 0-basing in the user interface, you should call setUIBase(0) right after constructing this DD, before other user interface operations such as getOptions().

Definition at line 655 of file DisplayData.h.

References uiBase_.

Referenced by casa::MSAsRaster::a1mult_(), and casa::MSAsRaster::setUIBase().

virtual Vector<String> casa::DisplayData::worldAxisNames ( ) const [pure virtual]

Some routines that give info on the axes names, units etc.

I am not sure this is the right way of doing it.

Implemented in casa::ScrollingRasterDD, casa::PrincipalAxesDD, casa::NBody, casa::ActiveCaching2dDD, and casa::PassiveCachingDD.

virtual Vector<String> casa::DisplayData::worldAxisUnits ( ) const [pure virtual]
virtual Bool casa::DisplayData::worldToLin ( Vector< Double > &  lin,
const Vector< Double > &  world 
) [pure virtual]
virtual Bool casa::DisplayData::zIndexHint ( Int ) const [inline, virtual]

Will be called just before registering the [GTk]DD on a [GTk]PanelDisplay which has none registered on it yet.

The DD can set the initial animator position in this case by overriding this method to set preferredZIndex and return True.

Reimplemented in casa::MSAsRaster.

Definition at line 630 of file DisplayData.h.

References casa::False.


Friends And Related Function Documentation

friend class WorldCanvasHolder [friend]

Protected interface for WorldCanvasHolder, can be called by the friends of DisplayData, but are nobody else's business.

I decided to do this in this way to avoid that the programmer has to both register the DisplayData with the WorldCanvasHolder AND the WorldCanvasHolder with the DisplayData. Now one of the two is done automatically. The WorldCanvasHolder is my friend. This is to hide the eventhandler interfaces listed below from the outside world. The WorldCanvasHolder is the only class that needs them

Definition at line 705 of file DisplayData.h.


Member Data Documentation

Indicates the 'current' animation frame, i.e.

the zIndex on the canvas for which confromsTo(wch) was last called. Intended to be set only by setActiveZIndex_() in this class or derived classes.

Definition at line 710 of file DisplayData.h.

Referenced by activeZIndex(), casa::MSAsRaster::setActiveZIndex_(), and setActiveZIndex_().

buffer for storing Attributes

Definition at line 692 of file DisplayData.h.

Definition at line 668 of file DisplayData.h.

   

Definition at line 667 of file DisplayData.h.

list of DisplayDataElements, which are of type DisplayMethod or derived

Definition at line 695 of file DisplayData.h.

Flag indicating that temporary data should be removed when deleting the object.

Definition at line 714 of file DisplayData.h.

Referenced by getDelTmpData(), and setDelTmpData().

is this data currently being displayed?

Definition at line 781 of file DisplayData.h.

Referenced by getDisplayState(), and setDisplayState().

Colormap for this DisplayData, and its weight.

Definition at line 784 of file DisplayData.h.

Referenced by colormap().

Definition at line 785 of file DisplayData.h.

Definition at line 798 of file DisplayData.h.

Referenced by displayEventHandlerList().

Definition at line 796 of file DisplayData.h.

Referenced by motionEventHandlerList().

Lists of position, motion, refresh and display event handlers.

Definition at line 795 of file DisplayData.h.

Referenced by positionEventHandlerList().

Definition at line 797 of file DisplayData.h.

Referenced by refreshEventHandlerList().

A list of WorldCanvasHolders for which this DisplayData works.

The list is maintained by the DisplayData itself based on the notify routines used by the WorldCanvasHolder. This can be used, for example, to find which WorldCanvas belongs to which WorldCanvasHolder.

Definition at line 792 of file DisplayData.h.

The Book says that we should not put data members in class that is supposed to only define an interface, but by putting these here, we can implement some of the restriction & eventhandling stuff so that people do not have to repeat it.

buffer for storing restrictions

Definition at line 689 of file DisplayData.h.

Referenced by conformsToRstrs().

Somewhat limited-use state, saved here for 'efficiency'.

Indicates that the last call to conformsToRstrs(), conformsToCS(), or conformsToZIndex(), passed the respective compatibility tests. (See conformed(), below). Intended to be set only in the methods conformsToRstrs(), conformsToCS() and setActiveZIndex_(), respectively.

Definition at line 721 of file DisplayData.h.

Referenced by conformed(), conformsTo(), and conformsToRstrs().

DD 'Absolute Pixel Coordinates', e.g.

channel numbers, are internally 0-based (begin numbering at 0), but certain external user-interface functions (e.g. showPosition(), used for position tracking) have produced 1-based output traditionally for the glish-based viewer. uiBase_, and related methods uiBase() and setUIBase(), allow newer (python/Qt-based) code to cause external ui functions like showValue() report 0-based values instead. Unless setUIBase(0) is called, the traditional 1-based reporting behavior is retained by default.

Definition at line 809 of file DisplayData.h.

Referenced by setUIBase(), and uiBase().


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