casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
casa::WorldCanvas Class Reference

Implementation of drawing in world coordinates on top of a PixelCanvas. More...

#include <WorldCanvas.h>

Inheritance diagram for casa::WorldCanvas:
casa::PCRefreshEH casa::PCMotionEH casa::PCPositionEH casa::DisplayEH casa::DisplayOptions

Classes

struct  ColorIndexedImage_
 ColorIndexedImage_ stores the state of a WorldCanvas::drawImage() rendering after the chosen data plane has been resampled to screen (Pixelcanvas) pixels and scaled to indices within a fixed-size Colormap, but prior to mapping to actual colors for display. More...
 

Public Member Functions

 WorldCanvas (PixelCanvas *pc, casacore::Double xOrigin=0.0, casacore::Double yOrigin=0.0, casacore::Double xSize=1.0, casacore::Double ySize=1.0)
 Construct a WorldCanvas on the given PixelCanvas, at the given origin (in fractions of the PixelCanvas extent), and having the given size (in the same units). More...
 
virtual ~WorldCanvas ()
 Destructor. More...
 
PixelCanvaspixelCanvas () const
 Return a pointer to the PixelCanvas on which this WorldCanvas is installed. More...
 
void addRefreshEventHandler (DisplayEH &eh)
 Add the given refresh, motion and position event handlers to the WorldCanvas. More...
 
void addMotionEventHandler (WCMotionEH &eh)
 
void addPositionEventHandler (WCPositionEH &eh)
 
void removeRefreshEventHandler (const DisplayEH &eh)
 Remove the given refresh, motion and position event handlers from the WorldCanvas. More...
 
void removeMotionEventHandler (const WCMotionEH &eh)
 
void removePositionEventHandler (const WCPositionEH &eh)
 
void callMotionEventHandlers (const WCMotionEvent &ev)
 Call all of the motion and position event handlers that are installed on the WorldCanvas. More...
 
void callPositionEventHandlers (const WCPositionEvent &ev)
 
virtual void handleEvent (DisplayEvent &ev)
 Handle other, generic types of events. More...
 
void operator() (const PCRefreshEvent &pev)
 Handle implicit refresh, motion and position events occuring on the PixelCanvas on which this WorldCanvas is installed. More...
 
void operator() (const PCMotionEvent &pev)
 Default just prints the event to cout. More...
 
void operator() (const PCPositionEvent &pev)
 Default just prints the event to cout. More...
 
void refresh (const Display::RefreshReason &reason=Display::UserCommand, const casacore::Bool &explicitrequest=true)
 Refresh the WorldCanvas for the given reason. More...
 
casacore::Bool refreshAllowed ()
 Is a refresh currently allowed? More...
 
void hold ()
 Hold and release response to refreshes requested with the refresh() member function. More...
 
void release ()
 
void setCoordinateHandler (WCCoordinateHandler *ch)
 Set casacore::Coordinate, SizeControl, Resample and DataScale handlers for the WorldCanvas. More...
 
void setSizeControlHandler (WCSizeControlHandler *sh)
 
void setResampleHandler (WCResampleHandler *rh)
 
void setDataScaleHandler (WCDataScaleHandler *sh)
 
void setWorldCanvasPosition (casacore::Double fracXOffset, casacore::Double fracYOffset, casacore::Double fracXSize, casacore::Double fracYSize)
 Set the location of the WorldCanvas on its PixelCanvas. More...
 
casacore::Bool pixToLin (casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &pix)
 Pixel, linear and world coordinate transformation functions. More...
 
casacore::Bool pixToLin (casacore::Matrix< casacore::Double > &lin, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &pix)
 
casacore::Bool linToPix (casacore::Vector< casacore::Double > &pix, const casacore::Vector< casacore::Double > &lin)
 
casacore::Bool linToPix (casacore::Matrix< casacore::Double > &pix, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &lin)
 
casacore::Bool linToWorld (casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &lin)
 
casacore::Bool linToWorld (casacore::Matrix< casacore::Double > &world, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &lin)
 
casacore::Bool worldToLin (casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &world)
 
casacore::Bool worldToLin (casacore::Matrix< casacore::Double > &lin, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &world)
 
casacore::Bool pixToWorld (casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &pix)
 
casacore::Bool pixToWorld (casacore::Matrix< casacore::Double > &world, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &pix)
 
casacore::Bool worldToPix (casacore::Vector< casacore::Double > &pix, const casacore::Vector< casacore::Double > &world)
 
casacore::Bool worldToPix (casacore::Matrix< casacore::Double > &pix, casacore::Vector< casacore::Bool > &failures, const casacore::Matrix< casacore::Double > &world)
 
void registerColormap (Colormap *cmap, casacore::Float weight=1.0)
 Register/unregister a Colormap on the PixelCanvas. More...
 
void registerColormap (Colormap *cmap, Colormap *cmapToReplace)
 
void unregisterColormap (Colormap *cmap)
 
void setColormap (Colormap *cmap)
 Set and retrieve the current Colormap on the PixelCanvas. More...
 
Colormapcolormap () const
 
casacore::uInt newList ()
 Display list support functions. More...
 
void endList ()
 
void drawList (casacore::uInt list)
 
void deleteList (casacore::uInt list)
 
void deleteLists ()
 
casacore::Bool validList (casacore::uInt list)
 
void setColor (const casacore::String &color)
 Set various graphics attributes. More...
 
void setClearColor (const casacore::String &color)
 
casacore::Bool setFont (const casacore::String &fontName)
 
void setForeground (casacore::uLong color)
 
void setBackground (casacore::uLong color)
 
void setLineWidth (casacore::Float width)
 
void setLineStyle (Display::LineStyle style)
 
void setCapStyle (Display::CapStyle style)
 
void setJoinStyle (Display::JoinStyle style)
 
void setFillStyle (Display::FillStyle style)
 
void setFillRule (Display::FillRule rule)
 
void setArcMode (Display::ArcMode mode)
 
casacore::Bool setWorldBackgroundColor (const casacore::String color)
 Set/retrieve the background and foreground colors of the WorldCanvas. More...
 
casacore::Bool setWorldForegroundColor (const casacore::String color)
 
casacore::String getWorldBackgroundColor ()
 
casacore::String getWorldForegroundColor ()
 
virtual void setDrawBuffer (Display::DrawBuffer buf)
 Set/retrieve the drawing buffer, the target destination for graphics. More...
 
Display::DrawBuffer drawBuffer () const
 
void setImageCacheStrategy (Display::ImageCacheStrategy strategy)
 Set/retrieve the caching strategy on the PixelCanvas. More...
 
Display::ImageCacheStrategy imageCacheStrategy () const
 
void clear ()
 Clear the WorldCanvas, or just the area on the WorldCanvas but outside the drawing area, ie. More...
 
void clearNonDrawArea ()
 
virtual void setDefaultOptions ()
 Install the default options for this DisplayData. More...
 
virtual casacore::Bool setOptions (const casacore::Record &rec, casacore::Record &updatedOptions)
 Apply options stored in rec to the DisplayData; return value true means a refresh is needed. More...
 
virtual casacore::Record getOptions () const
 Retrieve the current and default options and parameter types. More...
 
void setAttribute (Attribute &at)
 Set an Attribute or Attributes on the WorldCanvas. More...
 
void setAttributes (AttributeBuffer &at)
 
void removeAttribute (casacore::String &name)
 Remove an Attribute. More...
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::uInt &newValue) const
 User interface to get individual values from the attribute buffer. More...
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Int &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Float &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Double &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Bool &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::String &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::uInt > &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Int > &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Float > &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Double > &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::Bool > &newValue) const
 
casacore::Bool getAttributeValue (const casacore::String &name, casacore::Vector< casacore::String > &newValue) const
 
casacore::Bool existsAttribute (casacore::String &name) const
 Check if a certain Attribute exists. More...
 
AttValue::ValueType attributeType (casacore::String &name) const
 Get the type of an Attribute. More...
 
virtual void acquirePGPLOTdevice (const casacore::Bool &linear=true)
 Position the PGPLOT filter on the WorldCanvas. More...
 
virtual void releasePGPLOTdevice ()
 
virtual casacore::Int pgid () const
 Return the PGPLOT device id for external use. More...
 
casacore::Bool drawText (const casacore::Vector< casacore::Double > &point, const casacore::String &text, Display::TextAlign alignment=Display::AlignCenter, const casacore::Bool &linear=false)
 Draw unrotated text at the given position. More...
 
casacore::Bool drawPoint (const casacore::Vector< casacore::Double > &point, const casacore::Bool &linear=false)
 Draw a single point using the current color. More...
 
casacore::Bool drawLine (const casacore::Vector< casacore::Double > &a, const casacore::Vector< casacore::Double > &b, const casacore::Bool &linear=false)
 Draw a single line using the current color. More...
 
casacore::Bool drawPoints (const casacore::Matrix< casacore::Double > &points, const casacore::Bool &linear=false)
 Draw a bunch of points using the current color. More...
 
casacore::Bool drawPoints (const casacore::Vector< casacore::Float > &px, const casacore::Vector< casacore::Float > &py, casacore::Bool linear=false)
 Draw a set of points using the current color. More...
 
casacore::Bool drawTextStrings (const casacore::Vector< casacore::Float > &px, const casacore::Vector< casacore::Float > &py, const casacore::Vector< casacore::String > &strings, const casacore::Float rotation=0.0, const casacore::Float xoffset=0.0, const casacore::Float yoffset=0.0, const casacore::Bool linear=false)
 Draw a set of text strings using the current color. More...
 
casacore::Bool drawMarkers (const casacore::Vector< casacore::Float > &px, const casacore::Vector< casacore::Float > &py, const Display::Marker=Display::Cross, const casacore::Int size=5, const casacore::Bool &linear=false)
 Draw a set of markers using the current color and a given pixel size. More...
 
casacore::Bool drawMappedMarkers (const casacore::Vector< casacore::Float > &px, const casacore::Vector< casacore::Float > &py, const casacore::Vector< casacore::Float > &values, const casacore::Int sizemin=1, const casacore::Int sizemax=20, const Display::Marker=Display::Cross, const casacore::Bool &linear=false)
 
casacore::Bool drawLines (const casacore::Matrix< casacore::Double > &vertices, const casacore::Bool &linear=false)
 Draw pairs of lines using the current color. More...
 
casacore::Bool drawPolyline (const casacore::Matrix< casacore::Double > &vertices, const casacore::Bool &linear=false)
 Draw a polyline (connected line) between the vertices using the current color. More...
 
casacore::Bool drawPolygon (const casacore::Matrix< casacore::Double > &vertices, const casacore::Bool &linear=false)
 Draw a polygon (closed line, or line loop using the points) using the current color. More...
 
casacore::Bool drawColormappedPoints (const casacore::Matrix< casacore::Double > &points, const casacore::Vector< casacore::Float > &values, const casacore::Bool &linear=false)
 Draw a set of points in colors which are taken from the current Colormap. More...
 
casacore::Bool drawColormappedEllipses (const casacore::Matrix< casacore::Double > &centres, const casacore::Vector< casacore::Float > &smajor, const casacore::Vector< casacore::Float > &sminor, const casacore::Vector< casacore::Float > &pangle, const casacore::Vector< casacore::Float > &colors, const casacore::Float &scale=1.0, const casacore::Bool &outline=true, const casacore::Bool &linear=false)
 Draw a set of colored ellipses, possibly with outlines. More...
 
