casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WorldCanvas.h
Go to the documentation of this file.
1 //# WorldCanvas.h: class for drawing in world coordinates on the PixelCanvas
2 //# Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_WORLDCANVAS_H
29 #define TRIALDISPLAY_WORLDCANVAS_H
30 
31 #include <list>
32 #include <casa/aips.h>
33 #include <casa/Arrays/Matrix.h>
34 #include <casa/Arrays/Vector.h>
46 
47 namespace casa { //# NAMESPACE CASA - BEGIN
48 
49  class PixelCanvas;
50  class Colormap;
51  class WCCoordinateHandler;
52  class WCSizeControlHandler;
53  class WCResampleHandler;
54  class WCDataScaleHandler;
55  class WCPGFilter;
56  class DisplayCoordinateSystem;
57  class DisplayData;
58 
59 // <summary>
60 // Implementation of drawing in world coordinates on top of a PixelCanvas.
61 // </summary>
62 //
63 // <prerequisite>
64 // <li> <linkto class="PixelCanvas">PixelCanvas</linkto>
65 // <li> <linkto class="Attribute">Attribute</linkto>
66 // <li> <linkto class="AttributeBuffer">AttributeBuffer</linkto>
67 // </prerequisite>
68 //
69 // <etymology>
70 // WorldCanvas is a canvas on which primitives specified in world
71 // coordinates are drawn.
72 // </etymology>
73 //
74 // <synopsis>
75 
76 // The world canvas manages a portion of a <linkto
77 // class="PixelCanvas">PixelCanvas</linkto> and provides mechanisms to
78 // allow the user to draw images and vectors in world coordinates.
79 // The position of the WorldCanvas may be dynamically changed.
80 //
81 // The WorldCanvas vector graphics commands assume world coordinates
82 // are specified and use a registered coordinate handler to map those
83 // coordinates via a linear system to pixel coordinates. The pixel
84 // coordinates are then sent on to the <linkto
85 // class="PixelCanvas">PixelCanvas</linkto> where they are plotted.
86 //
87 // Images are drawn by sending a casacore::Matrix and specifying the
88 // world-coordinate location of the center of the lower-left pixel.
89 // If the dataMin and dataMax values have been set, they will be used
90 // to scale the data, otherwise the min and max will be scanned.
91 //
92 // Customizable tools associated with the WorldCanvas
93 // available to assist with various aspects of display.
94 // <ul>
95 // <li> fitting specified regions of an image to a screen pixel array
96 // (<linkto class="WCResampleHandler">WCResampleHandler</linkto>
97 // <li> scaling real-world values to integers in preparation for conversion to
98 // color indices.
99 // (<linkto class="WCDataScaleHandler">WCDataScaleHandler</linkto>
100 // <li> controlling the size of the <linkto class="WorldCanvas">WorldCanvas</linkto> prior
101 // to drawing.
102 // (<linkto class="WCSizeControlHandler">WCSizeControlHandler</linkto>)
103 // <li> Performing the transformation from WorldCoordinates to LinearCoordinates
104 // (<linkto class="WCCoordinateHandler">WCCoordinateHandler</linkto>)
105 // </ul>
106 //
107 // The interface for these tools are implemented as abstract base
108 // classes, and the tools are implemented by deriving from these
109 // classes and overriding the functions contained therein.
110 //
111 // The WorldCanvas provides an interface to the <linkto
112 // class="PixelCanvas">PixelCanvas</linkto> caching mechanism. Clever
113 // use of caching and parsing of the reason field of a <linkto
114 // class="WCRefreshEvent">WCRefreshEvent</linkto> can reduce
115 // unnecessary recomputation needed for refreshing the screen.
116 //
117 // The WorldCanvas maintains a set of <linkto
118 // class="Attribute">Attribute</linkto>s which the user can set on the
119 // WorldCanvas. An Attribute is a combination of a name and a value,
120 // the value can be of type casacore::uInt, casacore::Int, casacore::Float, casacore::Double, casacore::Bool and casacore::String,
121 // and Vectors of these. These Attributes serve two purposes: 1) to
122 // allow to place (using the member functions <src>setAttribute</src>
123 // and <src> setAttributes</src>) more or less arbitrary information
124 // on the WorldCanvas that other classes can read from the
125 // WorldCanvas. Since the name of an Attribute can be defined at run
126 // time, any name can be used (i.e. there is no pre-defined set of
127 // names that can only be used), and 2) to have a generic interface to
128 // some of the internal variables of the WorldCanvas. Some internal
129 // variabels can be set/read with their own interface routine
130 // (e.g. linXMin and friends using setZoomRectangleLCS), but they can
131 // also be modified/read using the Attribute interface (using
132 // getAttributeValue). The use of e.g. SetZoomRectangleLCS() and
133 // setAttribute() is equivalent. See <linkto
134 // class="AttributeBuffer">AttributeBuffer</linkto> for more details.
135 // The following Attributes (and their types) are pre-defined on the
136 // WorldCanvas and can be accessed using the Attribute interface
137 // (note: these Attributes cannot be deleted using removeAttribute()):
138 // <ul> <li> canvasXOffset (casacore::uInt): The offset of the WorldCanvas on
139 // the PixelCanvas (X) in 'screen pixels' <li> canvasYOffset (casacore::uInt):
140 // The offset of the WorldCanvas on the PixelCanvas (Y) in 'screen
141 // pixels' <li> canvasYSize (casacore::uInt): The size of the WorldCanvas on the
142 // PixelCanvas (X) in 'screen pixels' <li> canvasYSize (casacore::uInt): The
143 // size of the WorldCanvas on the PixelCanvas (Y) in 'screen pixels'
144 // <li> fracXOffset (casacore::Double): The fractional offset of the WorldCanvas
145 // on the Pixelcanvas (X) <li> fracYOffset (casacore::Double): The fractional
146 // offset of the WorldCanvas on the Pixelcanvas (Y) <li> fracXSize
147 // (casacore::Double): The fractional size of the WorldCanvas on the Pixelcanvas
148 // (X) <li> fracYSize (casacore::Double): The fractional size of the WorldCanvas
149 // on the Pixelcanvas (Y) <li> linXMin (casacore::Double): The current minimum
150 // linear coordinate (X) <li> linXMax (casacore::Double): The current maximum
151 // linear coordinate (X) <li> linYMin (casacore::Double): The current minimum
152 // linear coordinate (Y) <li> linYMax (casacore::Double): The current maximum
153 // linear coordinate (Y) <li> linXMinLimit (casacore::Double): The current limit
154 // on the minimum linear coordinate (X) <li> linXMaxLimit (casacore::Double):
155 // The current limit on the maximum linear coordinate (X) <li>
156 // linYMinLimit (casacore::Double): The current limit on the minimum linear
157 // coordinate (Y) <li> linYMaxLimit (casacore::Double): The current limit on the
158 // maximum linear coordinate (Y) <li> dataMin (casacore::Double): The data
159 // minimum of the WorldCanvas <li> dataMax (casacore::Double): The data maximum
160 // of the WorldCanvas </ul>
161 //
162 // The WorldCanvas knows three coordinate systems.
163 // <ul>
164 // <li> the Pixel coordinate system. This corresponds to the pixels in the
165 // PixelCanvas (and usually will correspond to pixels on the screen)
166 // <li> a Linear Coordinates system. This has to be set by the user of a
167 // WorldCanvas (like the WorldCanvasHolder). Normally this will correspond to
168 // the pixel coordinates of the data array that is displayed, but it is up to
169 // you to define this. The linear coordinate system is the input for the
170 // coordinate transformation to world coordinates using a
171 // WCCoordinateHandler. For example, a position event on the PixelCanvas has
172 // first its pixel coordinates converted to the linear coodinates and then
173 // these linear coordinates are converted to world coordinates. Zooming is
174 // defined by setting the linear coordinates to the area to which you want to
175 // zoom in to (although the zoom area can also be set using world coordinates,
176 // but these world coordinates are converted to linear coordinates
177 // internally).
178 // <li> a WorldCoordinate system. This is defined by the WCCoordinateHandler
179 // installed on the WorldCanvas. Normally this will map to the Aips++
180 // coordinate system that belongs to the data displayed, but this is not a
181 // requirement. You can define whatever coordiante system you want, as long
182 // as you satisfy the interface (mainly that you use the linear coordinates of
183 // the WorldCanvas as input to get to you World coordinates).
184 // </ul>
185 // </synopsis>
186 //
187 // <motivation>
188 // Wanted a world-coordinate plotting canvas
189 // </motivation>
190 //
191 // <example>
192 // See the test programs in Display/test
193 // </example>
194 //
195 // <todo>
196 // <li> Implement contour drawing in world coordinates.
197 // <li> Fix clear to work correctly in multiple-WC contexts
198 // <li> complete value-tagged primitive rendering
199 // <li> figure out what to do with zooming
200 // <li> stream functions
201 // <li> drawImage function(s)
202 // </todo>
203 
204  class WorldCanvas : public PCRefreshEH,
205  public PCMotionEH,
206  public PCPositionEH,
207  public DisplayEH,
208  public DisplayOptions {
209 
210  public:
211 
212  // Construct a WorldCanvas on the given PixelCanvas, at the given
213  // origin (in fractions of the PixelCanvas extent), and having the
214  // given size (in the same units).
215  WorldCanvas(PixelCanvas *pc, casacore::Double xOrigin = 0.0, casacore::Double yOrigin = 0.0,
216  casacore::Double xSize = 1.0, casacore::Double ySize = 1.0);
217 
218  // Destructor.
219  virtual ~WorldCanvas();
220 
221  // Return a pointer to the PixelCanvas on which this WorldCanvas is
222  // installed.
224  return itsPixelCanvas;
225  }
226 
227  // Add the given refresh, motion and position event handlers to the
228  // WorldCanvas.
229  // <group>
233  // </group>
234 
235  // Remove the given refresh, motion and position event handlers from
236  // the WorldCanvas.
237  // <group>
238  void removeRefreshEventHandler(const DisplayEH &eh);
239  void removeMotionEventHandler(const WCMotionEH &eh);
241  // </group>
242 
243  // Call all of the motion and position event handlers that
244  // are installed on the WorldCanvas.
245  //# (Similar method for refresh handlers has been made private;
246  //# the public method for that is refresh(). dk 4/05)
247  // <group>
248  void callMotionEventHandlers(const WCMotionEvent &ev);
250  // </group>
251 
252  // Handle other, generic types of events. As with call*Handlers above,
253  // WC handles these new events by simply distributing them to
254  // event handlers registered on it. However, rather than create
255  // any more handler lists in WorldCanvas, generic event handlers
256  // (DisplayEHs) piggyback on the RefreshEHList. WorldCanvas is
257  // also a DisplayEH, and all DisplayEHs implement handling of these
258  // new events by overriding the (null) base class version
259  // of this method.
260  virtual void handleEvent(DisplayEvent& ev);
261 
262  // Handle implicit refresh, motion and position events occuring on
263  // the PixelCanvas on which this WorldCanvas is installed. These
264  // functions translate PixelCanvas events into WorldCanvas events.
265  // <group>
266  void operator()(const PCRefreshEvent &pev);
267  void operator()(const PCMotionEvent &pev);
268  void operator()(const PCPositionEvent &pev);
269  // </group>
270 
271  // Refresh the WorldCanvas for the given reason. The refresh is
272  // prevented from occuring if the PixelCanvas is not yet mapped to
273  // the screen, or if the refreshes have been held with earlier
274  // call/s to hold() which has/have not been matched with the same
275  // number of calls to release().
277  const casacore::Bool &explicitrequest = true);
278 
279  // Is a refresh currently allowed?
281 
282  // Hold and release response to refreshes requested with the
283  // <src>refresh()</src> member function. Multiple calls to
284  // <src>hold()</src> can be made, and refreshes will not resume
285  // until the same number of calls have been made to
286  // <src>release()</src>. Note that these functions do not affect
287  // whether internally (implicitly) generated refreshes continue to
288  // occur. That is, refresh events due to PixelCanvas resize events,
289  // or Colormap changes, for example, will continue to be acted upon.
290  // <group>
291  void hold();
292  void release();
293  // </group>
294 
295  // Set casacore::Coordinate, SizeControl, Resample and DataScale handlers for
296  // the WorldCanvas. If the given handler is 0, then resort to using
297  // the default handler.
298  // <group>
303  // </group>
304 
305  // Set the location of the WorldCanvas on its PixelCanvas.
306  void setWorldCanvasPosition(casacore::Double fracXOffset, casacore::Double fracYOffset,
307  casacore::Double fracXSize, casacore::Double fracYSize);
308 
309  // Pixel, linear and world coordinate transformation functions. For
310  // the casacore::Vector versions, the coordinate mapping returns false if the
311  // transformation failed. For the casacore::Matrix versions, failures(i) on
312  // input should be set to true if the i'th transformation should not
313  // be attempted. On output, failures(i) is true if the
314  // transformation was not attempted, or failed. If on input the
315  // failures vector has zero length, it will be assumed that no prior
316  // failures have occurred.
317  // <group>
336  // </group>
337 
338  // Register/unregister a Colormap on the PixelCanvas. Registration
339  // counts are remembered, so that a particular Colormap is
340  // guaranteed to be available as long as that Colormap has been
341  // registered more times than it has been unregistered. Requests
342  // are forwarded to the PixelCanvas.
343  // <group>
344  void registerColormap(Colormap *cmap, casacore::Float weight = 1.0);
345  void registerColormap(Colormap *cmap, Colormap *cmapToReplace) ;
346  void unregisterColormap(Colormap *cmap);
347  // </group>
348 
349  // Set and retrieve the current Colormap on the PixelCanvas. This
350  // function must be called prior to using a WorldCanvas (or
351  // PixelCanvas) drawing routines which is expected to use a
352  // Colormap. Passing an unregistered Colormap to setColormap will
353  // result in an exception being thrown. Requests are forwarded to
354  // the PixelCanvas.
355  // <group>
356  void setColormap(Colormap *cmap);
357  Colormap *colormap() const;
358  // </group>
359 
360  // Display list support functions. A display list is started with a
361  // call to <src>newList()</src>, finished with a call to
362  // <src>endList()</src>, and drawn with a call to
363  // <src>drawList(x)</src>, with the argument <src>x</src> being the
364  // list number returned by the original call to
365  // <src>newList()</src>. Lists can be deleted individually with
366  // <src>deleteList(x)</src> or in total with
367  // <src>deleteLists()</src>. Requests are forwarded to the
368  // PixelCanvas.
369  // <group>
371  void endList();
372  void drawList(casacore::uInt list);
373  void deleteList(casacore::uInt list);
374  void deleteLists();
376  // </group>
377 
378  // Set various graphics attributes. All of these requests are
379  // passed directly to the PixelCanvas, except for
380  // <src>setColor</src>, which also installs the requested color for
381  // subsequent calls to PgPlot functions.
382  // <group>
383  void setColor(const casacore::String &color);
384  void setClearColor(const casacore::String &color);
385  casacore::Bool setFont(const casacore::String &fontName);
388  void setLineWidth(casacore::Float width);
389  void setLineStyle(Display::LineStyle style);
390  void setCapStyle(Display::CapStyle style);
391  void setJoinStyle(Display::JoinStyle style);
392  void setFillStyle(Display::FillStyle style);
393  void setFillRule(Display::FillRule rule);
394  void setArcMode(Display::ArcMode mode);
395  // </group>
396 
397  // Set/retrieve the background and foreground colors of the
398  // WorldCanvas. These can be different to those for the
399  // PixelCanvas. Indeed, they will be used as default colors on the
400  // WorldCanvas when necessary.
401  // <group>
406  }
409  }
410  // </group>
411 
412  // Set/retrieve the drawing buffer, the target destination for
413  // graphics. Requests are passed directly to the PixelCanvas.
414  // <group>
415  virtual void setDrawBuffer(Display::DrawBuffer buf);
417  // </group>
418 
419  // Set/retrieve the caching strategy on the PixelCanvas.
420  // Appropriate values are Display::ClientAlways (use client memory
421  // to cache images [safer]), Display::ServerAlways (use server
422  // memory to cache images [faster]), and
423  // Display::ServerMemoryThreshold (use server memory until a
424  // threshold is reached [not yet implemented]). Requests are passed
425  // to the PixelCanvas.
426  // <group>
429  // </group>
430 
431  // Clear the WorldCanvas, or just the area on the WorldCanvas
432  // but outside the drawing area, ie. the margins that are normally
433  // reserved for axis labels and the like.
434  // <group>
435  void clear();
436  void clearNonDrawArea();
437  // </group>
438 
439  // Install the default options for this DisplayData
440  virtual void setDefaultOptions();
441 
442  // Apply options stored in rec to the DisplayData; return value true
443  // means a refresh is needed. Any fields added to the
444  // updatedOptions argument are options which have changed in some
445  // way due to the setting of other options - ie. they are context
446  // sensitive.
447  virtual casacore::Bool setOptions(const casacore::Record &rec, casacore::Record &updatedOptions);
448 
449  // Retrieve the current and default options and parameter types.
450  virtual casacore::Record getOptions() const;
451 
452  // Set an Attribute or Attributes on the WorldCanvas.
453  // <group>
454  void setAttribute(Attribute& at);
455  void setAttributes(AttributeBuffer& at);
456  // </group>
457 
458  // Remove an Attribute. Pre-defined Attributes of the WorldCanvas
459  // cannot be removed (although nothing serious will happen if you
460  // try).
462 
463  // User interface to get individual values from the attribute buffer.
464  // <group>
477  // </group>
478 
479  // Check if a certain Attribute exists.
481 
482  // Get the type of an Attribute.
484 
485  // Position the PGPLOT filter on the WorldCanvas. If linear is
486  // specified false, then the alignment is done by world coordinates,
487  // assuming that a linear approximation is valid.
488  // void verifyPGFilterAlignment(const casacore::Bool &linear = true);
489 
490  // Acquire and release a PGPLOT device for this WorldCanvas. This
491  // is necessary since PGPLOT generally only supports 8 currently
492  // active devices. So refresh cycles on the WorldCanvas acquire a
493  // PGPLOT device at the start, and release it at the end. Cycles
494  // are counted so that external user-classes can call these functions
495  // if necessary in a nested state. If <src>linear</src> is specified
496  // as <src>false</src>, then the PGPLOT device is aligned by world
497  // coordinates, under the assumption that a linear approximation is
498  // valid, that is, the curvature is small.
499  // <group>
500  virtual void acquirePGPLOTdevice(const casacore::Bool &linear = true);
501  virtual void releasePGPLOTdevice();
502  // </group>
503 
504  // Return the PGPLOT device id for external use.
505  virtual casacore::Int pgid() const;
506 
507  // Draw unrotated text at the given position. If the conversion
508  // from world to pixel coordinates fails, the text is not drawn, and
509  // false is returned. If linear is true, then the provided position
510  // is actually in linear world canvas coordinates, rather than true
511  // world coordinates.
514  const casacore::Bool &linear = false);
515 
516  // Draw a single point using the current color. If the conversion
517  // from world to pixel coordinates fails, the point is not drawn,
518  // and false is the return value. If linear is true, then the point
519  // position is given in linear world canvas coordinates, not true
520  // world coordinates.
522 
523  // Draw a single line using the current color. If either of the
524  // conversions from world to pixel coordinates fail, then the line
525  // is not drawn, and false is returned. If linear is true, then the
526  // line endpoints are given in world canvas linear coordinates
527  // rather than real world coordinates.
529  const casacore::Bool &linear = false);
530 
531  // Draw a bunch of points using the current color. If any points
532  // fail to convert then none of them are drawn, and false is
533  // returned. If linear is true, then the vertices are given in
534  // linear world canvas coordinates rather than real world
535  // coordinates.
537 
538  // Draw a set of points using the current color. Those points which
539  // fail to convert, or lie outside the WorldCanvas drawing area, are
540  // not drawn.
542  casacore::Bool linear = false);
543 
544  // Draw a set of text strings using the current color. If any
545  // points fail to convert, then those particular strings are not
546  // drawn. <src>rotation</src> gives the rotation of the text in
547  // degrees counter-clockwise from horizontal. <src>xoffset</src>
548  // and <src>yoffset</src> can be given to globally shift the labels
549  // by the specified amounts (in units of the character height). If
550  // linear is true, then the vertices are given in linear world
551  // canvas coordinates rather than true world coordinates.
553  const casacore::Vector<casacore::String> &strings,
554  const casacore::Float rotation = 0.0,
555  const casacore::Float xoffset = 0.0,
556  const casacore::Float yoffset = 0.0,
557  const casacore::Bool linear = false);
558 
559  // Draw a set of markers using the current color and a given pixel
560  // <src>size</src>. If any points fail to convert, then those
561  // particular points are not marked. <src>markertype</src> is an
562  // <src>Display::Marker</src>. If linear is true, then the points
563  // are given in linear world canvas coordinates rather than true
564  // world coordinates.
567  const casacore::Bool& linear = false);
568 
570  const casacore::Vector<casacore::Float>& values,
571  const casacore::Int sizemin = 1, const casacore::Int sizemax = 20,
573  const casacore::Bool& linear = false);
574 
575  // Draw pairs of lines using the current color. If any points fail
576  // to convert then the lines are not drawn and false is returned.
577  // If linear is true, then the vertices are given as linear world
578  // coordinates rather than true world coordinates.
580 
581 
582  // Draw a polyline (connected line) between the vertices using the
583  // current color. If any coordinates fail to convert from world to
584  // pixel, then the entire polyline is not drawn and false is
585  // returned. The end point is not implicitly connected to the
586  // starting point. If linear is true, then the provided vertices
587  // are actually linear world canvas coordinates.
589  const casacore::Bool &linear = false);
590 
591  // Draw a polygon (closed line, or line loop using the points)
592  // using the current color. If any coordinates fail to convert
593  // then the polygon is not drawn. The end point is implicitly
594  // connected to the start point. If linear is true, then the
595  // provided vertices are actually linear world coordinates.
597  const casacore::Bool &linear = false);
598 
599  // Draw a set of points in colors which are taken from the current
600  // Colormap.
602  const casacore::Vector<casacore::Float> &values,
603  const casacore::Bool &linear = false);
604 
605  // Draw a set of colored ellipses, possibly with outlines. The x
606  // and y locations must given, along with semi-major and semi-minor
607  // axes, and position angle measured in degrees positive from the x
608  // axis in a counter-clockwise direction. The size of the ellipses
609  // is globally scaled by the scale factor, and if <src>outline</src>
610  // is <src>true</src>, then each ellipse will have an outline in the
611  // current pen color.
613  const casacore::Vector<casacore::Float> &smajor,
614  const casacore::Vector<casacore::Float> &sminor,
615  const casacore::Vector<casacore::Float> &pangle,
616  const casacore::Vector<casacore::Float> &colors,
617  const casacore::Float &scale = 1.0,
618  const casacore::Bool &outline = true,
619  const casacore::Bool &linear = false);
620 
621 
622  // This routine is specialized for drawing image restoring-beam ellipses.
623  // Its parameters are defined so as to require as little conversion as
624  // possible of restoring beam information as stored in an image header.
625  //
626  // It does nothing unless the axes on display map to the two axes of a
627  // casacore::DirectionCoordinate within the WC CS (WorldCanvas::itsDisplayCoordinateSystem).
628  // Center location cx,cy is specified as a fraction of WC draw area:
629  // (0,0) is blc, (1,1) is trc; they default to (.1, .1).
630  //
631  // The unit strings for major,minor are given in in majunit, minunit, and
632  // should be valid angular units (they default to "arcsec"). major/minor
633  // are the _full_ major and minor axis sizes in terms of relative direction
634  // world coordinates.
635  //
636  // pa specifies "position angle", in the angular units specified by paunit.
637  // pa uses the image header convention "North-to-East"; more precisely,
638  // 0 degrees aligns the major axis along increasing DirCoord(1) (commonly
639  // Dec), 90 degrees aligns it along increasing DirCoord(0) (commonly RA).
640  // (NB: increasing RA commonly means decreasing pixel/casacore::Lattice coordinates).
641  // In the common case, this means that pa increases counterclockwise from
642  // vertical. Note that this is _not_ the pa convention in some other
643  // PixelCanvas/WorldCanvas drawEllipse() routines (where pa is always
644  // counterclockwise from horizontal).
645  //
646  // Also note: this routine attempts to do the right thing in oddball cases
647  // such as displaying Dec on the horizontal axis (pa 0 would also be
648  // horizontal in that case), distorted ('flexible') aspect ratio (ellipse
649  // also distorted appropriately) or all-sky images in which the beam may be
650  // displayed in a canvas area where absolute world coordinates do not exist.
651  // It should even take care of uneven coordinate 'increments' (non-square
652  // image data pixels).
653  // (So far, it does _not_ correctly handle non-identity transformation
654  // matrices in the casacore::DirectionCoordinate (e.g. rotated "North")-- which I
655  // think is true in many other places as well... -- for someone's to-do list
656  // (not mine, I hope)).
658  casacore::String majunit="arcsec", casacore::String minunit="arcsec",
659  casacore::String paunit="deg",
660  casacore::Float cx=.1f, casacore::Float cy=.1f, casacore::Bool outline=true);
661 
662 
663  // Draw a contour map at the specified levels, and place the lower
664  // left pixel at blPos, and the upper right pixel at trPos. If
665  // <src>usePixelEdges</src> is true, then the given world positions
666  // are the position of the blc and trc of the blc and trc pixels,
667  // otherwise they are the positions of the centres of the pixels.
668  // Note that the contours are not intrinsically drawn in world
669  // coordinates. For complex data, the conversion to real values is
670  // done according to the last call to setComplexToRealMethod.
671  // Returns true if OK, false if error...
672  // <group>
676  const casacore::Vector<casacore::Float> &levels,
677  const casacore::Bool usePixelEdges = false);
678 
679 
683  const casacore::Vector<casacore::Float> &levels,
684  const casacore::Bool usePixelEdges = false);
685  // </group>
686 
687  // Draw a contour map at the specified levels, and place the lower
688  // left pixel at blPos, and the upper right pixel at trPos. If
689  // <src>usePixelEdges</src> is true, then the given world positions
690  // are the position of the blc and trc of the blc and trc pixels,
691  // otherwise they are the positions of the centres of the pixels.
692  // Note that the contours are not intrinsically drawn in world
693  // coordinates. For complex data, the conversion to real values is
694  // done according to the last call to setComplexToRealMethod. These
695  // functions also have a <src>mask</src> argument, which is a
696  // Boolean pixel mask whose shape must match that of
697  // <src>data</src>, and only pixels in <src>data</src> where
698  // corresponding pixels in <src>mask</src> are <src>true</src> will
699  // be contoured.
700  // Returns true if OK, false if error...
701  // <group>
706  const casacore::Vector<casacore::Float> &levels,
707  const casacore::Bool usePixelEdges = false);
712  const casacore::Vector<casacore::Float> &levels,
713  const casacore::Bool usePixelEdges = false);
714  // </group>
715 
716  // Optimization to speed up colormap fiddling in 24bit mode (software
717  // Colormap); see images_, below for usage. Set opaqueMask to true to
718  // draw masked pixels in the background color; otherwise they will be
719  // transparent (letting whatever was drawn previously at that point show
720  // through).
722  casacore::Bool opaqueMask=false);
723 
724  // Remove image from the colormap change cache, if any (see images_, below).
725  // Return value indicates whether there was anything to remove.
726  casacore::Bool removeIndexedImage(void* drawObj);
727 
728  // Clear the whole colormap change cache (see images_, below).
730 
731  // Draw an image, mapping data values to Colormap entries, and place
732  // the lower left pixel at blPos, and the upper right pixel at
733  // trPos. If <src>usePixelEdges</src> is true, then the given world
734  // positions are the position of the blc and trc of the blc and trc
735  // pixels, otherwise they are the positions of the centres of the
736  // pixels.
737  // See images_, below, for non-default usage of the drawObj parameter.
738  // <group>
740  const casacore::Matrix<casacore::Float> &data, const casacore::Bool usePixelEdges = false,
741  void* drawObj=0);
744  const casacore::Bool usePixelEdges = false, void* drawObj=0);
747  const casacore::Matrix<casacore::Float> &dataBlue,const casacore::Bool usePixelEdges,void* drawObj = 0);
750  const casacore::Matrix<casacore::Complex> &dataBlue,const casacore::Bool usePixelEdges,void* drawObj = 0);
751  // </group>
752 
753  // Draw an image, mapping data values to Colormap entries, and place
754  // the lower left pixel at blPos, and the upper right pixel at
755  // trPos. If <src>usePixelEdges</src> is true, then the given world
756  // positions are the position of the blc and trc of the blc and trc
757  // pixels, otherwise they are the positions of the centres of the
758  // pixels. These functions also have a <src>mask</src> argument,
759  // which is a Boolean pixel mask whose shape must match that of
760  // <src>data</src>, and only pixels in <src>data</src> where
761  // corresponding pixels in <src>mask</src> are <src>true</src>
762  // will be drawn. Set opaqueMask to true to draw masked pixels in
763  // the background color; otherwise they will be transparent (letting
764  // whatever was drawn previously at that point show through).
765  // See images_, below, for non-default usage of the drawObj parameter.
766  // <group>
769  const casacore::Bool usePixelEdges = false, void* drawObj=0,
770  casacore::Bool opaqueMask=false);
773  const casacore::Bool usePixelEdges = false, void* drawObj=0,
774  casacore::Bool opaqueMask=false);
775 
776  // </group>
777  // Draw a component of a multi-channel image, mapping data values to
778  // component levels, and place the lower left pixel at blPos, and
779  // the upper right pixel at trPos. If <src>usePixelEdges</src> is
780  // true, then the given world positions are the position of the blc
781  // and trc of the blc and trc pixels, otherwise they are the
782  // positions of the centres of the pixels. The components are not
783  // drawn until flushComponentImages() is called.
784  // <group>
787  const Display::ColorComponent &colorcomponent,
788  const casacore::Bool usePixelEdges = false);
791  const Display::ColorComponent &colorcomponent,
792  const casacore::Bool usePixelEdges = false);
793  // </group>
794 
795  // Draw a vector map.
796  // <group>
801  casacore::Float angleConversionFactor,
802  casacore::Float phasePolarity,
804  casacore::Int xPixelInc, casacore::Int yPixelInc,
806  casacore::Float rotation,
807  casacore::Double xWorldInc, casacore::Double yWorldInc,
808  const casacore::Bool usePixelEdges);
809 
814  casacore::Float angleConversionFactor,
815  casacore::Float phasePolarity,
817  casacore::Int xPixelInc, casacore::Int yPixelInc,
819  casacore::Float rotation,
820  casacore::Double xWorldInc, casacore::Double yWorldInc,
821  const casacore::Bool usePixelEdges);
822  // </group>
823 
824 // Draw marker maps. Only makerType "square" available presently.
825 // The marker holds its shape in screen pixel coordinates. This
826 // means a square is always a square regardless of aspect ratio
827 // Returns true if OK, false if error...
828 // <group>
833  casacore::Int xPixelInc, casacore::Int yPixelInc,
834  casacore::Float scale, casacore::Double xWorldInc, casacore::Double yWorldInc,
835  const casacore::String& markeType,
836  casacore::Bool usePixelEdges);
841  casacore::Int xPixelInc, casacore::Int yPixelInc,
842  casacore::Float scale, casacore::Double xWorldInc, casacore::Double yWorldInc,
843  const casacore::String& markerType,
844  casacore::Bool usePixelEdges);
845 // </group>
846 
847 
848  // Flush the component images, ie. compose a single image from the
849  // buffered channel images and place it on the WorldCanvas. This
850  // effectively is passed on to the PixelCanvas where the component
851  // images are cached.
852  void flushComponentImages();
853 
854  // Buffer memory exchanges which operate only on the area of the
855  // WorldCanvas. (Not cacheable yet.)
856  // <group>
859  void swapBuffers();
860  // </group>
861 
862  // Provide information on the extents of the linear coordinate
863  // system.
864  // <group>
866  return itsLinXMin;
867  }
869  return itsLinYMin;
870  }
872  return itsLinXMax;
873  }
875  return itsLinYMax;
876  }
877  // </group>
878 
879  // Provide information on the limits of the linear coordinate
880  // system.
881  // <group>
883  return itsLinXMinLimit;
884  }
886  return itsLinYMinLimit;
887  }
889  return itsLinXMaxLimit;
890  }
892  return itsLinYMaxLimit;
893  }
894  // </group>
895 
896  // Provide information on the WorldCanvas offset and size.
897  // <group>
899  return itsCanvasXOffset;
900  }
902  return itsCanvasYOffset;
903  }
905  return itsCanvasXSize;
906  }
908  return itsCanvasYSize;
909  }
910  // </group>
911 
912  // Provide information on the WorldCanvas drawable offset and size.
913  // <group>
915  return itsCanvasDrawXOffset;
916  }
918  return itsCanvasDrawYOffset;
919  }
921  return itsCanvasDrawXSize;
922  }
924  return itsCanvasDrawYSize;
925  }
926  // </group>
927 
928  // Set the zoom rectangle to the specfied linear coordinate range.
931 
932  // Move the zoom rectangle across the screen, ie. pan.
933  void moveZoomRectangleLCS(double dx, double dy);
934 
935  // Reset the zoom to show the entire allowable range of the linear
936  // coordinate system.
937  void resetZoomRectangle();
938 
939  // Set the allowable range of the linear coordinate system.
942  casacore::Bool resetZoom = true);
943 
944  // Functions to set and retrieve the minimum and maximum data values
945  // for scaling data that is drawn on the WorldCanvas. These values
946  // are forwarded to the scale handler, when, for example, images are
947  // drawn.
948  // <group>
950  return itsDataMin;
951  }
953  itsDataMin = min;
954  }
956  return itsDataMax;
957  }
959  itsDataMax = max;
960  }
962  itsDataMin = min;
963  itsDataMax = max;
964  }
965  // </group>
966 
967  // ComplexToRealMethod defines which real component of a Complex
968  // image to extract when it is necessary to convert casacore::Complex data
969  // into real data.
970  // <group>
972  return itsComplexToRealMethod;
973  }
975  itsComplexToRealMethod = method;
976  }
977  // </group>
978 
979  // Set and retrieve the DisplayCoordinateSystem of this WorldCanvas. Set
980  // with 0 and the WorldCanvas loses its DisplayCoordinateSystem!
981  //#
982  //#dk note 9/07 -- Yes, isn't that exciting, esp. since subsequent calls
983  //# to coordinateSystem() will SEGV, and no method was provided to
984  //# even test for it.... hasCS() added to somewhat bandage over this
985  //# hazard...
986  // <group>
990  return itsCoordinateSystem!=0;
991  }
992  // </group>
993 
994  // Convenience functions returning whether a pixel coordinate is
995  // within bounds of the WC's inner draw area, the WC, or the underlying PC.
996  // <group>
997 
1003  return x>=x0 && x<x1 && y>=y0 && y<y1 ;
1004  }
1005 
1008  casacore::Int x1 = x0 + itsCanvasXSize;
1010  casacore::Int y1 = y0 + itsCanvasYSize;
1011  return x>=x0 && x<x1 && y>=y0 && y<y1 ;
1012  }
1013 
1015 
1016  // </group>
1017 
1018 
1019  // Install a single restriction, or a buffer of restrictions, on the
1020  // WorldCanvas which DisplayData must match in order that they
1021  // be allowed to draw themselves.
1022  // <group>
1023  void setRestriction(const Attribute& restriction);
1024  void setRestrictions(const AttributeBuffer& resBuff);
1025  // </group>
1026 
1027  // Check if a named restriction exists.
1029 
1030  // Remove the named restriction, or all restrictions, from the
1031  // WorldCanvas.
1032  // <group>
1033  void removeRestriction(const casacore::String& restrictionName);
1034  void removeRestrictions();
1035  // </group>
1036 
1037  // Determine whether the restrictions installed on the
1038  // WorldCanvas match the given restriction or buffer of
1039  // restrictions.
1040  // <group>
1041  casacore::Bool matchesRestriction(const Attribute& restriction) const;
1042  casacore::Bool matchesRestrictions(const AttributeBuffer& buffer) const;
1043  // </group>
1044 
1045  // Return the buffer of restrictions installed on this
1046  // WorldCanvas.
1047  const AttributeBuffer *restrictionBuffer() const;
1048  // convienience function based on "restriction buffer"...
1049  int zIndex( ) const;
1050 
1051  // The DD in charge of setting WC coordinate state (0 if none).
1052  const DisplayData *csMaster() const {
1053  return itsCSmaster;
1054  }
1056  return itsCSmaster;
1057  }
1058 
1059  // Is the specified DisplayData the one in charge of WC state?
1060  // (During DD::sizeControl() execution, it means instead that the
1061  // DD has permission to become CSmaster, if it can).
1063  return dd==csMaster() && dd!=0;
1064  }
1065 
1066  bool removeDD( const DisplayData *dd ) {
1067  bool result = (dd == csMaster( ));
1068  if ( result ) itsCSmaster = 0;
1069  return result;
1070  }
1071 
1072  // Return the names and units of the world coordinate axes.
1073  // <group>
1076  // </group>
1077 
1078  const std::list<DisplayData*> &displaylist( ) const;
1079 
1084 
1085  std::string errorMessage( ) const { return error_string; }
1086 
1087  private:
1088 
1089 
1090  // Support for construction.
1091  void ctorInit();
1092 
1093  // Call all registered refresh handlers (public method is refresh()).
1094  void callRefreshEventHandlers(const WCRefreshEvent &ev);
1095 
1096 
1097  // Update canvas sizes/offsets from the fracOffsets, and vice versa.
1098  // <group>
1099  void updateCanvasSizesOffsets();
1100  void updateFracSizesOffsets();
1101  // </group>
1102 
1103  // Convert the given coordinate/s to pixel coordinates. If linear
1104  // is true, then the given coordinates are in linear world coordinates,
1105  // otherwise they are real world coordinates. A return value of false
1106  // indicates the conversion failed.
1107  // <group>
1109  const casacore::Bool &linear);
1111  const casacore::Bool &linear);
1113  const casacore::Matrix<casacore::Double> &worldpts,
1114  const casacore::Bool &linear);
1115  // </group>
1116 
1117  // Convert the given coordinate/s to pixel coordinates. If
1118  // <src>linear</src> is <src>true</src>, then the input coordinates
1119  // are linear world coordinates, otherwise they are true world
1120  // coordinates. This version applies clipping, so that any points
1121  // in the series which lie outside the linear coordinate range of
1122  // the WorldCanvas are discarded. Thus the output Vectors can be
1123  // shorter than the input Vectors. A mask indicating which of the
1124  // input points were valid is returned for user reference.
1126  casacore::Vector<casacore::Bool> &validConversions,
1127  const casacore::Vector<casacore::Float> &worldx,
1128  const casacore::Vector<casacore::Float> &worldy,
1129  const casacore::Bool linear);
1130 
1131  // Actually draw the vector field. All pa * angleConversionFactor
1132  // must be radians. rotation must be radians. if amp is of
1133  // dimension 0, amplitude unity is assumed. if mask if dimension
1134  // 0 all data are assumed good.
1140  casacore::Float angleConversionFactor,
1141  casacore::Float phasePolarity,
1143  casacore::Int xPixelInc, casacore::Int yPixelInc,
1144  casacore::Float scale, casacore::Bool arrow, casacore::Float barb, casacore::Float rotation,
1145  casacore::Double xWorldInc, casacore::Double yWorldInc,
1146  const casacore::Bool usePixelEdges);
1147 
1148 
1149  // Trim and resample an image, returning the actual world BLC and
1150  // TRC for drawing, and the resampled image.
1153  casacore::Matrix<casacore::Float> &sampledImage,
1157  const casacore::Bool &usePixelEdges = false);
1158 
1159  // Trim and resample an image, returning the actual world BLC and
1160  // TRC for drawing, and the resampled image. This function takes
1161  // a mask indicating which pixels should be drawn. This function
1162  // therefore also trims and resamples the mask.
1165  casacore::Matrix<casacore::Float> &sampledImage,
1166  casacore::Matrix<casacore::Bool> &resampledMask,
1171  const casacore::Bool &usePixelEdges = false);
1172 
1173  // Draw an image where <src>scaledImage</src> gives the Colormap
1174  // index of each screen (PixelCanvas) pixel. 'blc' contains X and Y
1175  // PixelCanvas coordinates. Masked version as well.
1176  // For masked version, set opaqueMask to true to draw masked pixels in
1177  // the background color; otherwise they will be transparent (letting
1178  // whatever was drawn previously at that point show through).
1179  // <group>
1181  const casacore::Matrix<casacore::uInt> &scaledImage);
1183  const casacore::Matrix<casacore::uInt> &scaledImage,
1185  casacore::Bool opaqueMask=false);
1186  // </group>
1187  // Draw a set of points where <src>scaledValues</src> gives the
1188  // Colormap index of each point. Point coordinates ('points')
1189  // are either linear or world coordinates, as specified by 'linear'.
1191  const casacore::Vector<casacore::uInt> &scaledValues,
1192  const casacore::Bool &linear = false);
1193 
1194  // Draw a set of ellipses where <src>scaledValues</src> gives the
1195  // Colormap index of each point. Point coordinates ('points')
1196  // are either linear or world coordinates, as specified by 'linear'.
1198  const casacore::Vector<casacore::Float> &smajor,
1199  const casacore::Vector<casacore::Float> &sminor,
1200  const casacore::Vector<casacore::Float> &pangle,
1201  const casacore::Vector<casacore::uInt> scaledValues,
1202  const casacore::Float &scale,
1203  const casacore::Bool &outline,
1204  const casacore::Bool &linear);
1205 
1206 
1207 
1208 
1209  // <b>***Cached***</b> blc pixel where this world canvas begins =
1210  // itsPixelCanvas->width()*frac(X|Y)Offset_.
1211  // <group>
1214  // </group>
1215 
1216  // <b>***Cached***</b> number of pixels in each dimension given to
1217  // the world canvas = itsPixelCanvas->width()*(frac(X|Y)Size_.
1218  // <group>
1221  // </group>
1222 
1223  // Fractional position of world canvas on pixel canvas. The offset
1224  // values are always in the range of [0.0,1.0], and sizes must be
1225  // smaller or equal to (1.0 - offset) for each dimension.
1226  // <group>
1231  // </group>
1232 
1233  // <b>***Cached***</b> blc pixel where the world canvas 'draw area'
1234  // (inside margins, labels) begins, relative to WC blc.
1235  // <group>
1238  // </group>
1239 
1240  // <b>***Cached***</b> number of pixels in each dimension given to
1241  // the drawable part of the world canvas
1242  // <group>
1245  // </group>
1246 
1247  // Linear casacore::Coordinate System ranges.
1248  // <group>
1253  // </group>
1254 
1255  // Linear casacore::Coordinate System Limits.
1256  // <group>
1261  // </group>
1262 
1263  // Dynamic data minimum and maximum for this WorldCanvas.
1265 
1266  // Method to use to convert complex data into real values.
1268 
1269  // Event handler lists and convenient iterators.
1270  // <group>
1271  std::list<DisplayEH *> itsRefreshEHList;
1272  std::list<WCPositionEH *> itsPositionEHList;
1273  std::list<WCMotionEH *> itsMotionEHList;
1274  // </group>
1275 
1276  // Other handler lists.
1277  // <group>
1282  // </group>
1283 
1284  // Store whether we "own" the various handlers.
1285  // <group>
1290  // </group>
1291 
1292  // Buffer for Attributes.
1294 
1295  // Background/foreground colors.
1298 
1299  // PixelCanvas pointer.
1301 
1302  // PGPLOT filter.
1304 
1305  // Status of hold/release.
1309 
1310  // The DisplayCoordinateSystem for this WorldCanvas. New addition, only
1311  // supported and used by "new" classes.
1313 
1314  // This state is set true when the pointer is in this WC and a pointer
1315  // button is pressed (with no buttons pressed previously). When true,
1316  // all PC motion and pointer button events are propagated to this WC's
1317  // handlers (only), regardless of whether the pointer has moved off the WC.
1318  // It is reset to false when all buttons are released. This simulates
1319  // the 'automatic grab' (implemented in X for whole windows), on the WC
1320  // level.
1322 
1323 
1324  // ColorIndexedImage_ stores the state of a WorldCanvas::drawImage()
1325  // rendering after the chosen data plane has been resampled to screen
1326  // (Pixelcanvas) pixels and scaled to indices within a fixed-size
1327  // Colormap, but prior to mapping to actual colors for display.
1328  // 'Caching' of this state is useful in 24-bit (trueColor) applications,
1329  // greatly speeding up redrawing when only the mapping to colors is changed.
1330  //# Formerly only one instance of this state was stored in a WorldCanvas
1331  //# (itsCachedImage and friends), but this caused confusion and errors
1332  //# when more that one DD was drawing on the WC.
1333  // Packaging this state allows different instances to be cached by
1334  // different callers of drawImage() if desired, to be reused by them
1335  // when appropriate via WC::redrawIndexedImage(). Reuse is 'appropriate'
1336  // only when nothing has changed since the original drawImage() call
1337  // except the actual colors assigned to the map indices; among other things,
1338  // the size of the Colormap used must be the same as that of the original.
1339  //
1340  // Note: this level of 'caching' is distinct from the more elaborate
1341  // 'drawlists' which are supported by WC/PC and cached in DisplayMethods.
1342 
1348 
1349  ColorIndexedImage_() : data(), mask(), blc(2,0) { }
1350  void clear() {
1351  data.resize();
1352  mask.resize();
1353  blc=0;
1354  }
1356  return mask.nelements()!=0u &&
1357  mask.shape().isEqual(data.shape());
1358  }
1359  };
1360 
1361  ColorIndexedImage_* makeColorIndexedImage(const casacore::Vector<casacore::Double> &blc,
1364  const casacore::Bool usePixelEdges, void* drawObj);
1366  // Cache of pre-drawn ColorIndexedImage_'s. When a caller of drawImage()
1367  // wants to save one, it passes a drawing-object pointer in the 'drawObj'
1368  // parameter for use as a retrieval key. It should provide the same key
1369  // to redrawIndexedImage() in order to reuse the image.
1370  //# This mechanism attempts to avoid some erroneous reuses of
1371  //# 'itsCachedImage' among different DDs (bugs 4937, 5032). (dk 3/05)
1372  std::map<void*, ColorIndexedImage_*> images_;
1373 
1374  // Retrieve an indexed image to write onto. Used (exclusively) by
1375  // WC::drawImage(). If one exists in the cache under this objId key,
1376  // clear it for reuse; otherwise return a new one. If a (non-zero) objId
1377  // was provided, it will be cached under that key; removeIndexedImage()
1378  // can be used to remove such cached images explicitly, but the cache is
1379  // also frequently cleared automatically. If no caching is requested,
1380  // however, (objId=0), the caller must delete the image himself when
1381  // finished -- that type of call is equivalent to 'new ColorIndexedImage_'.
1383 
1384  // A buffer to contain the restrictions that DisplayDatas must match
1385  // if they are to be allowed to draw themselves.
1387 
1388 
1389  // [First] responder to 'sizeControl', responsible for setting
1390  // WC CS, zoom window and draw area. It will be 0 initially, and
1391  // whenever the old master is unregistered (until a new master responds).
1392  // This is a further attempt toward a coherent sense of 'who's in charge'
1393  // of WC[H] state (there is more to do).
1394  //
1395  // Some day, the WC CS should be directly responsible for all the Canvas's
1396  // coordinate conversions. For now at least we'll know that they're done
1397  // by the DD below (which should be equivalent).
1399 
1400  // itsId & itsRef used to ensure thread-safe execution of pgplot
1401 
1402  casacore::uInt itsId; // id of wc instance
1403 
1404 
1405  // WorldCanvas::refresh is a recursive function. itsRef is used to
1406  // determine when the recursion is over. i.e, when the initial
1407  // refresh call is exiting
1409 
1410  std::string error_string;
1411  };
1412 
1413 
1414 } //# NAMESPACE CASA - END
1415 
1416 #endif
void updateFracSizesOffsets()
Display::ComplexToRealMethod complexToRealMethod() const
ComplexToRealMethod defines which real component of a Complex image to extract when it is necessary t...
Definition: WorldCanvas.h:971
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.
void setDataMax(casacore::Double max)
Definition: WorldCanvas.h:958
casacore::uInt newList()
Display list support functions.
void setAttribute(Attribute &at)
Set an Attribute or Attributes on the WorldCanvas.
void setCoordinateHandler(WCCoordinateHandler *ch)
Set casacore::Coordinate, SizeControl, Resample and DataScale handlers for the WorldCanvas.
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...
virtual casacore::Record getOptions() const
Retrieve the current and default options and parameter types.
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)
int Int
Definition: aipstype.h:50
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.
void setJoinStyle(Display::JoinStyle style)
virtual void handleEvent(DisplayEvent &ev)
Handle other, generic types of events.
casacore::Bool itsOwnResampleHandler
Definition: WorldCanvas.h:1288
casacore::Double itsLinXMin
Linear casacore::Coordinate System ranges.
Definition: WorldCanvas.h:1249
Class to provide option parsing routines for display classes.
void addRefreshEventHandler(DisplayEH &eh)
Add the given refresh, motion and position event handlers to the WorldCanvas.
casacore::Bool inDrawArea(casacore::Int x, casacore::Int y) const
Convenience functions returning whether a pixel coordinate is within bounds of the WC&#39;s inner draw ar...
Definition: WorldCanvas.h:998
void setCoordinateSystem(const DisplayCoordinateSystem &csys)
Set and retrieve the DisplayCoordinateSystem of this WorldCanvas.
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.
void setLineStyle(Display::LineStyle style)
Class which stores WorldCanvas refresh event information.
DisplayData * itsCSmaster
[First] responder to &#39;sizeControl&#39;, responsible for setting WC CS, zoom window and draw area...
Definition: WorldCanvas.h:1398
casacore::Bool itsOwnCoordinateHandler
Definition: WorldCanvas.h:1287
void removeAttribute(casacore::String &name)
Remove an Attribute.
WorldCanvas Event Handler for managing events.
Definition: PCRefreshEH.h:76
Base class defining the interface to controlling the WorldCanvas size.
casacore::uInt canvasDrawXOffset() const
Provide information on the WorldCanvas drawable offset and size.
Definition: WorldCanvas.h:914
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_...
casacore::Bool worldToPix(casacore::Vector< casacore::Double > &pix, const casacore::Vector< casacore::Double > &world)
const DisplayData * csMaster() const
The DD in charge of setting WC coordinate state (0 if none).
Definition: WorldCanvas.h:1052
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.
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
Definition: ArrayBase.h:99
const IPosition & shape() const
The length of each axis of the Matrix.
Definition: Matrix.h:295
std::map< void *, ColorIndexedImage_ * > images_
Cache of pre-drawn ColorIndexedImage_&#39;s.
Definition: WorldCanvas.h:1372
void setCapStyle(Display::CapStyle style)
#define max(a, b)
Definition: hio.h:44
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
void removePositionEventHandler(const WCPositionEH &eh)
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.
void copyBackBufferToFrontBuffer()
Buffer memory exchanges which operate only on the area of the WorldCanvas.
void addPositionEventHandler(WCPositionEH &eh)
casacore::uInt itsRef
WorldCanvas::refresh is a recursive function.
Definition: WorldCanvas.h:1408
void setAttributes(AttributeBuffer &at)
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. ...
#define min(a, b)
Definition: hio.h:45
void operator()(const PCRefreshEvent &pev)
Handle implicit refresh, motion and position events occuring on the PixelCanvas on which this WorldCa...
TextAlign
Text Alignment.
Definition: DisplayEnums.h:181
casacore::uInt itsCanvasDrawYOffset
Definition: WorldCanvas.h:1237
casacore::Double linYMaxLimit() const
Definition: WorldCanvas.h:891
void drawList(casacore::uInt list)
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.
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)
Base class defining a set of transformations for WorldCanvas coordinates.
void setZoomRectangleLCS(const casacore::Vector< casacore::Double > &min, const casacore::Vector< casacore::Double > &max)
Set the zoom rectangle to the specfied linear coordinate range.
Display::ImageCacheStrategy imageCacheStrategy() const
Buffer for storing Attributes.
Base class for handling WorldCanvas motion events.
Definition: WCMotionEH.h:70
static const casacore::String RIGHT_MARGIN_SPACE_PG
Definition: WorldCanvas.h:1081
DisplayData *& csMaster()
Definition: WorldCanvas.h:1055
casacore::Bool drawPoint(const casacore::Vector< casacore::Double > &point, const casacore::Bool &linear=false)
Draw a single point using the current color.
void setForeground(casacore::uLong color)
DrawBuffer
PixelCanvas target drawing destination.
Definition: DisplayEnums.h:211
casacore::uInt itsCanvasDrawXOffset
***Cached*** blc pixel where the world canvas &#39;draw area&#39; (inside margins, labels) begins...
Definition: WorldCanvas.h:1236
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.
virtual void releasePGPLOTdevice()
casacore::uInt itsCanvasXSize
***Cached*** number of pixels in each dimension given to the world canvas = itsPixelCanvas-&gt;width()*(...
Definition: WorldCanvas.h:1219
virtual casacore::Vector< casacore::String > worldAxisUnits() const
void setRestriction(const Attribute &restriction)
Install a single restriction, or a buffer of restrictions, on the WorldCanvas which DisplayData must ...
casacore::Double itsLinXMax
Definition: WorldCanvas.h:1251
casacore::Double linXMinLimit() const
Provide information on the limits of the linear coordinate system.
Definition: WorldCanvas.h:882
Basic, Unfilled shapes;.
Definition: DisplayEnums.h:315
void setSizeControlHandler(WCSizeControlHandler *sh)
ColorIndexedImage_ * getClearedColorIndexedImage(void *drawObj=0)
Retrieve an indexed image to write onto.
std::list< DisplayEH * > itsRefreshEHList
Event handler lists and convenient iterators.
Definition: WorldCanvas.h:1271
casacore::Bool itsOwnDataScaleHandler
Definition: WorldCanvas.h:1289
void setDataMin(casacore::Double min)
Definition: WorldCanvas.h:952
FillRule
Fill Rule Xlib programming guide, pg.132.
Definition: DisplayEnums.h:165
void setDataScaleHandler(WCDataScaleHandler *sh)
ComplexToRealMethod
WorldCanvas - what to do with complex data if it is presented to WorldCanvas::drawImage() ...
Definition: DisplayEnums.h:342
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...
Class which stores PixelCanvas motion event information.
Definition: PCMotionEvent.h:82
virtual void setDefaultOptions()
Install the default options for this DisplayData.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
Bool isEqual(const IPosition &other) const
Element-by-element comparison for equality.
casacore::Bool pixToLin(casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &pix)
Pixel, linear and world coordinate transformation functions.
class for handling any type of DisplayEvent.
Definition: DisplayEH.h:100
WCPGFilter * itsPGFilter
PGPLOT filter.
Definition: WorldCanvas.h:1303
casacore::Matrix< casacore::uInt > mapToColor(const casacore::Matrix< casacore::uInt > &scaledImage)
WCResampleHandler * itsResampleHandler
Definition: WorldCanvas.h:1280
Arbitrary name-value pairs used in the display classes.
Definition: Attribute.h:144
size_t size() const
void removeRefreshEventHandler(const DisplayEH &eh)
Remove the given refresh, motion and position event handlers from the WorldCanvas.
const std::list< DisplayData * > & displaylist() const
bool removeDD(const DisplayData *dd)
Definition: WorldCanvas.h:1066
void callPositionEventHandlers(const WCPositionEvent &ev)
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.
Base class defining interface to pixel-based output devices.
Definition: PixelCanvas.h:161
ValueType
The possible value types.
Definition: AttValBase.h:82
casacore::Bool isCSmaster(const DisplayData *dd) const
Is the specified DisplayData the one in charge of WC state? (During DD::sizeControl() execution...
Definition: WorldCanvas.h:1062
void addMotionEventHandler(WCMotionEH &eh)
casacore::String getWorldForegroundColor()
Definition: WorldCanvas.h:407
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
casacore::Bool itsGrabbing
This state is set true when the pointer is in this WC and a pointer button is pressed (with no button...
Definition: WorldCanvas.h:1321
CapStyle
Controls the appearance of thick lines near their endpoints.
Definition: DisplayEnums.h:130
reference point aligned to center of text
Definition: DisplayEnums.h:183
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.
std::list< WCPositionEH * > itsPositionEHList
Definition: WorldCanvas.h:1272
void setRestrictions(const AttributeBuffer &resBuff)
ColorComponent
Color components.
Definition: DisplayEnums.h:84
Class which stores PixelCanvas refresh event information.
DisplayCoordinateSystem * itsCoordinateSystem
The DisplayCoordinateSystem for this WorldCanvas.
Definition: WorldCanvas.h:1312
void setWorldCanvasPosition(casacore::Double fracXOffset, casacore::Double fracYOffset, casacore::Double fracXSize, casacore::Double fracYSize)
Set the location of the WorldCanvas on its PixelCanvas.
casacore::Bool matchesRestrictions(const AttributeBuffer &buffer) const
casacore::String itsWorldForegroundColor
Definition: WorldCanvas.h:1297
casacore::Bool matchesRestriction(const Attribute &restriction) const
Determine whether the restrictions installed on the WorldCanvas match the given restriction or buffer...
casacore::Bool setWorldForegroundColor(const casacore::String color)
Interface between the WorldCanvas and its PGPLOT driver.
Definition: WCPGFilter.h:74
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.
void removeRestrictions()
casacore::Vector< casacore::Int > blc
Definition: WorldCanvas.h:1346
void clearColormapChangeCache()
Clear the whole colormap change cache (see images_, below).
casacore::Double itsDataMin
Dynamic data minimum and maximum for this WorldCanvas.
Definition: WorldCanvas.h:1264
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
casacore::uInt canvasYSize() const
Definition: WorldCanvas.h:907
casacore::Double linXMaxLimit() const
Definition: WorldCanvas.h:888
casacore::Double itsFracYSize
Definition: WorldCanvas.h:1230
void clear()
Clear the WorldCanvas, or just the area on the WorldCanvas but outside the drawing area...
casacore::Int itsHoldCount
Status of hold/release.
Definition: WorldCanvas.h:1306
Class which stores WorldCanvas motion event information.
Definition: WCMotionEvent.h:79
void registerColormap(Colormap *cmap, casacore::Float weight=1.0)
Register/unregister a Colormap on the PixelCanvas.
casacore::Bool existRestriction(const casacore::String &name) const
Check if a named restriction exists.
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.
casacore::uInt itsId
itsId &amp; itsRef used to ensure thread-safe execution of pgplot
Definition: WorldCanvas.h:1402
void setImageCacheStrategy(Display::ImageCacheStrategy strategy)
Set/retrieve the caching strategy on the PixelCanvas.
double Double
Definition: aipstype.h:55
PixelCanvas * pixelCanvas() const
Return a pointer to the PixelCanvas on which this WorldCanvas is installed.
Definition: WorldCanvas.h:223
casacore::uInt itsCanvasDrawYSize
Definition: WorldCanvas.h:1244
casacore::Double itsLinXMaxLimit
Definition: WorldCanvas.h:1259
void setDataMinMax(casacore::Double min, casacore::Double max)
Definition: WorldCanvas.h:961
casacore::uInt canvasDrawYOffset() const
Definition: WorldCanvas.h:917
Class describing the most basic event information in the display classes.
Definition: DisplayEvent.h:82
LatticeExprNode amp(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds sqrt(left^2+right^2).
casacore::Double linXMax() const
Definition: WorldCanvas.h:871
void hold()
Hold and release response to refreshes requested with the refresh() member function.
void callRefreshEventHandlers(const WCRefreshEvent &ev)
Call all registered refresh handlers (public method is refresh()).
casacore::Bool refreshAllowed()
Is a refresh currently allowed?
void ctorInit()
Support for construction.
void flushComponentImages()
Flush the component images, ie.
casacore::Bool itsRefreshHeld
Definition: WorldCanvas.h:1307
void setColormap(Colormap *cmap)
Set and retrieve the current Colormap on the PixelCanvas.
casacore::Double linYMin() const
Definition: WorldCanvas.h:868
static const casacore::String TOP_MARGIN_SPACE_PG
Definition: WorldCanvas.h:1083
casacore::Bool inPC(casacore::Int x, casacore::Int y)
casacore::uInt itsCanvasDrawXSize
***Cached*** number of pixels in each dimension given to the drawable part of the world canvas ...
Definition: WorldCanvas.h:1243
AttributeBuffer itsRestrictions
A buffer to contain the restrictions that DisplayDatas must match if they are to be allowed to draw t...
Definition: WorldCanvas.h:1386
casacore::Bool getAttributeValue(const casacore::String &name, casacore::uInt &newValue) const
User interface to get individual values from the attribute buffer.
void setClearColor(const casacore::String &color)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
casacore::Double itsLinYMax
Definition: WorldCanvas.h:1252
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void updateCanvasSizesOffsets()
Update canvas sizes/offsets from the fracOffsets, and vice versa.
casacore::String itsWorldBackgroundColor
Background/foreground colors.
Definition: WorldCanvas.h:1296
ColorIndexedImage_ stores the state of a WorldCanvas::drawImage() rendering after the chosen data pla...
Definition: WorldCanvas.h:1343
casacore::Bool linToPix(casacore::Vector< casacore::Double > &pix, const casacore::Vector< casacore::Double > &lin)
static const casacore::String BOTTOM_MARGIN_SPACE_PG
Definition: WorldCanvas.h:1082
WCDataScaleHandler * itsDataScaleHandler
Definition: WorldCanvas.h:1281
casacore::uInt canvasDrawYSize() const
Definition: WorldCanvas.h:923
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.
Display::DrawBuffer drawBuffer() const
PixelCanvas Event Handler for managing keyboard and mouse button events.
Definition: PCPositionEH.h:74
casacore::Double itsLinXMinLimit
Linear casacore::Coordinate System Limits.
Definition: WorldCanvas.h:1257
static const casacore::String LEFT_MARGIN_SPACE_PG
Definition: WorldCanvas.h:1080
std::string error_string
Definition: WorldCanvas.h:1410
float Float
Definition: aipstype.h:54
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 PixelCanva...
WCSizeControlHandler * itsSizeControlHandler
Other handler lists.
Definition: WorldCanvas.h:1278
casacore::Bool drawLines(const casacore::Matrix< casacore::Double > &vertices, const casacore::Bool &linear=false)
Draw pairs of lines using the current color.
virtual ~WorldCanvas()
Destructor.
void setResampleHandler(WCResampleHandler *rh)
int zIndex() const
convienience function based on &quot;restriction buffer&quot;...
AttValue::ValueType attributeType(casacore::String &name) const
Get the type of an Attribute.
casacore::Double linXMin() const
Provide information on the extents of the linear coordinate system.
Definition: WorldCanvas.h:865
casacore::Matrix< casacore::Bool > mask
Definition: WorldCanvas.h:1345
casacore::Bool worldToLin(casacore::Vector< casacore::Double > &lin, const casacore::Vector< casacore::Double > &world)
casacore::Double itsFracYOffset
Definition: WorldCanvas.h:1228
unsigned long uLong
Definition: aipstype.h:53
const DisplayCoordinateSystem & coordinateSystem() const
void setComplexToRealMethod(const Display::ComplexToRealMethod method)
Definition: WorldCanvas.h:974
PixelCanvas * itsPixelCanvas
PixelCanvas pointer.
Definition: WorldCanvas.h:1300
Base class for resampling data pixels to World/PixelCanvas pixels.
void removeMotionEventHandler(const WCMotionEH &eh)
void callMotionEventHandlers(const WCMotionEvent &ev)
Call all of the motion and position event handlers that are installed on the WorldCanvas.
std::list< WCMotionEH * > itsMotionEHList
Definition: WorldCanvas.h:1273
FillStyle
Controls fill style.
Definition: DisplayEnums.h:152
void setFillStyle(Display::FillStyle style)
casacore::Matrix< casacore::uInt > data
Definition: WorldCanvas.h:1344
RefreshReason
Callback reasons for PCRefreshEvent and WCRefreshEvent.
Definition: DisplayEnums.h:267
Class which stores WorldCanvas position event information.
casacore::Bool hasCS() const
Definition: WorldCanvas.h:989
Describes a method of generating a table of colors.
Definition: Colormap.h:104
virtual void setDrawBuffer(Display::DrawBuffer buf)
Set/retrieve the drawing buffer, the target destination for graphics.
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 ima...
Class which stores PixelCanvas position event information.
void setArcMode(Display::ArcMode mode)
casacore::Double itsFracXOffset
Fractional position of world canvas on pixel canvas.
Definition: WorldCanvas.h:1227
void setFillRule(Display::FillRule rule)
Implementation of drawing in world coordinates on top of a PixelCanvas.
Definition: WorldCanvas.h:204
casacore::Double itsLinYMinLimit
Definition: WorldCanvas.h:1258
casacore::Bool drawPoints(const casacore::Matrix< casacore::Double > &points, const casacore::Bool &linear=false)
Draw a bunch of points using the current color.
WCCoordinateHandler * itsCoordinateHandler
Definition: WorldCanvas.h:1279
void removeRestriction(const casacore::String &restrictionName)
Remove the named restriction, or all restrictions, from the WorldCanvas.
std::string errorMessage() const
Definition: WorldCanvas.h:1085
void unregisterColormap(Colormap *cmap)
casacore::Double itsLinYMaxLimit
Definition: WorldCanvas.h:1260
casacore::Double linYMinLimit() const
Definition: WorldCanvas.h:885
void copyFrontBufferToBackBuffer()
casacore::Bool linToWorld(casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &lin)
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.
casacore::Bool existsAttribute(casacore::String &name) const
Check if a certain Attribute exists.
virtual void acquirePGPLOTdevice(const casacore::Bool &linear=true)
Position the PGPLOT filter on the WorldCanvas.
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.
casacore::Double dataMin() const
Functions to set and retrieve the minimum and maximum data values for scaling data that is drawn on t...
Definition: WorldCanvas.h:949
ArcMode
Arc Mode.
Definition: DisplayEnums.h:173
Display::RefreshReason itsHeldReason
Definition: WorldCanvas.h:1308
casacore::Double dataMax() const
Definition: WorldCanvas.h:955
virtual casacore::Int pgid() const
Return the PGPLOT device id for external use.
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...
casacore::uInt canvasYOffset() const
Definition: WorldCanvas.h:901
casacore::Bool validList(casacore::uInt list)
Colormap * colormap() const
virtual casacore::Vector< casacore::String > worldAxisNames() const
Return the names and units of the world coordinate axes.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool setWorldBackgroundColor(const casacore::String color)
Set/retrieve the background and foreground colors of the WorldCanvas.
void resize(size_t nx, size_t ny, Bool copyValues=False)
Definition: Matrix.h:154
casacore::uInt canvasDrawXSize() const
Definition: WorldCanvas.h:920
casacore::String getWorldBackgroundColor()
Definition: WorldCanvas.h:404
casacore::Bool itsOwnSizeControlHandler
Store whether we &quot;own&quot; the various handlers.
Definition: WorldCanvas.h:1286
void deleteList(casacore::uInt list)
Base class for handling WorldCanvas position events.
Definition: WCPositionEH.h:75
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.
void refresh(const Display::RefreshReason &reason=Display::UserCommand, const casacore::Bool &explicitrequest=true)
Refresh the WorldCanvas for the given reason.
ImageCacheStrategy
How to cache images when displaying them on client-server graphics systems.
Definition: DisplayEnums.h:297
casacore::Bool pixToWorld(casacore::Vector< casacore::Double > &world, const casacore::Vector< casacore::Double > &pix)
Base class for display objects.
Definition: DisplayData.h:317
LatticeExprNode variance(const LatticeExprNode &expr)
PixelCanvas Event Handler for managing pointer motion events.
Definition: PCMotionEH.h:72
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
casacore::uInt canvasXSize() const
Definition: WorldCanvas.h:904
casacore::uInt itsCanvasYSize
Definition: WorldCanvas.h:1220
casacore::uInt itsCanvasXOffset
***Cached*** blc pixel where this world canvas begins = itsPixelCanvas-&gt;width()*frac(X|Y)Offset_.
Definition: WorldCanvas.h:1212
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.
casacore::Bool setFont(const casacore::String &fontName)
casacore::Double linYMax() const
Definition: WorldCanvas.h:874
casacore::uInt itsCanvasYOffset
Definition: WorldCanvas.h:1213
JoinStyle
Controls the appearance of two joined lines.
Definition: DisplayEnums.h:142
void setBackground(casacore::uLong color)
casacore::Double itsFracXSize
Definition: WorldCanvas.h:1229
casacore::Bool inWC(casacore::Int x, casacore::Int y) const
Definition: WorldCanvas.h:1006
void setColor(const casacore::String &color)
Set various graphics attributes.
const AttributeBuffer * restrictionBuffer() const
Return the buffer of restrictions installed on this WorldCanvas.
void resetZoomRectangle()
Reset the zoom to show the entire allowable range of the linear coordinate system.
Display::ComplexToRealMethod itsComplexToRealMethod
Method to use to convert complex data into real values.
Definition: WorldCanvas.h:1267
void setLineWidth(casacore::Float width)
unsigned int uInt
Definition: aipstype.h:51
User told PixelCanvas to refresh via PixelCanvas refresh()
Definition: DisplayEnums.h:269
casacore::uInt canvasXOffset() const
Provide information on the WorldCanvas offset and size.
Definition: WorldCanvas.h:898
Class implementing simple data scaling for the WorldCanvas.
casacore::Bool removeIndexedImage(void *drawObj)
Remove image from the colormap change cache, if any (see images_, below).
void moveZoomRectangleLCS(double dx, double dy)
Move the zoom rectangle across the screen, ie.
LineStyle
Style of line to use.
Definition: DisplayEnums.h:119
AttributeBuffer attributes
Buffer for Attributes.
Definition: WorldCanvas.h:1293
casacore::Double itsLinYMin
Definition: WorldCanvas.h:1250
casacore::Double itsDataMax
Definition: WorldCanvas.h:1264