DisplayData . It adds an "automagic"
caching system, which takes care of managing a set of individual
drawings made by the DisplayData, and using previously generated
drawing commands where applicable. For example, the user might be
playing a movie of several frames in a DisplayData. The automagic
caching will ensure that after one complete loop, while parameters
affecting the display of the data do not change, all subsequent
drawings will be made from a cache of drawing commands.
Furthermore, provided the cache is large enough, the user may alter
parameters, view some more frames, then return the parameters to
their original state, and there may still be older cached drawings
which can be used.
The automagic caching also handles the case where a single
DisplayData is registered on more than one WorldCanvasHolder . Thus a
miniature view of the data could be shown in one window, and an
expanded view in another, with full automagic caching available on
both.
This is a base class. Derived classes must implement the
newDisplayMethod method, which is called to construct a
new CachingDisplayMethod
when the cache cannot satisfy the current drawing
request. The method optionsAsAttributes should also be
implemented: when a new CachingDisplayMethod is constructed, the
return value of this method will be used to tag the parameters used
in the drawing itself. Finally, the method
cachingAttributes can be over-ridden, and should
return any additional Attributes
which should be considered in searches of the cache.
Motivation
Most DisplayData classes will offer more than one view of the data.
Caching is therefore desirable to improve display speed for
re-display of individual views of the data. It is nice to keep the
caching in one place, hence this class.
Member Description
Constructor.
Destructor.
Install the default options for this DisplayData.
Apply options stored in rec to the DisplayData. A
return value of True means a refresh is needed.
recOut contains any fields which were implicitly
changed as a result of the call to this function. The options
handled by this class are:
cachesize: an integer specifying the maximum
number of views which can be stored in the cache. The default
value can be specified by the display.cachesize
variable in the user's .aipsrc file, and in lieu
of that, will be 256. If cachesize is lowered by
a call to this method, the cache will be shrunk in size, with
the oldest drawings being removed first.
Retrieve the current and default options and parameter types.
Refresh event handler which is called indirectly by the
WorldCanvas, via the WorldCanvasHolder. This function will take
care of calling newDisplayMethod when necessary, and
otherwise using an existing (previously cached) draw list.
Purges cache, to avoid reusing images with the
wrong colormap, then calls base class version.
Empty cache completely.
Empty cache of all DMs for a given WCH.
Create a new (Caching)DisplayMethod for drawing on the given
WorldCanvas when the AttributeBuffers are suitably matched to the
current state of this DisplayData and of the WorldCanvas/Holder.
Return the current options of this DisplayData as an
AttributeBuffer. The caller must delete the returned buffer.
virtual void setCaching(const Bool caching)
Turn caching on/off.
(Required) copy constructor.
void operator=(const CachingDisplayData &other)
(Required) copy assignment.
Clear out cache entries beyond end of list.
Install the default options for this DisplayData.