casacore::Bool drawBeamEllipse (casacore::Float major, casacore::Float minor, casacore::Float pa, casacore::String majunit="arcsec", casacore::String minunit="arcsec", casacore::String paunit="deg", casacore::Float cx=.1f, casacore::Float cy=.1f, casacore::Bool outline=true)
 This routine is specialized for drawing image restoring-beam ellipses. More...
 
bool drawContourMap (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Float > &data, const casacore::Vector< casacore::Float > &levels, const casacore::Bool usePixelEdges=false)
 Draw a contour map at the specified levels, and place the lower left pixel at blPos, and the upper right pixel at trPos. More...
 
bool drawContourMap (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Complex > &data, const casacore::Vector< casacore::Float > &levels, const casacore::Bool usePixelEdges=false)
 
bool drawContourMap (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Float > &data, const casacore::Matrix< casacore::Bool > &mask, const casacore::Vector< casacore::Float > &levels, const casacore::Bool usePixelEdges=false)
 Draw a contour map at the specified levels, and place the lower left pixel at blPos, and the upper right pixel at trPos. More...
 
bool drawContourMap (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Complex > &data, const casacore::Matrix< casacore::Bool > &mask, const casacore::Vector< casacore::Float > &levels, const casacore::Bool usePixelEdges=false)
 
casacore::Bool redrawIndexedImage (void *drawObj, Display::RefreshReason reason, casacore::Bool opaqueMask=false)
 Optimization to speed up colormap fiddling in 24bit mode (software Colormap); see images_, below for usage. More...
 
casacore::Bool removeIndexedImage (void *drawObj)
 Remove image from the colormap change cache, if any (see images_, below). More...
 
void clearColormapChangeCache ()
 Clear the whole colormap change cache (see images_, below). More...
 
void drawImage (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Float > &data, const casacore::Bool usePixelEdges=false, void *drawObj=0)
 Draw an image, mapping data values to Colormap entries, and place the lower left pixel at blPos, and the upper right pixel at trPos. More...
 
void drawImage (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Complex > &data, const casacore::Bool usePixelEdges=false, void *drawObj=0)
 
void drawImage (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Float > &data, const casacore::Matrix< casacore::Float > &dataRed, const casacore::Matrix< casacore::Float > &dataGreen, const casacore::Matrix< casacore::Float > &dataBlue, const casacore::Bool usePixelEdges, void *drawObj=0)
 
void drawImage (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Complex > &data, const casacore::Matrix< casacore::Complex > &dataRed, const casacore::Matrix< casacore::Complex > &dataGreen, const casacore::Matrix< casacore::Complex > &dataBlue, const casacore::Bool usePixelEdges, void *drawObj=0)
 
void drawImage (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Float > &data, const casacore::Matrix< casacore::Bool > &mask, const casacore::Bool usePixelEdges=false, void *drawObj=0, casacore::Bool opaqueMask=false)
 Draw an image, mapping data values to Colormap entries, and place the lower left pixel at blPos, and the upper right pixel at trPos. More...
 
void drawImage (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Complex > &data, const casacore::Matrix< casacore::Bool > &mask, const casacore::Bool usePixelEdges=false, void *drawObj=0, casacore::Bool opaqueMask=false)
 
void drawImage (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Float > &data, const Display::ColorComponent &colorcomponent, const casacore::Bool usePixelEdges=false)
 Draw a component of a multi-channel image, mapping data values to component levels, and place the lower left pixel at blPos, and the upper right pixel at trPos. More...
 
void drawImage (const casacore::Vector< casacore::Double > &blPos, const casacore::Vector< casacore::Double > &trPos, const casacore::Matrix< casacore::Complex > &data, const Display::ColorComponent &colorcomponent, const casacore::Bool usePixelEdges=false)
 
bool drawVectorMap (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Complex > &data, const casacore::Matrix< casacore::Bool > &mask, casacore::Float angleConversionFactor, casacore::Float phasePolarity, casacore::Bool debias, casacore::Float variance, casacore::Int xPixelInc, casacore::Int yPixelInc, casacore::Float scale, casacore::Bool arrow, casacore::Float barb, casacore::Float rotation, casacore::Double xWorldInc, casacore::Double yWorldInc, const casacore::Bool usePixelEdges)
 Draw a vector map. More...
 
bool drawVectorMap (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Float > &data, const casacore::Matrix< casacore::Bool > &mask, casacore::Float angleConversionFactor, casacore::Float phasePolarity, casacore::Bool debias, casacore::Float variance, casacore::Int xPixelInc, casacore::Int yPixelInc, casacore::Float scale, casacore::Bool arrow, casacore::Float barb, casacore::Float rotation, casacore::Double xWorldInc, casacore::Double yWorldInc, const casacore::Bool usePixelEdges)
 
bool drawMarkerMap (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Float > &data, const casacore::Matrix< casacore::Bool > &mask, casacore::Int xPixelInc, casacore::Int yPixelInc, casacore::Float scale, casacore::Double xWorldInc, casacore::Double yWorldInc, const casacore::String &markeType, casacore::Bool usePixelEdges)
 Draw marker maps. More...
 
bool drawMarkerMap (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Complex > &data, const casacore::Matrix< casacore::Bool > &mask, casacore::Int xPixelInc, casacore::Int yPixelInc, casacore::Float scale, casacore::Double xWorldInc, casacore::Double yWorldInc, const casacore::String &markerType, casacore::Bool usePixelEdges)
 
void flushComponentImages ()
 Flush the component images, ie. More...
 
void copyBackBufferToFrontBuffer ()
 Buffer memory exchanges which operate only on the area of the WorldCanvas. More...
 
void copyFrontBufferToBackBuffer ()
 
void swapBuffers ()
 
casacore::Double linXMin () const
 Provide information on the extents of the linear coordinate system. More...
 
casacore::Double linYMin () const
 
casacore::Double linXMax () const
 
casacore::Double linYMax () const
 
casacore::Double linXMinLimit () const
 Provide information on the limits of the linear coordinate system. More...
 
casacore::Double linYMinLimit () const
 
casacore::Double linXMaxLimit () const
 
casacore::Double linYMaxLimit () const
 
casacore::uInt canvasXOffset () const
 Provide information on the WorldCanvas offset and size. More...
 
casacore::uInt canvasYOffset () const
 
casacore::uInt canvasXSize () const
 
casacore::uInt canvasYSize () const
 
casacore::uInt canvasDrawXOffset () const
 Provide information on the WorldCanvas drawable offset and size. More...
 
casacore::uInt canvasDrawYOffset () const
 
casacore::uInt canvasDrawXSize () const
 
casacore::uInt canvasDrawYSize () const
 
void setZoomRectangleLCS (const casacore::Vector< casacore::Double > &min, const casacore::Vector< casacore::Double > &max)
 Set the zoom rectangle to the specfied linear coordinate range. More...
 
void moveZoomRectangleLCS (double dx, double dy)
 Move the zoom rectangle across the screen, ie. More...
 
void resetZoomRectangle ()
 Reset the zoom to show the entire allowable range of the linear coordinate system. More...
 
void setLinearCoordinateSystem (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, casacore::Bool resetZoom=true)
 Set the allowable range of the linear coordinate system. More...
 
casacore::Double dataMin () const
 Functions to set and retrieve the minimum and maximum data values for scaling data that is drawn on the WorldCanvas. More...
 
void setDataMin (casacore::Double min)
 
casacore::Double dataMax () const
 
void setDataMax (casacore::Double max)
 
void setDataMinMax (casacore::Double min, casacore::Double max)
 
Display::ComplexToRealMethod complexToRealMethod () const
 ComplexToRealMethod defines which real component of a Complex image to extract when it is necessary to convert casacore::Complex data into real data. More...
 
void setComplexToRealMethod (const Display::ComplexToRealMethod method)
 
void setCoordinateSystem (const DisplayCoordinateSystem &csys)
 Set and retrieve the DisplayCoordinateSystem of this WorldCanvas. More...
 
const DisplayCoordinateSystemcoordinateSystem () const
 
casacore::Bool hasCS () const
 
casacore::Bool inDrawArea (casacore::Int x, casacore::Int y) const
 Convenience functions returning whether a pixel coordinate is within bounds of the WC's inner draw area, the WC, or the underlying PC. More...
 
casacore::Bool inWC (casacore::Int x, casacore::Int y) const
 
casacore::Bool inPC (casacore::Int x, casacore::Int y)
 
void setRestriction (const Attribute &restriction)
 Install a single restriction, or a buffer of restrictions, on the WorldCanvas 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 removeRestriction (const casacore::String &restrictionName)
 Remove the named restriction, or all restrictions, from the WorldCanvas. More...
 
void removeRestrictions ()
 
casacore::Bool matchesRestriction (const Attribute &restriction) const
 Determine whether the restrictions installed on the WorldCanvas match the given restriction or buffer of restrictions. More...
 
casacore::Bool matchesRestrictions (const AttributeBuffer &buffer) const
 
const AttributeBufferrestrictionBuffer () const
 Return the buffer of restrictions installed on this WorldCanvas. More...
 
int zIndex () const
 convienience function based on "restriction buffer"... More...
 
const DisplayDatacsMaster () const
 The DD in charge of setting WC coordinate state (0 if none). More...
 
DisplayData *& csMaster ()
 
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...
 
bool removeDD (const DisplayData *dd)
 
virtual casacore::Vector
< casacore::String
worldAxisNames () const
 Return the names and units of the world coordinate axes. More...
 
virtual casacore::Vector
< casacore::String
worldAxisUnits () const
 
const std::list< DisplayData * > & displaylist () const
 
std::string errorMessage () const
 
- Public Member Functions inherited from casa::PCRefreshEH
 PCRefreshEH ()
 Default Constructor Required. More...
 
 PCRefreshEH (const PCRefreshEH &other)
 
virtual ~PCRefreshEH ()
 Destructor. More...
 
- Public Member Functions inherited from casa::PCMotionEH
 PCMotionEH ()
 Default Constructor Required. More...
 
virtual ~PCMotionEH ()
 Destructor. More...
 
- Public Member Functions inherited from casa::PCPositionEH
 PCPositionEH ()
 Default Constructor Required. More...
 
virtual ~PCPositionEH ()
 Destructor. More...
 
- Public Member Functions inherited from casa::DisplayEH
virtual ~DisplayEH ()
 
- 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...
 

Static Public Attributes

static const casacore::String LEFT_MARGIN_SPACE_PG
 
static const casacore::String RIGHT_MARGIN_SPACE_PG
 
static const casacore::String BOTTOM_MARGIN_SPACE_PG
 
static const casacore::String TOP_MARGIN_SPACE_PG
 

Private Member Functions

void ctorInit ()
 Support for construction. More...
 
void callRefreshEventHandlers (const WCRefreshEvent &ev)
 Call all registered refresh handlers (public method is refresh()). More...
 
void updateCanvasSizesOffsets ()
 Update canvas sizes/offsets from the fracOffsets, and vice versa. More...
 
