casa
5.7.0-16
|
Base class for auto-caching DisplayData objects. More...
#include <CachingDisplayData.h>
Public Member Functions | |
CachingDisplayData () | |
Constructor. More... | |
virtual | ~CachingDisplayData () |
Destructor. More... | |
virtual void | setDefaultOptions () |
Install the default options for this DisplayData. More... | |
virtual casacore::Bool | setOptions (casacore::Record &rec, casacore::Record &recOut) |
Apply options stored in rec to the DisplayData. More... | |
virtual casacore::Record | getOptions (bool scrub=false) const |
Retrieve the current and default options and parameter types. More... | |
virtual void | refreshEH (const WCRefreshEvent &ev) |
Refresh event handler which is called indirectly by the WorldCanvas, via the WorldCanvasHolder. More... | |
virtual void | notifyRegister (WorldCanvasHolder *wcHolder) |
virtual void | notifyUnregister (WorldCanvasHolder &wcHolder, casacore::Bool ignoreRefresh=false) |
ignoreRefresh tells the DD not to refresh just to clean up DMs More... | |
virtual void | setColormap (Colormap *cmap, casacore::Float weight) |
Purges cache, to avoid reusing images with the wrong colormap, then calls base class version. More... | |
virtual void | purgeCache () |
Empty cache completely. More... | |
virtual void | purgeCache (const WorldCanvasHolder &wch) |
Empty cache of all DMs for a given WCH. More... | |
Public Member Functions inherited from casa::DisplayData | |
DisplayData () | |
(Required) default constructor. More... | |
virtual | ~DisplayData () |
required destructor More... | |
virtual casacore::Bool | linToWorld (casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &lin)=0 |
casacore::Coordinate transformations, called by WorldCanvasHolder (casacore::Matrix versions not implemented) More... | |
virtual casacore::Bool | worldToLin (casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &world)=0 |
virtual std::string | errorMessage () const =0 |
virtual casacore::String | showPosition (const casacore::Vector< casacore::Double > &world, const casacore::Bool &displayAxesOnly=false)=0 |
casacore::Format a string containing coordinate information at the given world coordinate More... | |
virtual casacore::String | showValue (const casacore::Vector< casacore::Double > &world)=0 |
casacore::Format a string containing value information at the given world coordinate More... | |
virtual void | setDisplayState (DisplayState s) |
virtual DisplayState | getDisplayState () const |
virtual bool | isDisplayable () const |
virtual casacore::Vector < casacore::String > | worldAxisNames () const =0 |
Some routines that give info on the axes names, units etc. More... | |
virtual casacore::Vector < casacore::String > | worldAxisUnits () const =0 |
virtual casacore::uInt | nelements (const WorldCanvasHolder &wcHolder) const =0 |
Returns the number of elements in this DisplayData (mainly for movie purposes). More... | |
virtual casacore::uInt | nelements () const =0 |
and non-specific More... | |
virtual void | addRestrictions (AttributeBuffer &otherBuf) |
Add general restrictions or a restriction for item itemNum of this DisplayData. More... | |
virtual void | addRestriction (Attribute &newRestriction, casacore::Bool permanent) |
virtual void | addElementRestrictions (const casacore::uInt itemNum, AttributeBuffer &other) |
virtual void | addElementRestriction (const casacore::uInt itemNum, Attribute &newRestriction, casacore::Bool permanent) |
virtual void | setRestrictions (AttributeBuffer &otherBuf) |
Set general restrictions or a restriction for item itemNum of this DisplayData. More... | |
virtual void | setRestriction (Attribute &newRestriction) |
virtual void | setElementRestrictions (const casacore::uInt itemNum, AttributeBuffer &other) |
virtual void | setElementRestriction (const casacore::uInt itemNum, Attribute &newRestriction) |
virtual void | removeRestriction (const casacore::String &name) |
Remove a general restriction or a restriction from item itemNum More... | |
virtual void | removeElementRestriction (const casacore::uInt itemNum, const casacore::String &name) |
virtual void | clearRestrictions () |
Clear all general restrictions or all restrictions of item itemNum (except the ones that are permanent of course...) More... | |
virtual void | clearElementRestrictions (const casacore::uInt itemNum) |
virtual casacore::Bool | existRestriction (const casacore::String &name) |
Check if a general restriction or a restriction for item itemNum with name name exists. More... | |
virtual casacore::Bool | existElementRestriction (const casacore::uInt itemNum, const casacore::String &name) |
virtual AttributeBuffer * | restrictionBuffer () |
Get a handle to the buffer of general restrictions or of the buffer of restrictions for item itemNum More... | |
virtual AttributeBuffer * | elementRestrictionBuffer (const casacore::uInt itemNum) |
virtual casacore::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). More... | |
virtual casacore::Bool | conformsTo (const WorldCanvas &wc) |
virtual casacore::Bool | conformsToRstrs (const WorldCanvas &wc) |
Determine whether DD restrictions are in conformance with restrictions on the given WCH. More... | |
virtual casacore::Bool | conformsToCS (const WorldCanvas &) |
Determine whether DD is compatible with the WC[H]'s current world coordinates. More... | |
virtual casacore::Bool | conformsToZIndex (const WorldCanvas &wc) |
Determine whether DD is compatible with the current canvas animation (zIndex) position. More... | |
virtual casacore::Int | activeZIndex (const WorldCanvas *wc=0) |
Retrieve 'Active' zIndex. More... | |
virtual casacore::Bool | getFirstZIndex (int &firstZIndex, casacore::Int axZrng=-1) const |
Set firstZIndex to minimum zIndex setting from all canvases where this DD is registered. More... | |
virtual void | addPositionEventHandler (WCPositionEH *positionHandler) |
Add event handlers on the DisplayData. More... | |
virtual void | addMotionEventHandler (WCMotionEH *motionHandler) |
virtual void | addRefreshEventHandler (WCRefreshEH *refreshHandler) |
virtual void | addDisplayEventHandler (DisplayEH *displayHandler) |
virtual void | removePositionEventHandler (WCPositionEH &positionHandler) |
Remove eventhandlers. More... | |
virtual void | removeMotionEventHandler (WCMotionEH &motionHandler) |
virtual void | removeRefreshEventHandler (WCRefreshEH &refreshHandler) |
virtual void | removeDisplayEventHandler (DisplayEH &displayHandler) |
virtual void | removeColormap () |
virtual Colormap * | colormap () const |
void | setAttribute (Attribute &at) |
set an Attribute or Attributes More... | |
void | setAttributes (AttributeBuffer &at) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::uInt &newValue) |
User interface to get value from the attribute buffer. More... | |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Int &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Float &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Double &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Bool &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::String &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Vector< casacore::uInt > &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Int > &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Float > &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Double > &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Bool > &newValue) |
casacore::Bool | getAttributeValue (const casacore::String &name, casacore::Vector< casacore::String > &newValue) |
casacore::Bool | existsAttribute (casacore::String &name) |
Check if a certain Attribute exists. More... | |
void | removeAttribute (casacore::String &name) |
Remove an Attribute. More... | |
AttValue::ValueType | attributeType (casacore::String &name) |
Get the type of the Attribute. More... | |
void | setAttributeOnPrimaryWCHs (Attribute &at) |
Set an attribute on any WorldCanvas for which this DD is CS master. More... | |
virtual void | removeFromAllWCHs () |
remove this DD everywhere–will stop any more refresh handling by the DD. More... | |
virtual void | refresh (casacore::Bool clean=false) |
an explicit refresh: should be called if the DisplayData is changed such that drawing is required. More... | |
virtual casacore::Bool | labelAxes (const WCRefreshEvent &ev) |
an explicit request to draw the axes and/or labels. More... | |
virtual casacore::Bool | canLabelAxes () const |
virtual casacore::String | className () const |
Return the class name of this DisplayData; useful mostly for debugging purposes, and perhaps future use in the glish widget interface. More... | |
virtual casacore::String | description () const |
virtual Display::DisplayDataType | classType ()=0 |
Return the DisplayData type; used by the WorldCanvasHolder to determine the order of drawing. More... | |
virtual casacore::String | dataType () const =0 |
virtual const casacore::IPosition | dataShape () const =0 |
virtual casacore::uInt | dataDim () const =0 |
virtual const casacore::Unit | dataUnit () const =0 |
virtual std::vector< int > | displayAxes () const =0 |
virtual ImageAnalysis * | imageanalysis () const |
Get image analyis about images... More... | |
virtual std::shared_ptr < casacore::ImageInterface < casacore::Float > > | imageinterface () |
Returns a pointer that should not be deleted... More... | |
virtual void | setSubstituteTitleText (const casacore::String) |
const WorldCanvasHolder * | findHolder (const WorldCanvas *wCanvas) const |
Identify the WorldCanvasHolder for the given WorldCanvas. More... | |
WorldCanvasHolder * | findHolder (const WorldCanvas *wCanvas) |
virtual casacore::Block < casacore::Int > | allZIndices (casacore::Int axZrng=-1) const |
Return a sorted casacore::Block of all animation frame numbers currently set onto all WCHs where this DD is registered. More... | |
virtual casacore::Bool | zIndexHint (casacore::Int &) const |
Will be called just before registering the [GTk]DD on a [GTk]PanelDisplay which has none registered on it yet. More... | |
virtual void | handleEvent (DisplayEvent &ev) |
Overide DisplayEH::handleEvent. More... | |
virtual casacore::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. More... | |
virtual casacore::Int | uiBase () const |
DD 'Absolute Pixel Coordinates', e.g. More... | |
virtual void | setUIBase (casacore::Int uibase) |
virtual casacore::Bool | getDelTmpData () |
Get and set method for the flag. More... | |
virtual void | setDelTmpData (casacore::Bool delTmpData) |
virtual void | setDisplayDataRed (DisplayData *) |
virtual void | setDisplayDataBlue (DisplayData *) |
virtual void | setDisplayDataGreen (DisplayData *) |
Public Member Functions inherited from casa::DisplayOptions | |
DisplayOptions () | |
Constructor. More... | |
virtual | ~DisplayOptions () |
Destructor. More... | |
template<class T > | |
casacore::Bool | readOptionRecord (casacore::Vector< T > &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const |
Find the field fieldname in casacore::Record rec , containing the requested type (casacore::Bool, casacore::String, casacore::Float, casacore::Int) in itself or its "value" sub-field, and return the value in target . More... | |
template<class T > | |
casacore::Bool | readOptionRecord (T &target, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const |
virtual casacore::Bool | readOptionRecord (casacore::String &target, casacore::Bool &unsetTarget, casacore::Bool &error, const casacore::Record &rec, const casacore::String &fieldname) const |
Find the field fieldname in casacore::Record rec , containing the requested type (casacore::String) in itself or its "value" sub-field, and return the value in target . More... | |
casacore::Record | unset () const |
Return a casacore::Record which is an "unset" casacore::Record, ie. More... | |
casacore::Bool | isUnset (const casacore::Record &rec) const |
Return true or false indicating if the provided casacore::Record is equal to an "unset" Record. More... | |
Public Member Functions inherited from casa::DisplayEH | |
virtual | ~DisplayEH () |
Public Member Functions inherited from casa::DlTarget | |
DlTarget () | |
DlTarget (const DlTarget &) | |
virtual | ~DlTarget () |
void | reg (DlHandleBase *p) |
void | unreg (DlHandleBase *p) |
Protected Member Functions | |
virtual CachingDisplayMethod * | newDisplayMethod (WorldCanvas *worldCanvas, AttributeBuffer *wchAttributes, AttributeBuffer *ddAttributes, CachingDisplayData *dd)=0 |
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. More... | |
virtual AttributeBuffer | optionsAsAttributes () |
Return the current options of this DisplayData as an AttributeBuffer. More... | |
virtual void | setCaching (const casacore::Bool caching) |
Return any additional Attributes to consider when searching the cache. More... | |
CachingDisplayData (const CachingDisplayData &other) | |
(Required) copy constructor. More... | |
void | operator= (const CachingDisplayData &other) |
(Required) copy assignment. More... | |
Protected Member Functions inherited from casa::DisplayData | |
virtual casacore::Bool | setActiveZIndex_ (casacore::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. More... | |
casacore::Bool | conformed () |
Returns result of last call to conformsTo(WCH&). More... | |
casacore::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. More... | |
virtual casacore::Bool | sizeControl (WorldCanvasHolder &wcHolder, AttributeBuffer &holderBuf)=0 |
Set (coordinate) state of WCH's WC. More... | |
virtual void | delTmpData (casacore::String &tmpData) |
Delete temporary data. More... | |
virtual const std::list < WCPositionEH * > * | positionEventHandlerList () |
Retrieve position, motion, refresh and display event handler lists. More... | |
virtual const std::list < WCMotionEH * > * | motionEventHandlerList () |
virtual const std::list < WCRefreshEH * > * | refreshEventHandlerList () |
virtual const std::list < DisplayEH * > * | displayEventHandlerList () |
virtual void | positionEH (const WCPositionEvent &ev) |
Position, motion and refresh event handlers that will generally be called by a WorldCanvasHolder. More... | |
virtual void | motionEH (const WCMotionEvent &ev) |
virtual void | cleanup ()=0 |
clean up the memory used by this DisplayData More... | |
DisplayData (const DisplayData &other) | |
(Required) copy constructor. More... | |
void | operator= (const DisplayData &other) |
(Required) copy assignment. More... | |
Protected Member Functions inherited from casa::DisplayOptions | |
DisplayOptions (const DisplayOptions &other) | |
(Required) copy constructor. More... | |
void | operator= (const DisplayOptions &other) |
(Required) copy assignment. More... | |
Protected Attributes | |
casacore::Bool | restorePCColormap_ |
The default is false. More... | |
Protected Attributes inherited from casa::DisplayData | |
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. More... | |
AttributeBuffer | attributes |
buffer for storing Attributes More... | |
casacore::PtrBlock< void * > | DDelement |
list of DisplayDataElements, which are of type DisplayMethod or derived More... | |
casacore::Int | activeZIndex_ |
Indicates the 'current' animation frame, i.e. More... | |
casacore::Bool | delTmpData_ |
Flag indicating that temporary data should be removed when deleting the object. More... | |
casacore::Bool | rstrsConformed_ |
Somewhat limited-use state, saved here for 'efficiency'. More... | |
casacore::Bool | csConformed_ |
casacore::Bool | zIndexConformed_ |
Private Member Functions | |
void | trimCache () |
Clear out cache entries beyond end of list. More... | |
void | installDefaultOptions () |
Install the default options for this DisplayData. More... | |
Private Attributes | |
casacore::Bool | itsCachingState |
Caching state. More... | |
casacore::Int | itsDefaultMaximumCacheSize |
Default and actual maximum length of element list. More... | |
casacore::Int | itsOptionsMaximumCacheSize |
std::list< void * > | itsElementList |
casacore::List containing the CachingDisplayMethods for this CachingDisplayData. More... | |
Additional Inherited Members | |
Public Types inherited from casa::DisplayData | |
enum | DisplayState { DISPLAYED, UNDISPLAYED, LIMBO } |
Static Public Attributes inherited from casa::DisplayData | |
static const casacore::String | DATA_MIN |
static const casacore::String | DATA_MAX |
Base class for auto-caching DisplayData objects.
Public interface
"CachingDisplayData" is an implementation of a DisplayData which provides automatic caching of individual depictions of the data.
This class adds to the interface defined in 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.
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.
Definition at line 103 of file CachingDisplayData.h.
casa::CachingDisplayData::CachingDisplayData | ( | ) |
Constructor.
|
virtual |
Destructor.
|
protected |
(Required) copy constructor.
|
virtual |
Retrieve the current and default options and parameter types.
Reimplemented from casa::DisplayData.
Reimplemented in casa::Profile2dDD, casa::MSAsRaster, casa::TblAsRasterDD, casa::TblAsContourDD, casa::TblAsXYDD, casa::WedgeDD, casa::PassiveCachingDD, casa::ActiveCaching2dDD, casa::Histogram2dDD, casa::AxesDisplayData, casa::PassiveTableDD, casa::WorldAxesDD, casa::SkyCatOverlayDD, and casa::DrawingDisplayData.
|
private |
Install the default options for this DisplayData.
|
protectedpure virtual |
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.
Implemented in casa::RegionShape, casa::MSAsRaster, casa::Profile2dDD, casa::TblAsRasterDD, casa::TblAsContourDD, casa::TblAsXYDD, casa::WedgeDD, casa::Histogram2dDD, casa::AxesDisplayData, casa::SkyCatOverlayDD, casa::DrawingDisplayData, and casa::WorldAxesDD.
|
virtual |
Reimplemented from casa::DisplayData.
Reimplemented in casa::MSAsRaster.
|
virtual |
ignoreRefresh
tells the DD not to refresh just to clean up DMs
Reimplemented from casa::DisplayData.
Reimplemented in casa::MSAsRaster, casa::Profile2dDD, and casa::WedgeDD.
|
protected |
(Required) copy assignment.
|
protectedvirtual |
Return the current options of this DisplayData as an AttributeBuffer.
The caller must delete the returned buffer.
Reimplemented in casa::Profile2dDD, casa::MSAsRaster, casa::TblAsRasterDD, casa::TblAsContourDD, casa::TblAsXYDD, casa::WedgeDD, casa::PassiveCachingDD, casa::ActiveCaching2dDD, casa::Histogram2dDD, casa::AxesDisplayData, casa::SkyCatOverlayDD, casa::DrawingDisplayData, casa::WorldAxesDD, and casa::PassiveTableDD.
|
virtual |
Empty cache completely.
Reimplemented in casa::MSAsRaster.
Referenced by casa::MSAsRaster::purgeCache().
|
virtual |
Empty cache of all DMs for a given WCH.
Reimplemented in casa::MSAsRaster.
|
virtual |
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.
Implements casa::DisplayData.
Reimplemented in casa::PassiveCachingDD, and casa::DrawingDisplayData.
|
protectedvirtual |
|
virtual |
Purges cache, to avoid reusing images with the wrong colormap, then calls base class version.
Reimplemented from casa::DisplayData.
|
virtual |
Install the default options for this DisplayData.
Reimplemented from casa::DisplayData.
Reimplemented in casa::Profile2dDD, casa::MSAsRaster, casa::TblAsRasterDD, casa::TblAsContourDD, casa::TblAsXYDD, casa::WedgeDD, casa::PassiveCachingDD, casa::ActiveCaching2dDD, casa::Histogram2dDD, casa::AxesDisplayData, casa::PassiveTableDD, casa::WorldAxesDD, casa::SkyCatOverlayDD, and casa::DrawingDisplayData.
|
virtual |
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.
Reimplemented from casa::DisplayData.
Reimplemented in casa::Profile2dDD, casa::MSAsRaster, casa::TblAsRasterDD, casa::TblAsContourDD, casa::TblAsXYDD, casa::WedgeDD, casa::PassiveCachingDD, casa::ActiveCaching2dDD, casa::Histogram2dDD, casa::AxesDisplayData, casa::PassiveTableDD, casa::WorldAxesDD, casa::SkyCatOverlayDD, and casa::DrawingDisplayData.
|
private |
Clear out cache entries beyond end of list.
|
private |
Caching state.
Definition at line 200 of file CachingDisplayData.h.
|
private |
Default and actual maximum length of element list.
Definition at line 203 of file CachingDisplayData.h.
|
private |
casacore::List containing the CachingDisplayMethods for this CachingDisplayData.
Definition at line 207 of file CachingDisplayData.h.
|
private |
Definition at line 203 of file CachingDisplayData.h.
|
protected |
The default is false.
Derived DDs (such as WedgeDD) can set it true so that the colormap on the PixelCanvas before the DD draws is restored to it afterward. The 'colormap fiddling' mouse tools can (unfortunately) only operate on the PC's current colormap; this kludge is an attempt to assure that the 'right' one is left there.
Definition at line 195 of file CachingDisplayData.h.