void updateFracSizesOffsets ()
 
casacore::Bool castingConversion (casacore::Vector< casacore::Int > &pixelpt, const casacore::Vector< casacore::Double > &worldpt, const casacore::Bool &linear)
 Convert the given coordinate/s to pixel coordinates. More...
 
casacore::Bool castingConversion (casacore::Matrix< casacore::Int > &pixelpts, const casacore::Matrix< casacore::Double > &worldpts, const casacore::Bool &linear)
 
casacore::Bool castingConversion (casacore::Matrix< casacore::Float > &pixelpts, const casacore::Matrix< casacore::Double > &worldpts, const casacore::Bool &linear)
 
casacore::Bool castingClippingConversion (casacore::Vector< casacore::Int > &pixelx, casacore::Vector< casacore::Int > &pixely, casacore::Vector< casacore::Bool > &validConversions, const casacore::Vector< casacore::Float > &worldx, const casacore::Vector< casacore::Float > &worldy, const casacore::Bool linear)
 Convert the given coordinate/s to pixel coordinates. More...
 
bool drawVectorMap (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Float > &amp, const casacore::Matrix< casacore::Float > &pa, const casacore::Matrix< casacore::Bool > &mask, casacore::Float angleConversionFactor, casacore::Float phasePolarity, casacore::Bool debias, casacore::Float variance, casacore::Int xPixelInc, casacore::Int yPixelInc, casacore::Float scale, casacore::Bool arrow, casacore::Float barb, casacore::Float rotation, casacore::Double xWorldInc, casacore::Double yWorldInc, const casacore::Bool usePixelEdges)
 Actually draw the vector field. More...
 
void trimAndResampleImage (casacore::Vector< casacore::Double > &drawBlc, casacore::Vector< casacore::Double > &drawTrc, casacore::Matrix< casacore::Float > &sampledImage, const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Float > &data, const casacore::Bool &usePixelEdges=false)
 Trim and resample an image, returning the actual world BLC and TRC for drawing, and the resampled image. More...
 
void trimAndResampleImage (casacore::Vector< casacore::Double > &drawBlc, casacore::Vector< casacore::Double > &drawTrc, casacore::Matrix< casacore::Float > &sampledImage, casacore::Matrix< casacore::Bool > &resampledMask, const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Float > &data, const casacore::Matrix< casacore::Bool > &mask, const casacore::Bool &usePixelEdges=false)
 Trim and resample an image, returning the actual world BLC and TRC for drawing, and the resampled image. More...
 
void mapToColorAndDrawImage (const casacore::Vector< casacore::Int > &blc, const casacore::Matrix< casacore::uInt > &scaledImage)
 Draw an image where scaledImage gives the Colormap index of each screen (PixelCanvas) pixel. More...
 
void mapToColorAndDrawImage (const casacore::Vector< casacore::Int > &blc, const casacore::Matrix< casacore::uInt > &scaledImage, const casacore::Matrix< casacore::Bool > &mask, casacore::Bool opaqueMask=false)
 
casacore::Bool mapToColorAndDrawPoints (const casacore::Matrix< casacore::Double > &points, const casacore::Vector< casacore::uInt > &scaledValues, const casacore::Bool &linear=false)
 Draw a set of points where scaledValues gives the Colormap index of each point. More...
 
casacore::Bool mapToColorAndDrawEllipses (const casacore::Matrix< casacore::Double > &centres, const casacore::Vector< casacore::Float > &smajor, const casacore::Vector< casacore::Float > &sminor, const casacore::Vector< casacore::Float > &pangle, const casacore::Vector< casacore::uInt > scaledValues, const casacore::Float &scale, const casacore::Bool &outline, const casacore::Bool &linear)
 Draw a set of ellipses where scaledValues gives the Colormap index of each point. More...
 
ColorIndexedImage_makeColorIndexedImage (const casacore::Vector< casacore::Double > &blc, const casacore::Vector< casacore::Double > &trc, const casacore::Matrix< casacore::Float > &data, const casacore::Bool usePixelEdges, void *drawObj)
 
casacore::Matrix< casacore::uIntmapToColor (const casacore::Matrix< casacore::uInt > &scaledImage)
 
ColorIndexedImage_getClearedColorIndexedImage (void *drawObj=0)
 Retrieve an indexed image to write onto. More...
 

Private Attributes

casacore::uInt itsCanvasXOffset
 ***Cached*** blc pixel where this world canvas begins = itsPixelCanvas->width()*frac(X|Y)Offset_. More...
 
casacore::uInt itsCanvasYOffset
 
casacore::uInt itsCanvasXSize
 ***Cached*** number of pixels in each dimension given to the world canvas = itsPixelCanvas->width()*(frac(X|Y)Size_. More...
 
casacore::uInt itsCanvasYSize
 
casacore::Double itsFracXOffset
 Fractional position of world canvas on pixel canvas. More...
 
casacore::Double itsFracYOffset
 
casacore::Double itsFracXSize
 
casacore::Double itsFracYSize
 
casacore::uInt itsCanvasDrawXOffset
 ***Cached*** blc pixel where the world canvas 'draw area' (inside margins, labels) begins, relative to WC blc. More...
 
casacore::uInt itsCanvasDrawYOffset
 
casacore::uInt itsCanvasDrawXSize
 ***Cached*** number of pixels in each dimension given to the drawable part of the world canvas More...
 
casacore::uInt itsCanvasDrawYSize
 
casacore::Double itsLinXMin
 Linear casacore::Coordinate System ranges. More...
 
casacore::Double itsLinYMin
 
casacore::Double itsLinXMax
 
casacore::Double itsLinYMax
 
casacore::Double itsLinXMinLimit
 Linear casacore::Coordinate System Limits. More...
 
casacore::Double itsLinYMinLimit
 
casacore::Double itsLinXMaxLimit
 
casacore::Double itsLinYMaxLimit
 
casacore::Double itsDataMin
 Dynamic data minimum and maximum for this WorldCanvas. More...
 
casacore::Double itsDataMax
 
Display::ComplexToRealMethod itsComplexToRealMethod
 Method to use to convert complex data into real values. More...
 
std::list< DisplayEH * > itsRefreshEHList
 Event handler lists and convenient iterators. More...
 
std::list< WCPositionEH * > itsPositionEHList
 
std::list< WCMotionEH * > itsMotionEHList
 
WCSizeControlHandleritsSizeControlHandler
 Other handler lists. More...
 
WCCoordinateHandleritsCoordinateHandler
 
WCResampleHandleritsResampleHandler
 
WCDataScaleHandleritsDataScaleHandler
 
casacore::Bool itsOwnSizeControlHandler
 Store whether we "own" the various handlers. More...
 
casacore::Bool itsOwnCoordinateHandler
 
casacore::Bool itsOwnResampleHandler
 
casacore::Bool itsOwnDataScaleHandler
 
AttributeBuffer attributes
 Buffer for Attributes. More...
 
casacore::String itsWorldBackgroundColor
 Background/foreground colors. More...
 
casacore::String itsWorldForegroundColor
 
PixelCanvasitsPixelCanvas
 PixelCanvas pointer. More...
 
WCPGFilteritsPGFilter
 PGPLOT filter. More...
 
casacore::Int itsHoldCount
 Status of hold/release. More...
 
casacore::Bool itsRefreshHeld
 
Display::RefreshReason itsHeldReason
 
DisplayCoordinateSystemitsCoordinateSystem
 The DisplayCoordinateSystem for this WorldCanvas. More...
 
casacore::Bool itsGrabbing
 This state is set true when the pointer is in this WC and a pointer button is pressed (with no buttons pressed previously). More...
 
std::map< void
*, ColorIndexedImage_ * > 
images_
 Cache of pre-drawn ColorIndexedImage_'s. More...
 
AttributeBuffer itsRestrictions
 A buffer to contain the restrictions that DisplayDatas must match if they are to be allowed to draw themselves. More...
 
DisplayDataitsCSmaster
 [First] responder to 'sizeControl', responsible for setting WC CS, zoom window and draw area. More...
 
casacore::uInt itsId
 itsId & itsRef used to ensure thread-safe execution of pgplot More...
 
casacore::uInt itsRef
 WorldCanvas::refresh is a recursive function. More...
 
std::string error_string
 

Additional Inherited Members

- Protected Member Functions inherited from casa::DisplayOptions
 DisplayOptions (const DisplayOptions &other)
 (Required) copy constructor. More...
 
void operator= (const DisplayOptions &other)
 (Required) copy assignment. More...
 

Detailed Description

Implementation of drawing in world coordinates on top of a PixelCanvas.

Prerequisite

Etymology

WorldCanvas is a canvas on which primitives specified in world coordinates are drawn.

Synopsis

The world canvas manages a portion of a PixelCanvas and provides mechanisms to allow the user to draw images and vectors in world coordinates. The position of the WorldCanvas may be dynamically changed.

The WorldCanvas vector graphics commands assume world coordinates are specified and use a registered coordinate handler to map those coordinates via a linear system to pixel coordinates. The pixel coordinates are then sent on to the PixelCanvas where they are plotted.

Images are drawn by sending a casacore::Matrix and specifying the world-coordinate location of the center of the lower-left pixel. If the dataMin and dataMax values have been set, they will be used to scale the data, otherwise the min and max will be scanned.

Customizable tools associated with the WorldCanvas available to assist with various aspects of display.

The interface for these tools are implemented as abstract base classes, and the tools are implemented by deriving from these classes and overriding the functions contained therein.

The WorldCanvas provides an interface to the PixelCanvas caching mechanism. Clever use of caching and parsing of the reason field of a WCRefreshEvent can reduce unnecessary recomputation needed for refreshing the screen.

The WorldCanvas maintains a set of Attribute s which the user can set on the WorldCanvas. An Attribute is a combination of a name and a value, the value can be of type casacore::uInt, casacore::Int, casacore::Float, casacore::Double, casacore::Bool and casacore::String, and Vectors of these. These Attributes serve two purposes: 1) to allow to place (using the member functions setAttribute and setAttributes) more or less arbitrary information on the WorldCanvas that other classes can read from the WorldCanvas. Since the name of an Attribute can be defined at run time, any name can be used (i.e. there is no pre-defined set of names that can only be used), and 2) to have a generic interface to some of the internal variables of the WorldCanvas. Some internal variabels can be set/read with their own interface routine (e.g. linXMin and friends using setZoomRectangleLCS), but they can also be modified/read using the Attribute interface (using getAttributeValue). The use of e.g. SetZoomRectangleLCS() and setAttribute() is equivalent. See AttributeBuffer for more details. The following Attributes (and their types) are pre-defined on the WorldCanvas and can be accessed using the Attribute interface (note: these Attributes cannot be deleted using removeAttribute()):

The WorldCanvas knows three coordinate systems.

Motivation

Wanted a world-coordinate plotting canvas

Example

See the test programs in Display/test

To Do

Definition at line 204 of file WorldCanvas.h.

Constructor & Destructor Documentation

casa::WorldCanvas::WorldCanvas ( PixelCanvas pc,
casacore::Double  xOrigin = 0.0,
casacore::Double  yOrigin = 0.0,
casacore::Double  xSize = 1.0,
casacore::Double  ySize = 1.0 
)

Construct a WorldCanvas on the given PixelCanvas, at the given origin (in fractions of the PixelCanvas extent), and having the given size (in the same units).

virtual casa::WorldCanvas::~WorldCanvas ( )
virtual

Destructor.

Member Function Documentation

virtual void casa::WorldCanvas::acquirePGPLOTdevice ( const casacore::Bool linear = true)
virtual

Position the PGPLOT filter on the WorldCanvas.

If linear is specified false, then the alignment is done by world coordinates, assuming that a linear approximation is valid. void verifyPGFilterAlignment(const casacore::Bool &linear = true);

Acquire and release a PGPLOT device for this WorldCanvas. This is necessary since PGPLOT generally only supports 8 currently active devices. So refresh cycles on the WorldCanvas acquire a PGPLOT device at the start, and release it at the end. Cycles are counted so that external user-classes can call these functions if necessary in a nested state. If linear is specified as false, then the PGPLOT device is aligned by world coordinates, under the assumption that a linear approximation is valid, that is, the curvature is small.

void casa::WorldCanvas::addMotionEventHandler ( WCMotionEH eh)
void casa::WorldCanvas::addPositionEventHandler ( WCPositionEH eh)
void casa::WorldCanvas::addRefreshEventHandler ( DisplayEH eh)

Add the given refresh, motion and position event handlers to the WorldCanvas.

AttValue::ValueType casa::WorldCanvas::attributeType ( casacore::String name) const

Get the type of an Attribute.

void casa::WorldCanvas::callMotionEventHandlers ( const WCMotionEvent ev)

Call all of the motion and position event handlers that are installed on the WorldCanvas.

void casa::WorldCanvas::callPositionEventHandlers ( const WCPositionEvent ev)
void casa::WorldCanvas::callRefreshEventHandlers ( const WCRefreshEvent ev)
private

Call all registered refresh handlers (public method is refresh()).

casacore::uInt casa::WorldCanvas::canvasDrawXOffset ( ) const
inline

Provide information on the WorldCanvas drawable offset and size.

Definition at line 914 of file WorldCanvas.h.

References itsCanvasDrawXOffset.

casacore::uInt casa::WorldCanvas::canvasDrawXSize ( ) const
inline

Definition at line 920 of file WorldCanvas.h.

References itsCanvasDrawXSize.

casacore::uInt casa::WorldCanvas::canvasDrawYOffset ( ) const
inline

Definition at line 917 of file WorldCanvas.h.

References itsCanvasDrawYOffset.

casacore::uInt casa::WorldCanvas::canvasDrawYSize ( ) const
inline

Definition at line 923 of file WorldCanvas.h.

References itsCanvasDrawYSize.

casacore::uInt casa::WorldCanvas::canvasXOffset ( ) const
inline

Provide information on the WorldCanvas offset and size.

Definition at line 898 of file WorldCanvas.h.

References itsCanvasXOffset.

casacore::uInt casa::WorldCanvas::canvasXSize ( ) const
inline

Definition at line 904 of file WorldCanvas.h.

References itsCanvasXSize.

casacore::uInt casa::WorldCanvas::canvasYOffset ( ) const
inline

Definition at line 901 of file WorldCanvas.h.

References itsCanvasYOffset.

casacore::uInt casa::WorldCanvas::canvasYSize ( ) const
inline

Definition at line 907 of file WorldCanvas.h.

References itsCanvasYSize.

casacore::Bool casa::WorldCanvas::castingClippingConversion ( casacore::Vector< casacore::Int > &  pixelx,
casacore::Vector< casacore::Int > &  pixely,
casacore::Vector< casacore::Bool > &  validConversions,
const casacore::Vector< casacore::Float > &  worldx,
const casacore::Vector< casacore::Float > &  worldy,
const casacore::Bool  linear 
)
private

Convert the given coordinate/s to pixel coordinates.

If linear is true, then the input coordinates are linear world coordinates, otherwise they are true world coordinates. This version applies clipping, so that any points in the series which lie outside the linear coordinate range of the WorldCanvas are discarded. Thus the output Vectors can be shorter than the input Vectors. A mask indicating which of the input points were valid is returned for user reference.

casacore::Bool casa::WorldCanvas::castingConversion ( casacore::Vector< casacore::Int > &  pixelpt,
const casacore::Vector< casacore::Double > &  worldpt,
const casacore::Bool linear 
)
private

Convert the given coordinate/s to pixel coordinates.

If linear is true, then the given coordinates are in linear world coordinates, otherwise they are real world coordinates. A return value of false indicates the conversion failed.

casacore::Bool casa::WorldCanvas::castingConversion ( casacore::Matrix< casacore::Int > &  pixelpts,
const casacore::Matrix< casacore::Double > &  worldpts,
const casacore::Bool linear 
)
private
casacore::Bool casa::WorldCanvas::castingConversion ( casacore::Matrix< casacore::Float > &  pixelpts,
const casacore::Matrix< casacore::Double > &  worldpts,
const casacore::Bool linear 
)
private
void casa::WorldCanvas::clear ( )

Clear the WorldCanvas, or just the area on the WorldCanvas but outside the drawing area, ie.

the margins that are normally reserved for axis labels and the like.

void casa::WorldCanvas::clearColormapChangeCache ( )

Clear the whole colormap change cache (see images_, below).

void casa::WorldCanvas::clearNonDrawArea ( )
Colormap* casa::WorldCanvas::colormap ( ) const
Display::ComplexToRealMethod casa::WorldCanvas::complexToRealMethod ( ) const
inline

ComplexToRealMethod defines which real component of a Complex image to extract when it is necessary to convert casacore::Complex data into real data.

Definition at line 971 of file WorldCanvas.h.

References itsComplexToRealMethod.

const DisplayCoordinateSystem& casa::WorldCanvas::coordinateSystem ( ) const
void casa::WorldCanvas::copyBackBufferToFrontBuffer ( )

Buffer memory exchanges which operate only on the area of the WorldCanvas.

(Not cacheable yet.)

void casa::WorldCanvas::copyFrontBufferToBackBuffer ( )
const DisplayData* casa::WorldCanvas::csMaster ( ) const
inline

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

Definition at line 1052 of file WorldCanvas.h.

References itsCSmaster.

Referenced by casa::WorldCanvasHolder::csMaster(), isCSmaster(), and removeDD().

DisplayData*& casa::WorldCanvas::csMaster ( )
inline

Definition at line 1055 of file WorldCanvas.h.

References itsCSmaster.

void casa::WorldCanvas::ctorInit ( )
private

Support for construction.

casacore::Double casa::WorldCanvas::dataMax ( ) const
inline

Definition at line 955 of file WorldCanvas.h.

References itsDataMax.

casacore::Double casa::WorldCanvas::dataMin ( ) const
inline

Functions to set and retrieve the minimum and maximum data values for scaling data that is drawn on the WorldCanvas.

These values are forwarded to the scale handler, when, for example, images are drawn.

Definition at line 949 of file WorldCanvas.h.

References itsDataMin.

void casa::WorldCanvas::deleteList ( casacore::uInt  list)
void casa::WorldCanvas::deleteLists ( )
const std::list<DisplayData*>& casa::WorldCanvas::displaylist ( ) const
casacore::Bool casa::WorldCanvas::drawBeamEllipse ( casacore::Float  major,
casacore::Float  minor,
casacore::Float  pa,
casacore::String  majunit = "arcsec",
casacore::String  minunit = "arcsec",
casacore::String  paunit = "deg",
casacore::Float  cx = .1f,
casacore::Float  cy = .1f,
casacore::Bool  outline = true 
)

This routine is specialized for drawing image restoring-beam ellipses.

Its parameters are defined so as to require as little conversion as possible of restoring beam information as stored in an image header.

It does nothing unless the axes on display map to the two axes of a casacore::DirectionCoordinate within the WC CS (WorldCanvas::itsDisplayCoordinateSystem). Center location cx,cy is specified as a fraction of WC draw area: (0,0) is blc, (1,1) is trc; they default to (.1,.1).

The unit strings for major,minor are given in in majunit, minunit, and should be valid angular units (they default to "arcsec"). major/minor are the full major and minor axis sizes in terms of relative direction world coordinates.

pa specifies "position angle", in the angular units specified by paunit. pa uses the image header convention "North-to-East"; more precisely, 0 degrees aligns the major axis along increasing DirCoord(1) (commonly Dec), 90 degrees aligns it along increasing DirCoord(0) (commonly RA). (NB: increasing RA commonly means decreasing pixel/casacore::Lattice coordinates). In the common case, this means that pa increases counterclockwise from vertical. Note that this is not the pa convention in some other PixelCanvas/WorldCanvas drawEllipse() routines (where pa is always counterclockwise from horizontal).

Also note: this routine attempts to do the right thing in oddball cases such as displaying Dec on the horizontal axis (pa 0 would also be horizontal in that case), distorted ('flexible') aspect ratio (ellipse also distorted appropriately) or all-sky images in which the beam may be displayed in a canvas area where absolute world coordinates do not exist. It should even take care of uneven coordinate 'increments' (non-square image data pixels). (So far, it does not correctly handle non-identity transformation matrices in the casacore::DirectionCoordinate (e.g. rotated "North")– which I think is true in many other places as well... – for someone's to-do list (not mine, I hope)).

Display::DrawBuffer casa::WorldCanvas::drawBuffer ( ) const
casacore::Bool casa::WorldCanvas::drawColormappedEllipses ( const casacore::Matrix< casacore::Double > &  centres,
const casacore::Vector< casacore::Float > &  smajor,
const casacore::Vector< casacore::Float > &  sminor,
const casacore::Vector< casacore::Float > &  pangle,
const casacore::Vector< casacore::Float > &  colors,
const casacore::Float scale = 1.0,
const casacore::Bool outline = true,
const casacore::Bool linear = false 
)

Draw a set of colored ellipses, possibly with outlines.

The x and y locations must given, along with semi-major and semi-minor axes, and position angle measured in degrees positive from the x axis in a counter-clockwise direction. The size of the ellipses is globally scaled by the scale factor, and if outline is true, then each ellipse will have an outline in the current pen color.

casacore::Bool casa::WorldCanvas::drawColormappedPoints ( const casacore::Matrix< casacore::Double > &  points,
const casacore::Vector< casacore::Float > &  values,
const casacore::Bool linear = false 
)

Draw a set of points in colors which are taken from the current Colormap.

bool casa::WorldCanvas::drawContourMap ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Vector< casacore::Float > &  levels,
const casacore::Bool  usePixelEdges = false 
)

Draw a contour map at the specified levels, and place the lower left pixel at blPos, and the upper right pixel at trPos.

If usePixelEdges is true, then the given world positions are the position of the blc and trc of the blc and trc pixels, otherwise they are the positions of the centres of the pixels. Note that the contours are not intrinsically drawn in world coordinates. For complex data, the conversion to real values is done according to the last call to setComplexToRealMethod. Returns true if OK, false if error...

bool casa::WorldCanvas::drawContourMap ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Complex > &  data,
const casacore::Vector< casacore::Float > &  levels,
const casacore::Bool  usePixelEdges = false 
)
bool casa::WorldCanvas::drawContourMap ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
const casacore::Vector< casacore::Float > &  levels,
const casacore::Bool  usePixelEdges = false 
)

Draw a contour map at the specified levels, and place the lower left pixel at blPos, and the upper right pixel at trPos.

If usePixelEdges is true, then the given world positions are the position of the blc and trc of the blc and trc pixels, otherwise they are the positions of the centres of the pixels. Note that the contours are not intrinsically drawn in world coordinates. For complex data, the conversion to real values is done according to the last call to setComplexToRealMethod. These functions also have a mask argument, which is a Boolean pixel mask whose shape must match that of data, and only pixels in data where corresponding pixels in mask are true will be contoured. Returns true if OK, false if error...

bool casa::WorldCanvas::drawContourMap ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Complex > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
const casacore::Vector< casacore::Float > &  levels,
const casacore::Bool  usePixelEdges = false 
)
void casa::WorldCanvas::drawImage ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Bool  usePixelEdges = false,
void *  drawObj = 0 
)

Draw an image, mapping data values to Colormap entries, and place the lower left pixel at blPos, and the upper right pixel at trPos.

If usePixelEdges is true, then the given world positions are the position of the blc and trc of the blc and trc pixels, otherwise they are the positions of the centres of the pixels. See images_, below, for non-default usage of the drawObj parameter.

void casa::WorldCanvas::drawImage ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Complex > &  data,
const casacore::Bool  usePixelEdges = false,
void *  drawObj = 0 
)
void casa::WorldCanvas::drawImage ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Matrix< casacore::Float > &  dataRed,
const casacore::Matrix< casacore::Float > &  dataGreen,
const casacore::Matrix< casacore::Float > &  dataBlue,
const casacore::Bool  usePixelEdges,
void *  drawObj = 0 
)
void casa::WorldCanvas::drawImage ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Complex > &  data,
const casacore::Matrix< casacore::Complex > &  dataRed,
const casacore::Matrix< casacore::Complex > &  dataGreen,
const casacore::Matrix< casacore::Complex > &  dataBlue,
const casacore::Bool  usePixelEdges,
void *  drawObj = 0 
)
void casa::WorldCanvas::drawImage ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
const casacore::Bool  usePixelEdges = false,
void *  drawObj = 0,
casacore::Bool  opaqueMask = false 
)

Draw an image, mapping data values to Colormap entries, and place the lower left pixel at blPos, and the upper right pixel at trPos.

If usePixelEdges is true, then the given world positions are the position of the blc and trc of the blc and trc pixels, otherwise they are the positions of the centres of the pixels. These functions also have a mask argument, which is a Boolean pixel mask whose shape must match that of data, and only pixels in data where corresponding pixels in mask are true will be drawn. Set opaqueMask to true to draw masked pixels in the background color; otherwise they will be transparent (letting whatever was drawn previously at that point show through). See images_, below, for non-default usage of the drawObj parameter.

void casa::WorldCanvas::drawImage ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Complex > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
const casacore::Bool  usePixelEdges = false,
void *  drawObj = 0,
casacore::Bool  opaqueMask = false 
)
void casa::WorldCanvas::drawImage ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Float > &  data,
const Display::ColorComponent colorcomponent,
const casacore::Bool  usePixelEdges = false 
)

Draw a component of a multi-channel image, mapping data values to component levels, and place the lower left pixel at blPos, and the upper right pixel at trPos.

If usePixelEdges is true, then the given world positions are the position of the blc and trc of the blc and trc pixels, otherwise they are the positions of the centres of the pixels. The components are not drawn until flushComponentImages() is called.

void casa::WorldCanvas::drawImage ( const casacore::Vector< casacore::Double > &  blPos,
const casacore::Vector< casacore::Double > &  trPos,
const casacore::Matrix< casacore::Complex > &  data,
const Display::ColorComponent colorcomponent,
const casacore::Bool  usePixelEdges = false 
)
casacore::Bool casa::WorldCanvas::drawLine ( const casacore::Vector< casacore::Double > &  a,
const casacore::Vector< casacore::Double > &  b,
const casacore::Bool linear = false 
)

Draw a single line using the current color.

If either of the conversions from world to pixel coordinates fail, then the line is not drawn, and false is returned. If linear is true, then the line endpoints are given in world canvas linear coordinates rather than real world coordinates.

casacore::Bool casa::WorldCanvas::drawLines ( const casacore::Matrix< casacore::Double > &  vertices,
const casacore::Bool linear = false 
)

Draw pairs of lines using the current color.

If any points fail to convert then the lines are not drawn and false is returned. If linear is true, then the vertices are given as linear world coordinates rather than true world coordinates.

void casa::WorldCanvas::drawList ( casacore::uInt  list)
casacore::Bool casa::WorldCanvas::drawMappedMarkers ( const casacore::Vector< casacore::Float > &  px,
const casacore::Vector< casacore::Float > &  py,
const casacore::Vector< casacore::Float > &  values,
const casacore::Int  sizemin = 1,
const casacore::Int  sizemax = 20,
const Display::Marker  = Display::Cross,
const casacore::Bool linear = false 
)
bool casa::WorldCanvas::drawMarkerMap ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
casacore::Int  xPixelInc,
casacore::Int  yPixelInc,
casacore::Float  scale,
casacore::Double  xWorldInc,
casacore::Double  yWorldInc,
const casacore::String markeType,
casacore::Bool  usePixelEdges 
)

Draw marker maps.

Only makerType "square" available presently. The marker holds its shape in screen pixel coordinates. This means a square is always a square regardless of aspect ratio Returns true if OK, false if error...

bool casa::WorldCanvas::drawMarkerMap ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Complex > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
casacore::Int  xPixelInc,
casacore::Int  yPixelInc,
casacore::Float  scale,
casacore::Double  xWorldInc,
casacore::Double  yWorldInc,
const casacore::String markerType,
casacore::Bool  usePixelEdges 
)
casacore::Bool casa::WorldCanvas::drawMarkers ( const casacore::Vector< casacore::Float > &  px,
const casacore::Vector< casacore::Float > &  py,
const Display::Marker  = Display::Cross,
const casacore::Int  size = 5,
const casacore::Bool linear = false 
)

Draw a set of markers using the current color and a given pixel size.

If any points fail to convert, then those particular points are not marked. markertype is an Display::Marker. If linear is true, then the points are given in linear world canvas coordinates rather than true world coordinates.

casacore::Bool casa::WorldCanvas::drawPoint ( const casacore::Vector< casacore::Double > &  point,
const casacore::Bool linear = false 
)

Draw a single point using the current color.

If the conversion from world to pixel coordinates fails, the point is not drawn, and false is the return value. If linear is true, then the point position is given in linear world canvas coordinates, not true world coordinates.

casacore::Bool casa::WorldCanvas::drawPoints ( const casacore::Matrix< casacore::Double > &  points,
const casacore::Bool linear = false 
)

Draw a bunch of points using the current color.

If any points fail to convert then none of them are drawn, and false is returned. If linear is true, then the vertices are given in linear world canvas coordinates rather than real world coordinates.

casacore::Bool casa::WorldCanvas::drawPoints ( const casacore::Vector< casacore::Float > &  px,
const casacore::Vector< casacore::Float > &  py,
casacore::Bool  linear = false 
)

Draw a set of points using the current color.

Those points which fail to convert, or lie outside the WorldCanvas drawing area, are not drawn.

casacore::Bool casa::WorldCanvas::drawPolygon ( const casacore::Matrix< casacore::Double > &  vertices,
const casacore::Bool linear = false 
)

Draw a polygon (closed line, or line loop using the points) using the current color.

If any coordinates fail to convert then the polygon is not drawn. The end point is implicitly connected to the start point. If linear is true, then the provided vertices are actually linear world coordinates.

casacore::Bool casa::WorldCanvas::drawPolyline ( const casacore::Matrix< casacore::Double > &  vertices,
const casacore::Bool linear = false 
)

Draw a polyline (connected line) between the vertices using the current color.

If any coordinates fail to convert from world to pixel, then the entire polyline is not drawn and false is returned. The end point is not implicitly connected to the starting point. If linear is true, then the provided vertices are actually linear world canvas coordinates.

casacore::Bool casa::WorldCanvas::drawText ( const casacore::Vector< casacore::Double > &  point,
const casacore::String text,
Display::TextAlign  alignment = Display::AlignCenter,
const casacore::Bool linear = false 
)

Draw unrotated text at the given position.

If the conversion from world to pixel coordinates fails, the text is not drawn, and false is returned. If linear is true, then the provided position is actually in linear world canvas coordinates, rather than true world coordinates.

casacore::Bool casa::WorldCanvas::drawTextStrings ( const casacore::Vector< casacore::Float > &  px,
const casacore::Vector< casacore::Float > &  py,
const casacore::Vector< casacore::String > &  strings,
const casacore::Float  rotation = 0.0,
const casacore::Float  xoffset = 0.0,
const casacore::Float  yoffset = 0.0,
const casacore::Bool  linear = false 
)

Draw a set of text strings using the current color.

If any points fail to convert, then those particular strings are not drawn. rotation gives the rotation of the text in degrees counter-clockwise from horizontal. xoffset and yoffset can be given to globally shift the labels by the specified amounts (in units of the character height). If linear is true, then the vertices are given in linear world canvas coordinates rather than true world coordinates.

bool casa::WorldCanvas::drawVectorMap ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Complex > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
casacore::Float  angleConversionFactor,
casacore::Float  phasePolarity,
casacore::Bool  debias,
casacore::Float  variance,
casacore::Int  xPixelInc,
casacore::Int  yPixelInc,
casacore::Float  scale,
casacore::Bool  arrow,
casacore::Float  barb,
casacore::Float  rotation,
casacore::Double  xWorldInc,
casacore::Double  yWorldInc,
const casacore::Bool  usePixelEdges 
)

Draw a vector map.

bool casa::WorldCanvas::drawVectorMap ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
casacore::Float  angleConversionFactor,
casacore::Float  phasePolarity,
casacore::Bool  debias,
casacore::Float  variance,
casacore::Int  xPixelInc,
casacore::Int  yPixelInc,
casacore::Float  scale,
casacore::Bool  arrow,
casacore::Float  barb,
casacore::Float  rotation,
casacore::Double  xWorldInc,
casacore::Double  yWorldInc,
const casacore::Bool  usePixelEdges 
)
bool casa::WorldCanvas::drawVectorMap ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Float > &  amp,
const casacore::Matrix< casacore::Float > &  pa,
const casacore::Matrix< casacore::Bool > &  mask,
casacore::Float  angleConversionFactor,
casacore::Float  phasePolarity,
casacore::Bool  debias,
casacore::Float  variance,
casacore::Int  xPixelInc,
casacore::Int  yPixelInc,
casacore::Float  scale,
casacore::Bool  arrow,
casacore::Float  barb,
casacore::Float  rotation,
casacore::Double  xWorldInc,
casacore::Double  yWorldInc,
const casacore::Bool  usePixelEdges 
)
private

Actually draw the vector field.

All pa * angleConversionFactor must be radians. rotation must be radians. if amp is of dimension 0, amplitude unity is assumed. if mask if dimension 0 all data are assumed good.

void casa::WorldCanvas::endList ( )
std::string casa::WorldCanvas::errorMessage ( ) const
inline

Definition at line 1085 of file WorldCanvas.h.

References error_string.

casacore::Bool casa::WorldCanvas::existRestriction ( const casacore::String name) const

Check if a named restriction exists.

Referenced by casa::WorldCanvasHolder::existRestriction().

casacore::Bool casa::WorldCanvas::existsAttribute ( casacore::String name) const

Check if a certain Attribute exists.

void casa::WorldCanvas::flushComponentImages ( )

Flush the component images, ie.

compose a single image from the buffered channel images and place it on the WorldCanvas. This effectively is passed on to the PixelCanvas where the component images are cached.

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

User interface to get individual values from the attribute buffer.

casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Int newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Float newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Double newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Bool newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::String newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Vector< casacore::uInt > &  newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Vector< casacore::Int > &  newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Vector< casacore::Float > &  newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Vector< casacore::Double > &  newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Vector< casacore::Bool > &  newValue 
) const
casacore::Bool casa::WorldCanvas::getAttributeValue ( const casacore::String name,
casacore::Vector< casacore::String > &  newValue 
) const
ColorIndexedImage_* casa::WorldCanvas::getClearedColorIndexedImage ( void *  drawObj = 0)
private

Retrieve an indexed image to write onto.

Used (exclusively) by WC::drawImage(). If one exists in the cache under this objId key, clear it for reuse; otherwise return a new one. If a (non-zero) objId was provided, it will be cached under that key; removeIndexedImage() can be used to remove such cached images explicitly, but the cache is also frequently cleared automatically. If no caching is requested, however, (objId=0), the caller must delete the image himself when finished – that type of call is equivalent to 'new ColorIndexedImage_'.

virtual casacore::Record casa::WorldCanvas::getOptions ( ) const
virtual

Retrieve the current and default options and parameter types.

casacore::String casa::WorldCanvas::getWorldBackgroundColor ( )
inline

Definition at line 404 of file WorldCanvas.h.

References itsWorldBackgroundColor.

casacore::String casa::WorldCanvas::getWorldForegroundColor ( )
inline

Definition at line 407 of file WorldCanvas.h.

References itsWorldForegroundColor.

virtual void casa::WorldCanvas::handleEvent ( DisplayEvent ev)
virtual

Handle other, generic types of events.

As with call*Handlers above, WC handles these new events by simply distributing them to event handlers registered on it. However, rather than create any more handler lists in WorldCanvas, generic event handlers (DisplayEHs) piggyback on the RefreshEHList. WorldCanvas is also a DisplayEH, and all DisplayEHs implement handling of these new events by overriding the (null) base class version of this method.

Reimplemented from casa::DisplayEH.

casacore::Bool casa::WorldCanvas::hasCS ( ) const
inline

Definition at line 989 of file WorldCanvas.h.

References itsCoordinateSystem.

void casa::WorldCanvas::hold ( )

Hold and release response to refreshes requested with the refresh() member function.

Multiple calls to hold() can be made, and refreshes will not resume until the same number of calls have been made to release(). Note that these functions do not affect whether internally (implicitly) generated refreshes continue to occur. That is, refresh events due to PixelCanvas resize events, or Colormap changes, for example, will continue to be acted upon.

Display::ImageCacheStrategy casa::WorldCanvas::imageCacheStrategy ( ) const
casacore::Bool casa::WorldCanvas::inDrawArea ( casacore::Int  x,
casacore::Int  y 
) const
inline

Convenience functions returning whether a pixel coordinate is within bounds of the WC's inner draw area, the WC, or the underlying PC.

Definition at line 998 of file WorldCanvas.h.

References itsCanvasDrawXOffset, itsCanvasDrawXSize, itsCanvasDrawYOffset, itsCanvasDrawYSize, itsCanvasXOffset, and itsCanvasYOffset.

casacore::Bool casa::WorldCanvas::inPC ( casacore::Int  x,
casacore::Int  y 
)
casacore::Bool casa::WorldCanvas::inWC ( casacore::Int  x,
casacore::Int  y 
) const
inline

Definition at line 1006 of file WorldCanvas.h.

References itsCanvasXOffset, itsCanvasXSize, itsCanvasYOffset, and itsCanvasYSize.

casacore::Bool casa::WorldCanvas::isCSmaster ( const DisplayData dd) const
inline

Is the specified DisplayData the one in charge of WC state? (During DD::sizeControl() execution, it means instead that the DD has permission to become CSmaster, if it can).

Definition at line 1062 of file WorldCanvas.h.

References csMaster().

Referenced by casa::MSAsRaster::conformsToCS(), and casa::WorldCanvasHolder::isCSmaster().

casacore::Bool casa::WorldCanvas::linToPix ( casacore::Vector< casacore::Double > &  pix,
const casacore::Vector< casacore::Double > &  lin 
)
casacore::Bool casa::WorldCanvas::linToPix ( casacore::Matrix< casacore::Double > &  pix,
casacore::Vector< casacore::Bool > &  failures,
const casacore::Matrix< casacore::Double > &  lin 
)
casacore::Bool casa::WorldCanvas::linToWorld ( casacore::Vector< casacore::Double > &  world,
const casacore::Vector< casacore::Double > &  lin 
)
casacore::Bool casa::WorldCanvas::linToWorld ( casacore::Matrix< casacore::Double > &  world,
casacore::Vector< casacore::Bool > &  failures,
const casacore::Matrix< casacore::Double > &  lin 
)
casacore::Double casa::WorldCanvas::linXMax ( ) const
inline

Definition at line 871 of file WorldCanvas.h.

References itsLinXMax.

casacore::Double casa::WorldCanvas::linXMaxLimit ( ) const
inline

Definition at line 888 of file WorldCanvas.h.

References itsLinXMaxLimit.

casacore::Double casa::WorldCanvas::linXMin ( ) const
inline

Provide information on the extents of the linear coordinate system.

Definition at line 865 of file WorldCanvas.h.

References itsLinXMin.

casacore::Double casa::WorldCanvas::linXMinLimit ( ) const
inline

Provide information on the limits of the linear coordinate system.

Definition at line 882 of file WorldCanvas.h.

References itsLinXMinLimit.

casacore::Double casa::WorldCanvas::linYMax ( ) const
inline

Definition at line 874 of file WorldCanvas.h.

References itsLinYMax.

casacore::Double casa::WorldCanvas::linYMaxLimit ( ) const
inline

Definition at line 891 of file WorldCanvas.h.

References itsLinYMaxLimit.

casacore::Double casa::WorldCanvas::linYMin ( ) const
inline

Definition at line 868 of file WorldCanvas.h.

References itsLinYMin.

casacore::Double casa::WorldCanvas::linYMinLimit ( ) const
inline

Definition at line 885 of file WorldCanvas.h.

References itsLinYMinLimit.

ColorIndexedImage_* casa::WorldCanvas::makeColorIndexedImage ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Bool  usePixelEdges,
void *  drawObj 
)
private
casacore::Matrix<casacore::uInt> casa::WorldCanvas::mapToColor ( const casacore::Matrix< casacore::uInt > &  scaledImage)
private
casacore::Bool casa::WorldCanvas::mapToColorAndDrawEllipses ( const casacore::Matrix< casacore::Double > &  centres,
const casacore::Vector< casacore::Float > &  smajor,
const casacore::Vector< casacore::Float > &  sminor,
const casacore::Vector< casacore::Float > &  pangle,
const casacore::Vector< casacore::uInt scaledValues,
const casacore::Float scale,
const casacore::Bool outline,
const casacore::Bool linear 
)
private

Draw a set of ellipses where scaledValues gives the Colormap index of each point.

Point coordinates ('points') are either linear or world coordinates, as specified by 'linear'.

void casa::WorldCanvas::mapToColorAndDrawImage ( const casacore::Vector< casacore::Int > &  blc,
const casacore::Matrix< casacore::uInt > &  scaledImage 
)
private

Draw an image where scaledImage gives the Colormap index of each screen (PixelCanvas) pixel.

'blc' contains X and Y PixelCanvas coordinates. Masked version as well. For masked version, set opaqueMask to true to draw masked pixels in the background color; otherwise they will be transparent (letting whatever was drawn previously at that point show through).

void casa::WorldCanvas::mapToColorAndDrawImage ( const casacore::Vector< casacore::Int > &  blc,
const casacore::Matrix< casacore::uInt > &  scaledImage,
const casacore::Matrix< casacore::Bool > &  mask,
casacore::Bool  opaqueMask = false 
)
private
casacore::Bool casa::WorldCanvas::mapToColorAndDrawPoints ( const casacore::Matrix< casacore::Double > &  points,
const casacore::Vector< casacore::uInt > &  scaledValues,
const casacore::Bool linear = false 
)
private

Draw a set of points where scaledValues gives the Colormap index of each point.

Point coordinates ('points') are either linear or world coordinates, as specified by 'linear'.

casacore::Bool casa::WorldCanvas::matchesRestriction ( const Attribute restriction) const

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

Referenced by casa::WorldCanvasHolder::matchesRestriction().

casacore::Bool casa::WorldCanvas::matchesRestrictions ( const AttributeBuffer buffer) const
void casa::WorldCanvas::moveZoomRectangleLCS ( double  dx,
double  dy 
)

Move the zoom rectangle across the screen, ie.

pan.

casacore::uInt casa::WorldCanvas::newList ( )

Display list support functions.

A display list is started with a call to newList(), finished with a call to endList(), and drawn with a call to drawList(x), with the argument x being the list number returned by the original call to newList(). Lists can be deleted individually with deleteList(x) or in total with deleteLists(). Requests are forwarded to the PixelCanvas.

void casa::WorldCanvas::operator() ( const PCRefreshEvent pev)
virtual

Handle implicit refresh, motion and position events occuring on the PixelCanvas on which this WorldCanvas is installed.

These functions translate PixelCanvas events into WorldCanvas events.

Reimplemented from casa::PCRefreshEH.

void casa::WorldCanvas::operator() ( const PCMotionEvent eh)
virtual

Default just prints the event to cout.

Reimplemented from casa::PCMotionEH.

void casa::WorldCanvas::operator() ( const PCPositionEvent eh)
virtual

Default just prints the event to cout.

Reimplemented from casa::PCPositionEH.

virtual casacore::Int casa::WorldCanvas::pgid ( ) const
virtual

Return the PGPLOT device id for external use.

PixelCanvas* casa::WorldCanvas::pixelCanvas ( ) const
inline

Return a pointer to the PixelCanvas on which this WorldCanvas is installed.

Definition at line 223 of file WorldCanvas.h.

References itsPixelCanvas.

casacore::Bool casa::WorldCanvas::pixToLin ( casacore::Vector< casacore::Double > &  lin,
const casacore::Vector< casacore::Double > &  pix 
)

Pixel, linear and world coordinate transformation functions.

For the casacore::Vector versions, the coordinate mapping returns false if the transformation failed. For the casacore::Matrix versions, failures(i) on input should be set to true if the i'th transformation should not be attempted. On output, failures(i) is true if the transformation was not attempted, or failed. If on input the failures vector has zero length, it will be assumed that no prior failures have occurred.

casacore::Bool casa::WorldCanvas::pixToLin ( casacore::Matrix< casacore::Double > &  lin,
casacore::Vector< casacore::Bool > &  failures,
const casacore::Matrix< casacore::Double > &  pix 
)
casacore::Bool casa::WorldCanvas::pixToWorld ( casacore::Vector< casacore::Double > &  world,
const casacore::Vector< casacore::Double > &  pix 
)
casacore::Bool casa::WorldCanvas::pixToWorld ( casacore::Matrix< casacore::Double > &  world,
casacore::Vector< casacore::Bool > &  failures,
const casacore::Matrix< casacore::Double > &  pix 
)
casacore::Bool casa::WorldCanvas::redrawIndexedImage ( void *  drawObj,
Display::RefreshReason  reason,
casacore::Bool  opaqueMask = false 
)

Optimization to speed up colormap fiddling in 24bit mode (software Colormap); see images_, below for usage.

Set opaqueMask to true to draw masked pixels in the background color; otherwise they will be transparent (letting whatever was drawn previously at that point show through).

void casa::WorldCanvas::refresh ( const Display::RefreshReason reason = Display::UserCommand,
const casacore::Bool explicitrequest = true 
)

Refresh the WorldCanvas for the given reason.

The refresh is prevented from occuring if the PixelCanvas is not yet mapped to the screen, or if the refreshes have been held with earlier call/s to hold() which has/have not been matched with the same number of calls to release().

casacore::Bool casa::WorldCanvas::refreshAllowed ( )

Is a refresh currently allowed?

void casa::WorldCanvas::registerColormap ( Colormap cmap,
casacore::Float  weight = 1.0 
)

Register/unregister a Colormap on the PixelCanvas.

Registration counts are remembered, so that a particular Colormap is guaranteed to be available as long as that Colormap has been registered more times than it has been unregistered. Requests are forwarded to the PixelCanvas.

void casa::WorldCanvas::registerColormap ( Colormap cmap,
Colormap cmapToReplace 
)
void casa::WorldCanvas::release ( )
virtual void casa::WorldCanvas::releasePGPLOTdevice ( )
virtual
void casa::WorldCanvas::removeAttribute ( casacore::String name)

Remove an Attribute.

Pre-defined Attributes of the WorldCanvas cannot be removed (although nothing serious will happen if you try).

bool casa::WorldCanvas::removeDD ( const DisplayData dd)
inline

Definition at line 1066 of file WorldCanvas.h.

References csMaster(), and itsCSmaster.

casacore::Bool casa::WorldCanvas::removeIndexedImage ( void *  drawObj)

Remove image from the colormap change cache, if any (see images_, below).

Return value indicates whether there was anything to remove.

void casa::WorldCanvas::removeMotionEventHandler ( const WCMotionEH eh)
void casa::WorldCanvas::removePositionEventHandler ( const WCPositionEH eh)
void casa::WorldCanvas::removeRefreshEventHandler ( const DisplayEH eh)

Remove the given refresh, motion and position event handlers from the WorldCanvas.

void casa::WorldCanvas::removeRestriction ( const casacore::String restrictionName)

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

Referenced by casa::WorldCanvasHolder::removeRestriction().

void casa::WorldCanvas::removeRestrictions ( )
void casa::WorldCanvas::resetZoomRectangle ( )

Reset the zoom to show the entire allowable range of the linear coordinate system.

const AttributeBuffer* casa::WorldCanvas::restrictionBuffer ( ) const

Return the buffer of restrictions installed on this WorldCanvas.

Referenced by casa::DisplayData::conformsToZIndex(), and casa::WorldCanvasHolder::restrictionBuffer().

void casa::WorldCanvas::setArcMode ( Display::ArcMode  mode)
void casa::WorldCanvas::setAttribute ( Attribute at)

Set an Attribute or Attributes on the WorldCanvas.

void casa::WorldCanvas::setAttributes ( AttributeBuffer at)
void casa::WorldCanvas::setBackground ( casacore::uLong  color)
void casa::WorldCanvas::setCapStyle ( Display::CapStyle  style)
void casa::WorldCanvas::setClearColor ( const casacore::String color)
void casa::WorldCanvas::setColor ( const casacore::String color)

Set various graphics attributes.

All of these requests are passed directly to the PixelCanvas, except for setColor, which also installs the requested color for subsequent calls to PgPlot functions.

void casa::WorldCanvas::setColormap ( Colormap cmap)

Set and retrieve the current Colormap on the PixelCanvas.

This function must be called prior to using a WorldCanvas (or PixelCanvas) drawing routines which is expected to use a Colormap. Passing an unregistered Colormap to setColormap will result in an exception being thrown. Requests are forwarded to the PixelCanvas.

void casa::WorldCanvas::setComplexToRealMethod ( const Display::ComplexToRealMethod  method)
inline

Definition at line 974 of file WorldCanvas.h.

References itsComplexToRealMethod.

void casa::WorldCanvas::setCoordinateHandler ( WCCoordinateHandler ch)

Set casacore::Coordinate, SizeControl, Resample and DataScale handlers for the WorldCanvas.

If the given handler is 0, then resort to using the default handler.

void casa::WorldCanvas::setCoordinateSystem ( const DisplayCoordinateSystem csys)

Set and retrieve the DisplayCoordinateSystem of this WorldCanvas.

Set with 0 and the WorldCanvas loses its DisplayCoordinateSystem!

void casa::WorldCanvas::setDataMax ( casacore::Double  max)
inline

Definition at line 958 of file WorldCanvas.h.

References itsDataMax, and max.

void casa::WorldCanvas::setDataMin ( casacore::Double  min)
inline

Definition at line 952 of file WorldCanvas.h.

References itsDataMin, and min.

void casa::WorldCanvas::setDataMinMax ( casacore::Double  min,
casacore::Double  max 
)
inline

Definition at line 961 of file WorldCanvas.h.

References itsDataMax, itsDataMin, max, and min.

void casa::WorldCanvas::setDataScaleHandler ( WCDataScaleHandler sh)
virtual void casa::WorldCanvas::setDefaultOptions ( )
virtual

Install the default options for this DisplayData.

virtual void casa::WorldCanvas::setDrawBuffer ( Display::DrawBuffer  buf)
virtual

Set/retrieve the drawing buffer, the target destination for graphics.

Requests are passed directly to the PixelCanvas.

void casa::WorldCanvas::setFillRule ( Display::FillRule  rule)
void casa::WorldCanvas::setFillStyle ( Display::FillStyle  style)
casacore::Bool casa::WorldCanvas::setFont ( const casacore::String fontName)
void casa::WorldCanvas::setForeground ( casacore::uLong  color)
void casa::WorldCanvas::setImageCacheStrategy ( Display::ImageCacheStrategy  strategy)

Set/retrieve the caching strategy on the PixelCanvas.

Appropriate values are Display::ClientAlways (use client memory to cache images [safer]), Display::ServerAlways (use server memory to cache images [faster]), and Display::ServerMemoryThreshold (use server memory until a threshold is reached [not yet implemented]). Requests are passed to the PixelCanvas.

void casa::WorldCanvas::setJoinStyle ( Display::JoinStyle  style)
void casa::WorldCanvas::setLinearCoordinateSystem ( const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
casacore::Bool  resetZoom = true 
)

Set the allowable range of the linear coordinate system.

void casa::WorldCanvas::setLineStyle ( Display::LineStyle  style)
void casa::WorldCanvas::setLineWidth ( casacore::Float  width)
virtual casacore::Bool casa::WorldCanvas::setOptions ( const casacore::Record rec,
casacore::Record updatedOptions 
)
virtual

Apply options stored in rec to the DisplayData; return value true means a refresh is needed.

Any fields added to the updatedOptions argument are options which have changed in some way due to the setting of other options - ie. they are context sensitive.

void casa::WorldCanvas::setResampleHandler ( WCResampleHandler rh)
void casa::WorldCanvas::setRestriction ( const Attribute restriction)

Install a single restriction, or a buffer of restrictions, on the WorldCanvas which DisplayData must match in order that they be allowed to draw themselves.

Referenced by casa::WorldCanvasHolder::setRestriction().

void casa::WorldCanvas::setRestrictions ( const AttributeBuffer resBuff)
void casa::WorldCanvas::setSizeControlHandler ( WCSizeControlHandler sh)
casacore::Bool casa::WorldCanvas::setWorldBackgroundColor ( const casacore::String  color)

Set/retrieve the background and foreground colors of the WorldCanvas.

These can be different to those for the PixelCanvas. Indeed, they will be used as default colors on the WorldCanvas when necessary.

void casa::WorldCanvas::setWorldCanvasPosition ( casacore::Double  fracXOffset,
casacore::Double  fracYOffset,
casacore::Double  fracXSize,
casacore::Double  fracYSize 
)

Set the location of the WorldCanvas on its PixelCanvas.

casacore::Bool casa::WorldCanvas::setWorldForegroundColor ( const casacore::String  color)
void casa::WorldCanvas::setZoomRectangleLCS ( const casacore::Vector< casacore::Double > &  min,
const casacore::Vector< casacore::Double > &  max 
)

Set the zoom rectangle to the specfied linear coordinate range.

void casa::WorldCanvas::swapBuffers ( )
void casa::WorldCanvas::trimAndResampleImage ( casacore::Vector< casacore::Double > &  drawBlc,
casacore::Vector< casacore::Double > &  drawTrc,
casacore::Matrix< casacore::Float > &  sampledImage,
const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Bool usePixelEdges = false 
)
private

Trim and resample an image, returning the actual world BLC and TRC for drawing, and the resampled image.

void casa::WorldCanvas::trimAndResampleImage ( casacore::Vector< casacore::Double > &  drawBlc,
casacore::Vector< casacore::Double > &  drawTrc,
casacore::Matrix< casacore::Float > &  sampledImage,
casacore::Matrix< casacore::Bool > &  resampledMask,
const casacore::Vector< casacore::Double > &  blc,
const casacore::Vector< casacore::Double > &  trc,
const casacore::Matrix< casacore::Float > &  data,
const casacore::Matrix< casacore::Bool > &  mask,
const casacore::Bool usePixelEdges = false 
)
private

Trim and resample an image, returning the actual world BLC and TRC for drawing, and the resampled image.

This function takes a mask indicating which pixels should be drawn. This function therefore also trims and resamples the mask.

void casa::WorldCanvas::unregisterColormap ( Colormap cmap)
void casa::WorldCanvas::updateCanvasSizesOffsets ( )
private

Update canvas sizes/offsets from the fracOffsets, and vice versa.

void casa::WorldCanvas::updateFracSizesOffsets ( )
private
casacore::Bool casa::WorldCanvas::validList ( casacore::uInt  list)
virtual casacore::Vector<casacore::String> casa::WorldCanvas::worldAxisNames ( ) const
virtual

Return the names and units of the world coordinate axes.

virtual casacore::Vector<casacore::String> casa::WorldCanvas::worldAxisUnits ( ) const
virtual
casacore::Bool casa::WorldCanvas::worldToLin ( casacore::Vector< casacore::Double > &  lin,
const casacore::Vector< casacore::Double > &  world 
)
casacore::Bool casa::WorldCanvas::worldToLin ( casacore::Matrix< casacore::Double > &  lin,
casacore::Vector< casacore::Bool > &  failures,
const casacore::Matrix< casacore::Double > &  world 
)
casacore::Bool casa::WorldCanvas::worldToPix ( casacore::Vector< casacore::Double > &  pix,
const casacore::Vector< casacore::Double > &  world 
)
casacore::Bool casa::WorldCanvas::worldToPix ( casacore::Matrix< casacore::Double > &  pix,
casacore::Vector< casacore::Bool > &  failures,
const casacore::Matrix< casacore::Double > &  world 
)
int casa::WorldCanvas::zIndex ( ) const

convienience function based on "restriction buffer"...

Member Data Documentation

AttributeBuffer casa::WorldCanvas::attributes
private

Buffer for Attributes.

Definition at line 1293 of file WorldCanvas.h.

const casacore::String casa::WorldCanvas::BOTTOM_MARGIN_SPACE_PG
static

Definition at line 1082 of file WorldCanvas.h.

std::string casa::WorldCanvas::error_string
private

Definition at line 1410 of file WorldCanvas.h.

Referenced by errorMessage().

std::map<void*, ColorIndexedImage_*> casa::WorldCanvas::images_
private

Cache of pre-drawn ColorIndexedImage_'s.

When a caller of drawImage() wants to save one, it passes a drawing-object pointer in the 'drawObj' parameter for use as a retrieval key. It should provide the same key to redrawIndexedImage() in order to reuse the image.

Definition at line 1372 of file WorldCanvas.h.

casacore::uInt casa::WorldCanvas::itsCanvasDrawXOffset
private

***Cached*** blc pixel where the world canvas 'draw area' (inside margins, labels) begins, relative to WC blc.

Definition at line 1236 of file WorldCanvas.h.

Referenced by canvasDrawXOffset(), and inDrawArea().

casacore::uInt casa::WorldCanvas::itsCanvasDrawXSize
private

***Cached*** number of pixels in each dimension given to the drawable part of the world canvas

Definition at line 1243 of file WorldCanvas.h.

Referenced by canvasDrawXSize(), and inDrawArea().

casacore::uInt casa::WorldCanvas::itsCanvasDrawYOffset
private

Definition at line 1237 of file WorldCanvas.h.

Referenced by canvasDrawYOffset(), and inDrawArea().

casacore::uInt casa::WorldCanvas::itsCanvasDrawYSize
private

Definition at line 1244 of file WorldCanvas.h.

Referenced by canvasDrawYSize(), and inDrawArea().

casacore::uInt casa::WorldCanvas::itsCanvasXOffset
private

***Cached*** blc pixel where this world canvas begins = itsPixelCanvas->width()*frac(X|Y)Offset_.

Definition at line 1212 of file WorldCanvas.h.

Referenced by canvasXOffset(), inDrawArea(), and inWC().

casacore::uInt casa::WorldCanvas::itsCanvasXSize
private

***Cached*** number of pixels in each dimension given to the world canvas = itsPixelCanvas->width()*(frac(X|Y)Size_.

Definition at line 1219 of file WorldCanvas.h.

Referenced by canvasXSize(), and inWC().

casacore::uInt casa::WorldCanvas::itsCanvasYOffset
private

Definition at line 1213 of file WorldCanvas.h.

Referenced by canvasYOffset(), inDrawArea(), and inWC().

casacore::uInt casa::WorldCanvas::itsCanvasYSize
private

Definition at line 1220 of file WorldCanvas.h.

Referenced by canvasYSize(), and inWC().

Display::ComplexToRealMethod casa::WorldCanvas::itsComplexToRealMethod
private

Method to use to convert complex data into real values.

Definition at line 1267 of file WorldCanvas.h.

Referenced by complexToRealMethod(), and setComplexToRealMethod().

WCCoordinateHandler* casa::WorldCanvas::itsCoordinateHandler
private

Definition at line 1279 of file WorldCanvas.h.

DisplayCoordinateSystem* casa::WorldCanvas::itsCoordinateSystem
private

The DisplayCoordinateSystem for this WorldCanvas.

New addition, only supported and used by "new" classes.

Definition at line 1312 of file WorldCanvas.h.

Referenced by hasCS().

DisplayData* casa::WorldCanvas::itsCSmaster
private

[First] responder to 'sizeControl', responsible for setting WC CS, zoom window and draw area.

It will be 0 initially, and whenever the old master is unregistered (until a new master responds). This is a further attempt toward a coherent sense of 'who's in charge' of WC[H] state (there is more to do).

Some day, the WC CS should be directly responsible for all the Canvas's coordinate conversions. For now at least we'll know that they're done by the DD below (which should be equivalent).

Definition at line 1398 of file WorldCanvas.h.

Referenced by csMaster(), and removeDD().

casacore::Double casa::WorldCanvas::itsDataMax
private

Definition at line 1264 of file WorldCanvas.h.

Referenced by dataMax(), setDataMax(), and setDataMinMax().

casacore::Double casa::WorldCanvas::itsDataMin
private

Dynamic data minimum and maximum for this WorldCanvas.

Definition at line 1264 of file WorldCanvas.h.

Referenced by dataMin(), setDataMin(), and setDataMinMax().

WCDataScaleHandler* casa::WorldCanvas::itsDataScaleHandler
private

Definition at line 1281 of file WorldCanvas.h.

casacore::Double casa::WorldCanvas::itsFracXOffset
private

Fractional position of world canvas on pixel canvas.

The offset values are always in the range of [0.0,1.0], and sizes must be smaller or equal to (1.0 - offset) for each dimension.

Definition at line 1227 of file WorldCanvas.h.

casacore::Double casa::WorldCanvas::itsFracXSize
private

Definition at line 1229 of file WorldCanvas.h.

casacore::Double casa::WorldCanvas::itsFracYOffset
private

Definition at line 1228 of file WorldCanvas.h.

casacore::Double casa::WorldCanvas::itsFracYSize
private

Definition at line 1230 of file WorldCanvas.h.

casacore::Bool casa::WorldCanvas::itsGrabbing
private

This state is set true when the pointer is in this WC and a pointer button is pressed (with no buttons pressed previously).

When true, all PC motion and pointer button events are propagated to this WC's handlers (only), regardless of whether the pointer has moved off the WC. It is reset to false when all buttons are released. This simulates the 'automatic grab' (implemented in X for whole windows), on the WC level.

Definition at line 1321 of file WorldCanvas.h.

Display::RefreshReason casa::WorldCanvas::itsHeldReason
private

Definition at line 1308 of file WorldCanvas.h.

casacore::Int casa::WorldCanvas::itsHoldCount
private

Status of hold/release.

Definition at line 1306 of file WorldCanvas.h.

casacore::uInt casa::WorldCanvas::itsId
private

itsId & itsRef used to ensure thread-safe execution of pgplot

Definition at line 1402 of file WorldCanvas.h.

casacore::Double casa::WorldCanvas::itsLinXMax
private

Definition at line 1251 of file WorldCanvas.h.

Referenced by linXMax().

casacore::Double casa::WorldCanvas::itsLinXMaxLimit
private

Definition at line 1259 of file WorldCanvas.h.

Referenced by linXMaxLimit().

casacore::Double casa::WorldCanvas::itsLinXMin
private

Linear casacore::Coordinate System ranges.

Definition at line 1249 of file WorldCanvas.h.

Referenced by linXMin().

casacore::Double casa::WorldCanvas::itsLinXMinLimit
private

Linear casacore::Coordinate System Limits.

Definition at line 1257 of file WorldCanvas.h.

Referenced by linXMinLimit().

casacore::Double casa::WorldCanvas::itsLinYMax
private

Definition at line 1252 of file WorldCanvas.h.

Referenced by linYMax().

casacore::Double casa::WorldCanvas::itsLinYMaxLimit
private

Definition at line 1260 of file WorldCanvas.h.

Referenced by linYMaxLimit().

casacore::Double casa::WorldCanvas::itsLinYMin
private

Definition at line 1250 of file WorldCanvas.h.

Referenced by linYMin().

casacore::Double casa::WorldCanvas::itsLinYMinLimit
private

Definition at line 1258 of file WorldCanvas.h.

Referenced by linYMinLimit().

std::list<WCMotionEH *> casa::WorldCanvas::itsMotionEHList
private

Definition at line 1273 of file WorldCanvas.h.

casacore::Bool casa::WorldCanvas::itsOwnCoordinateHandler
private

Definition at line 1287 of file WorldCanvas.h.

casacore::Bool casa::WorldCanvas::itsOwnDataScaleHandler
private

Definition at line 1289 of file WorldCanvas.h.

casacore::Bool casa::WorldCanvas::itsOwnResampleHandler
private

Definition at line 1288 of file WorldCanvas.h.

casacore::Bool casa::WorldCanvas::itsOwnSizeControlHandler
private

Store whether we "own" the various handlers.

Definition at line 1286 of file WorldCanvas.h.

WCPGFilter* casa::WorldCanvas::itsPGFilter
private

PGPLOT filter.

Definition at line 1303 of file WorldCanvas.h.

PixelCanvas* casa::WorldCanvas::itsPixelCanvas
private

PixelCanvas pointer.

Definition at line 1300 of file WorldCanvas.h.

Referenced by pixelCanvas().

std::list<WCPositionEH *> casa::WorldCanvas::itsPositionEHList
private

Definition at line 1272 of file WorldCanvas.h.

casacore::uInt casa::WorldCanvas::itsRef
private

WorldCanvas::refresh is a recursive function.

itsRef is used to determine when the recursion is over. i.e, when the initial refresh call is exiting

Definition at line 1408 of file WorldCanvas.h.

std::list<DisplayEH *> casa::WorldCanvas::itsRefreshEHList
private

Event handler lists and convenient iterators.

Definition at line 1271 of file WorldCanvas.h.

casacore::Bool casa::WorldCanvas::itsRefreshHeld
private

Definition at line 1307 of file WorldCanvas.h.

WCResampleHandler* casa::WorldCanvas::itsResampleHandler
private

Definition at line 1280 of file WorldCanvas.h.

AttributeBuffer casa::WorldCanvas::itsRestrictions
private

A buffer to contain the restrictions that DisplayDatas must match if they are to be allowed to draw themselves.

Definition at line 1386 of file WorldCanvas.h.

WCSizeControlHandler* casa::WorldCanvas::itsSizeControlHandler
private

Other handler lists.

Definition at line 1278 of file WorldCanvas.h.

casacore::String casa::WorldCanvas::itsWorldBackgroundColor
private

Background/foreground colors.

Definition at line 1296 of file WorldCanvas.h.

Referenced by getWorldBackgroundColor().

casacore::String casa::WorldCanvas::itsWorldForegroundColor
private

Definition at line 1297 of file WorldCanvas.h.

Referenced by getWorldForegroundColor().

const casacore::String casa::WorldCanvas::LEFT_MARGIN_SPACE_PG
static

Definition at line 1080 of file WorldCanvas.h.

const casacore::String casa::WorldCanvas::RIGHT_MARGIN_SPACE_PG
static

Definition at line 1081 of file WorldCanvas.h.

const casacore::String casa::WorldCanvas::TOP_MARGIN_SPACE_PG
static

Definition at line 1083 of file WorldCanvas.h.


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