casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotFactory.h
Go to the documentation of this file.
1 //# PlotFactory.h: Class to produce implementation-specific plotting objects.
2 //# Copyright (C) 2008
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 #ifndef PLOTFACTORY_H_
28 #define PLOTFACTORY_H_
29 
40 
41 #include <utility>
42 
43 namespace casa {
44 
45 // The idea behind a plot factory is to produce classes that are useful to
46 // the underlying implementation without having to know what the implementation
47 // is. A PlotFactory provides for creation of plot items with the given
48 // parameters in the given implementation. Methods that have a "smartDelete"
49 // parameter pass that flag into the smart pointer constructor, to indicate
50 // whether the underlying object is deleted upon destruction of all smart
51 // pointers or not.
52 class PlotFactory {
53 public:
54  // Constructor.
55  PlotFactory();
56 
57  // Destructor.
58  virtual ~PlotFactory();
59 
60 
61  // Support Methods //
62 
63  // Returns true if this implementation's PlotCanvas subclass supports
64  // threaded drawing, false otherwise. Threaded drawing is done using a
65  // threading library appropriate to the implementation, and keeps progress
66  // information synchronized across threads by using PlotOperation objects
67  // unique to each canvas (see PlotCanvas::operationDraw()).
68  virtual bool canvasHasThreadedDrawing() const = 0;
69 
70  // Returns true if this implementation's PlotCanvas subclass supports
71  // cached layer drawing, false otherwise. Cached layer drawing means that
72  // items that are changed in one layer will ONLY cause a redraw of that
73  // layer, and the others are cached and thus do not need to be redrawn.
74  virtual bool canvasHasCachedLayerDrawing() const = 0;
75 
76  // Returns true if this implementation's PlotCanvas subclass has a cached
77  // axes stack, false otherwise. Cached axes stack means that the part of
78  // the canvas for a given axes range is cached after the first time it is
79  // drawn, so that if the ranges are set to a cached value in the future it
80  // will not have to be redrawn. This is useful for, for example, caching
81  // the zoom/pan stack to move quickly along axes ranges already seen. Note
82  // that the cached axes stack will need to be invalidated as needed when
83  // plot items on the canvas change and thus require a redraw.
84  virtual bool canvasHasCachedAxesStack() const = 0;
85 
86 
87  // Execution Methods //
88 
89  // Enters the GUI execution loop, if necessary, and returns the result.
90  virtual int execLoop() = 0;
91 
92  // Return which implementation this factory is producing.
93  virtual Plotter::Implementation implementation() const = 0;
94 
95 
96  // GUI Objects //
97 
98  // Return a new instance of a Plotter for this implementation with the
99  // given parameters. The plotter's window title is set to the given. If
100  // showSingleCanvas is true, then the plotter is created with a single
101  // canvas; otherwise it has no canvases. If showGUI is true then the
102  // plotter GUI will be shown after creation. If log event flags are given
103  // (bitwise or of PlotLogger::Event) they are passed to the plotter.
104  virtual PlotterPtr plotter(const casacore::String& windowTitle = "Plotter",
105  bool showSingleCanvas = true, bool showGUI = true,
106  int logEventFlags = PlotLogger::NO_EVENTS,
107  bool smartDelete = true) const = 0;
108 
109  // Return a new instance of a Plotter for this implementation, with the
110  // given rows and columns of canvases and parameters. The plotter's window
111  // title is set to the given. If showGUI is true then the plotter GUI will
112  // be shown after creation. If log event flags are given (bitwise or of
113  // PlotLogger::Event) they are passed to the plotter.
114  virtual PlotterPtr plotter(unsigned int nrows, unsigned int ncols,
115  const casacore::String& windowTitle = "Plotter", bool showGUI = true,
116  int logEventFlags = PlotLogger::NO_EVENTS,
117  bool smartDelete = true) const = 0;
118 
119  // Convenience method for creating a plotter with a single, given canvas.
120  // The plotter's window title is set to the given. If showGUI is true then
121  // the plotter GUI will be shown after creation. If log event flags are
122  // given (bitwise or of PlotLogger::Event) they are passed to the plotter.
123  // DEFAULT IMPLEMENTATION.
125  const casacore::String& windowTitle = "Plotter", bool showGUI = true,
126  int logEventFlags = PlotLogger::NO_EVENTS,
127  bool smartDelete = true);
128 
129  // Return a new instance of a PlotCanvas for this implementation.
130  virtual PlotCanvasPtr canvas(bool smartDelete = true) const = 0;
131 
132  // Return a new instance of a PlotPanel for this implementation.
133  virtual PlotPanelPtr panel(bool smartDelete = true) const = 0;
134 
135  // Return a new instance of a PlotButton with the given text for this
136  // implementation. If isText is true, the given string should be
137  // displayed on the button as text; otherwise it is a path to an image
138  // file. If toggleable is true, then a toggleable button is returned.
139  virtual PlotButtonPtr button(const casacore::String& str, bool isText = true,
140  bool toggleable = false, bool smartDelete = true) const = 0;
141 
142  // Return a new instance of a PlotCheckbox with the given text for this
143  // implementation.
144  virtual PlotCheckboxPtr checkbox(const casacore::String& str,
145  bool smartDelete = true) const = 0;
146 
147 
148  // PlotItem Objects //
149 
150  // Returns a new instance of a ScatterPlot for this implementation with
151  // the given PlotPointData. IMPORTANT: the returned ScatterPlot should be
152  // of the correct type to handle the given data. For example, if the data
153  // is of type PlotMaskedPointData, the returned scatter plot should be able
154  // to be cast to a MaskedScatterPlot, and similarly for PlotErrorData and
155  // ErrorPlot. If the given data is both masked and error, the returned
156  // plot should be able to handle both as well.
157  virtual ScatterPlotPtr scatterPlot(PlotPointDataPtr data,
158  const casacore::String& title = "Scatter Plot",
159  bool smartDelete = true) const = 0;
160 
161  // Convenience methods for specialized scatter plot and data classes.
162  // Since the scatterPlot method should be able to handle the different
163  // subclasses of data and return something of the proper type, this should
164  // be fine.
165  // DEFAULT IMPLEMENTATION.
166  // <group>
167  virtual MaskedScatterPlotPtr maskedPlot(PlotMaskedPointDataPtr data,
168  const casacore::String& title = "Masked Plot", bool smartDelete= true) const;
169  virtual ErrorPlotPtr errorPlot(PlotErrorDataPtr data,
170  const casacore::String& title = "Error Plot", bool smartDelete= true) const;
171  virtual ColoredPlotPtr coloredPlot(PlotBinnedDataPtr data,
172  const casacore::String& title = "Colored Plot", bool smartDelete=true) const;
173  // </group>
174 
175  // Returns a new instance of a BarPlot for this implementation with the
176  // given PlotPointData and optional title.
177  virtual BarPlotPtr barPlot(PlotPointDataPtr data,
178  const casacore::String& title = "Bar Plot", bool smartDelete= true) const= 0;
179 
180  // Returns a new instance of a BarPlot set to use histogram data for this
181  // implementation with the given PlotSinglePointData and number of bins.
182  // DEFAULT IMPLEMENTATION.
183  virtual BarPlotPtr histogramPlot(PlotSingleDataPtr data,
184  unsigned int numBins, const casacore::String& title = "Histogram Plot",
185  bool smartDelete = true) const;
186 
187  // Returns a new instance of a RasterPlot for this implementation with the
188  // given data and optional title and format.
189  virtual RasterPlotPtr rasterPlot(PlotRasterDataPtr data,
190  const casacore::String& title = "Raster Plot",
191  PlotRasterData::Format format = PlotRasterData::RGB32,
192  bool smartDelete = true) const = 0;
193 
194  // Returns a new instance of a RasterPlot for this implementation with the
195  // given data and contour levels and optional title and format.
196  // DEFAULT IMPLEMENTATION.
197  virtual RasterPlotPtr contourPlot(PlotRasterDataPtr data,
198  const std::vector<double>& contours,
199  const casacore::String& title = "Contour Plot",
200  PlotRasterData::Format format = PlotRasterData::RGB32,
201  bool smartDelete = true) const;
202 
203  // Returns a new instance of a RasterPlot for this implementation
204  // interpreted as a spectrogram with the given data and optional title.
205  // DEFAULT IMPLEMENTATION.
206  virtual RasterPlotPtr spectrogramPlot(PlotRasterDataPtr data,
207  const casacore::String& title = "Spectrogram", bool smartDelete= true) const;
208 
209  // Returns a new instance of a RasterPlot for this implementation
210  // interpreted as a spectrogram with the given data and contour levels and
211  // optional title.
212  // DEFAULT IMPLEMENTATION.
213  virtual RasterPlotPtr contouredSpectrogramPlot(PlotRasterDataPtr data,
214  const std::vector<double>& cont,
215  const casacore::String& title = "Spectrogram Contours",
216  bool smartDelete = true) const;
217 
218  // Return a new instance of a PlotAnnotation for this implementation with
219  // the given text and coordinates.
220  virtual PlotAnnotationPtr annotation(const casacore::String& text,
221  const PlotCoordinate& coord, bool smartDelete = true) const = 0;
222 
223  // Convenience method for return an annotation with the given world
224  // coordinates.
225  // DEFAULT IMPLEMENTATION.
226  virtual PlotAnnotationPtr annotation(const casacore::String& text, double x,
227  double y, bool smartDelete = true) const;
228 
229  // Return a new instance of a PlotShapeRectangle for this implementation
230  // with the given coordinates.
231  virtual PlotShapeRectanglePtr shapeRectangle(const PlotCoordinate& upperLeft,
232  const PlotCoordinate& lowerRight, bool smartDelete= true) const= 0;
233 
234  // Convenience method for returning a rectangle with the given world
235  // coordinates.
236  // DEFAULT IMPLEMENTATION.
237  virtual PlotShapeRectanglePtr shapeRectangle(double left, double top,
238  double right, double bottom, bool smartDelete = true) const;
239 
240  // Return a new instance of a PlotShapeEllipse for this implementation
241  // with the given coordinates and radii.
242  virtual PlotShapeEllipsePtr shapeEllipse(const PlotCoordinate& center,
243  const PlotCoordinate& radii, bool smartDelete = true) const = 0;
244 
245  // Convenience method for returning an ellipse with the given world
246  // coordinates.
247  virtual PlotShapeEllipsePtr shapeEllipse(double x, double y,
248  double xRadius, double yRadius, bool smartDelete = true) const;
249 
250  // Return a new instance of a PlotShapePolygon for this implementation
251  // with the given coordinates.
252  virtual PlotShapePolygonPtr shapePolygon(
253  const std::vector<PlotCoordinate>& coords,
254  bool smartDelete = true) const = 0;
255 
256  // Convenience method for returning a polygon with the given world
257  // coordinates.
258  // DEFAULT IMPLEMENTATION.
259  virtual PlotShapePolygonPtr shapePolygon(const std::vector<double>& x,
260  const std::vector<double>& y, bool smartDelete = true) const;
261 
262  // Returns a new instance of a PlotShapeLine for this implementation
263  // at the given location.
264  virtual PlotShapeLinePtr shapeLine(double location, PlotAxis axis,
265  bool smartDelete = true) const = 0;
266 
267  // Returns a new instance of a PlotShapeArrow for this implementation
268  // at the given coordinates with the given arrow style.
269  virtual PlotShapeArrowPtr shapeArrow(const PlotCoordinate& from,
270  const PlotCoordinate& to, PlotShapeArrow::Style fromArrow =
272  PlotShapeArrow::V_ARROW, bool smartDelete = true) const = 0;
273 
274  // Convenience methods for returning arrows with the given world
275  // coordinates.
276  // DEFAULT IMPLEMENTATION.
277  // <group>
278  virtual PlotShapeArrowPtr shapeArrow(double fromX, double fromY,
279  double toX, double toY, PlotShapeArrow::Style fromArrow =
281  PlotShapeArrow::V_ARROW, bool smartDelete = true) const;
282  virtual PlotShapeArrowPtr shapeLineSegment(const PlotCoordinate& from,
283  const PlotCoordinate& to, bool smartDelete = true) const;
284  virtual PlotShapeArrowPtr shapeLineSegment(double fromX, double fromY,
285  double toX, double toY, bool smartDelete = true) const;
286  // </group>
287 
288  // Returns a new instance of a PlotShapePath for this implementation
289  // with the given coordinates.
290  virtual PlotShapePathPtr shapePath(
291  const std::vector<PlotCoordinate>& coords,
292  bool smartDelete = true) const = 0;
293 
294  // Convenience method for returning a path with the given world
295  // coordinates.
296  // DEFAULT IMPLEMENTATION.
297  virtual PlotShapePathPtr shapePath(const std::vector<double>& x,
298  const std::vector<double>& y, bool smartDelete = true) const;
299 
300  // Returns a new instance of a PlotShapeArc for this implementation
301  // with the given start position, width and height, start angle, and span
302  // angle.
303  virtual PlotShapeArcPtr shapeArc(const PlotCoordinate& start,
304  const PlotCoordinate& widthHeight, int startAngle,
305  int spanAngle, bool smartDelete = true) const = 0;
306 
307  // Returns a new instance of a PlotPoint for this implementation at the
308  // given coordinates.
309  virtual PlotPointPtr point(const PlotCoordinate& coord,
310  bool smartDelete = true) const = 0;
311 
312  // Convenience methods for returning a point with the given world
313  // coordinates.
314  // DEFAULT IMPLEMENTATION.
315  // <group>
316  virtual PlotPointPtr point(double x, double y, bool smartDelete=true)const;
317  virtual PlotPointPtr point(float x, float y, bool smartDelete= true) const;
318  virtual PlotPointPtr point(int x, int y, bool smartDelete = true) const;
319  virtual PlotPointPtr point(unsigned int x, unsigned int y,
320  bool smartDelete = true) const;
321  // </group>
322 
323 
324  // Customization Objects //
325 
326  // Color could be a name (i.e. "black") or a hex value (i.e. "000000").
327  virtual PlotColorPtr color(const casacore::String& color,
328  bool smartDelete = true) const = 0;
329 
330  // Make a copy of the given color for this implementation.
331  virtual PlotColorPtr color(const PlotColor& copy,
332  bool smartDelete = true) const = 0;
333 
334  // Convenience method for returning a copy of the given color.
335  // DEFAULT IMPLEMENTATION.
336  virtual PlotColorPtr color(const PlotColorPtr copy,
337  bool smartDelete = true) const;
338 
339  // Returns a list of all the named colors that the implementation supports.
340  virtual std::vector<casacore::String> allNamedColors() const = 0;
341 
342  // Return a new font with the given characteristics. Color can either be
343  // in hexadecimal form or name form.
344  virtual PlotFontPtr font(const casacore::String& family = "Arial",
345  double pointSize = 12, const casacore::String& color = "000000",
346  bool bold = false, bool italics = false,
347  bool underline = false, bool smartDelete = true) const = 0;
348 
349  // Make a copy of the given font for this implementation.
350  virtual PlotFontPtr font(const PlotFont& copy,
351  bool smartDelete = true) const = 0;
352 
353  // Convenience method for returning a copy of the given font.
354  // DEFAULT IMPLEMENTATION.
355  virtual PlotFontPtr font(const PlotFontPtr copy,
356  bool smartDelete = true) const;
357 
358  // Returns a new area fill with the given color and pattern. Color can
359  // either be in hexadecimal form or name form.
360  virtual PlotAreaFillPtr areaFill(const casacore::String& color,
362  bool smartDelete = true) const = 0;
363 
364  // Returns a copy of the given area fill for this implementation.
365  virtual PlotAreaFillPtr areaFill(const PlotAreaFill& copy,
366  bool smartDelete = true) const = 0;
367 
368  // Convenience method for returning a copy of the given area fill.
369  // DEFAULT IMPLEMENTATION.
370  virtual PlotAreaFillPtr areaFill(const PlotAreaFillPtr copy,
371  bool smartDelete = true) const;
372 
373  // Returns a new line with the given color, style, and width. Color can
374  // either be in hexadecimal form or name form.
375  virtual PlotLinePtr line(const casacore::String& color,
376  PlotLine::Style style = PlotLine::SOLID, double width = 1.0,
377  bool smartDelete = true) const = 0;
378 
379  // Make a copy of the given line for this implementation.
380  virtual PlotLinePtr line(const PlotLine& copy,
381  bool smartDelete = true) const = 0;
382 
383  // Convenience method for returning a copy of the given line.
384  // DEFAULT IMPLEMENTATION.
385  virtual PlotLinePtr line(const PlotLinePtr copy,
386  bool smartDelete = true) const;
387  virtual PlotSymbolPtr createSymbol (const casacore::String& descriptor, int size, const casacore::String& color,
388  const casacore::String& fillPattern, bool outline );
389  // Returns a new symbol with the given style.
391  bool smartDelete = true) const = 0;
392 
393  // Returns a new symbol with the given character.
394  // DEFAULT IMPLEMENTATION.
395  virtual PlotSymbolPtr symbol(char sym, bool smartDelete = true) const;
396 
397  // Return a new symbol with the given unicode #.
398  // DEFAULT IMPLEMENTATION.
399  virtual PlotSymbolPtr uSymbol(unsigned short unicode,
400  bool smartDelete = true) const;
401 
402  // Make a copy of the given symbol for this implementation.
403  virtual PlotSymbolPtr symbol(const PlotSymbol& copy,
404  bool smartDelete = true) const = 0;
405 
406  // Convenience method for returning a copy of the given symbol.
407  // DEFAULT IMPLEMENTATION.
408  virtual PlotSymbolPtr symbol(const PlotSymbolPtr copy,
409  bool smartDelete = true) const;
410 
411 
412  // Tool Objects //
413 
414  // Returns a standard mouse tool group for this implementation.
415  // DEFAULT IMPLEMENTATION.
416  virtual PlotStandardMouseToolGroupPtr standardMouseTools(
418  bool smartDelete = true) const;
419 
420  // Returns a standard mouse tool group for this implementation on the given
421  // axes.
422  // DEFAULT IMPLEMENTATION.
423  virtual PlotStandardMouseToolGroupPtr standardMouseTools(PlotAxis xAxis,
424  PlotAxis yAxis, PlotCoordinate::System sys,
426  bool smartDelete = true) const;
427 
428  // Returns tools for this implementation. Implementations that provide
429  // their own PlotTool subclasses should override these methods.
430  // DEFAULT IMPLEMENTATION.
431  // <group>
432  virtual PlotSelectToolPtr selectTool(bool smartDelete = true) const;
433  virtual PlotZoomToolPtr zoomTool(bool smartDelete = true) const;
434  virtual PlotPanToolPtr panTool(bool smartDelete = true) const;
435  virtual PlotFlagAllToolPtr flagAllTool(bool smartDelete = true) const;
436  virtual PlotTrackerToolPtr trackerTool(bool smartDelete = true) const;
437  virtual PlotSelectToolPtr selectTool(PlotAxis xAxis, PlotAxis yAxis,
438  PlotCoordinate::System system, bool smartDelete = true) const;
439  virtual PlotZoomToolPtr zoomTool(PlotAxis xAxis, PlotAxis yAxis,
440  PlotCoordinate::System system, bool smartDelete = true) const;
441  virtual PlotPanToolPtr panTool(PlotAxis xAxis, PlotAxis yAxis,
442  PlotCoordinate::System system, bool smartDelete = true) const;
443  virtual PlotFlagAllToolPtr flagAllTool(PlotAxis xAxis, PlotAxis yAxis,
444  PlotCoordinate::System system, bool smartDelete = true) const;
445  virtual PlotTrackerToolPtr trackerTool(PlotAxis xAxis, PlotAxis yAxis,
446  PlotCoordinate::System system, bool smartDelete = true) const;
447  // </group>
448 
449 
450  // Operations //
451 
452  // Returns a new PlotMutex for this implementation.
453  virtual PlotMutexPtr mutex(bool smartDelete = true) const = 0;
454 
455 
456  // casacore::Data Objects //
457 
458 // Macro for method declarations for different permutations of the default data
459 // objects for different types.
460 #define PF_DATA_DEC(TYPE) \
461  virtual PlotPointDataPtr data(TYPE *& y, unsigned int n, \
462  bool shouldDelete = true) const; \
463  virtual PlotPointDataPtr data(casacore::Vector< TYPE >& y, \
464  bool shouldDelete = false) const; \
465  virtual PlotPointDataPtr data(std::vector< TYPE >& y, \
466  bool shouldDelete = false) const; \
467  virtual PlotPointDataPtr data(TYPE *& x, TYPE *& y, unsigned int n, \
468  bool shouldDelete = true) const; \
469  virtual PlotPointDataPtr data(casacore::Vector< TYPE >& x, casacore::Vector< TYPE >& y, \
470  bool shouldDelete = false) const; \
471  virtual PlotPointDataPtr data(std::vector< TYPE >& x, std::vector< TYPE >& y, \
472  bool shouldDelete = false) const; \
473  virtual PlotSingleDataPtr singleData(TYPE *& data, unsigned int n, \
474  bool shouldDelete = true) const; \
475  virtual PlotSingleDataPtr singleData(casacore::Vector< TYPE >& data, \
476  bool shouldDelete = false) const; \
477  virtual PlotSingleDataPtr singleData(std::vector< TYPE >& data, \
478  bool shouldDelete = false) const; \
479  virtual PlotPointDataPtr histogramData(TYPE *& data, unsigned int n, \
480  unsigned int numBins, bool shouldDel = true) const; \
481  virtual PlotPointDataPtr histogramData(std::vector< TYPE >& data, \
482  unsigned int numBins, bool shouldDel = false) const; \
483  virtual PlotPointDataPtr histogramData(casacore::Vector< TYPE >& data, \
484  unsigned int numBins, bool shouldDel = false) const; \
485  virtual PlotMaskedPointDataPtr data(TYPE *& x, TYPE*& y, bool*& mask, \
486  unsigned int n, bool shouldDelete = true) const; \
487  virtual PlotMaskedPointDataPtr data(casacore::Vector< TYPE >& x, casacore::Vector< TYPE >& y, \
488  casacore::Vector<bool>& mask, bool shouldDelete = true) const; \
489  virtual PlotMaskedPointDataPtr data(std::vector< TYPE >& x, std::vector< TYPE >& y, \
490  std::vector<bool>& mask, bool shouldDelete = true) const; \
491  virtual PlotErrorDataPtr data(TYPE *& x, TYPE *& y, unsigned int n, \
492  TYPE xLeftError, TYPE xRightError, TYPE yBottomError, \
493  TYPE yTopError, bool shouldDelete = true) const; \
494  virtual PlotErrorDataPtr data(casacore::Vector< TYPE >& x, casacore::Vector< TYPE >& y, \
495  TYPE xLeftError, TYPE xRightError, TYPE yBottomError, \
496  TYPE yTopError, bool shouldDelete = true) const; \
497  virtual PlotErrorDataPtr data(std::vector< TYPE >& x, std::vector< TYPE >& y, \
498  TYPE xLeftError, TYPE xRightError, TYPE yBottomError, \
499  TYPE yTopError, bool shouldDelete = true) const; \
500  virtual PlotErrorDataPtr data(TYPE *& x, TYPE *& y, TYPE *& xLeftError, \
501  TYPE *& xRightError, TYPE *& yBottomError, TYPE *& yTopError, \
502  unsigned int n, bool shouldDelete = true) const; \
503  virtual PlotErrorDataPtr data(casacore::Vector< TYPE >& x, casacore::Vector< TYPE >& y, \
504  casacore::Vector< TYPE >& xLeftError, casacore::Vector< TYPE >& xRightError, \
505  casacore::Vector< TYPE >& yBottomError, casacore::Vector< TYPE >& yTopError, \
506  bool shouldDelete = false) const; \
507  virtual PlotErrorDataPtr data(std::vector< TYPE >& x, std::vector< TYPE >& y, \
508  std::vector< TYPE >& xLeftError, std::vector< TYPE >& xRightError, \
509  std::vector< TYPE >& yBottomError, std::vector< TYPE >& yTopError, \
510  bool shouldDelete = false) const; \
511  virtual PlotRasterDataPtr data(casacore::Matrix< TYPE >& data, \
512  bool shouldDelete = false) const; \
513  virtual PlotRasterDataPtr data(casacore::Matrix< TYPE >& data, double fromX, \
514  double toX, double fromY, double toY, \
515  bool shouldDelete = false) const;
516 
517  // Returns data objects for doubles.
518  // DEFAULT IMPLEMENTATION.
519  // <group>
520  PF_DATA_DEC(double)
521  // </group>
522 
523  // Returns data objects for floats.
524  // DEFAULT IMPLEMENTATION.
525  // <group>
526  PF_DATA_DEC(float)
527  // </group>
528 
529  // Returns data objects for ints.
530  // DEFAULT IMPLEMENTATION.
531  // <group>
532  PF_DATA_DEC(int)
533  // </group>
534 
535  // Returns data objects for unsigned ints.
536  // DEFAULT IMPLEMENTATION.
537  // <group>
538  PF_DATA_DEC(unsigned int)
539  // </group>
540 
541  // Returns a histogram data object for the given PlotSingleData and number
542  // of bins.
543  // DEFAULT IMPLEMENTATION.
544  virtual PlotPointDataPtr histogramData(PlotSingleDataPtr data,
545  unsigned int numBins) const;
546 };
548 
549 }
550 
551 #endif /*PLOTFACTORY_H_*/
virtual Plotter::Implementation implementation() const =0
Return which implementation this factory is producing.
static const int NO_EVENTS
No events.
Definition: PlotLogger.h:361
virtual PlotStandardMouseToolGroupPtr standardMouseTools(ToolCode activeTool=NONE_TOOL, bool smartDelete=true) const
Tool Objects //.
virtual PlotShapeArrowPtr shapeArrow(const PlotCoordinate &from, const PlotCoordinate &to, PlotShapeArrow::Style fromArrow=PlotShapeArrow::NOARROW, PlotShapeArrow::Style toArrow=PlotShapeArrow::V_ARROW, bool smartDelete=true) const =0
Returns a new instance of a PlotShapeArrow for this implementation at the given coordinates with the ...
virtual PlotPanToolPtr panTool(bool smartDelete=true) const
virtual RasterPlotPtr contourPlot(PlotRasterDataPtr data, const std::vector< double > &contours, const casacore::String &title="Contour Plot", PlotRasterData::Format format=PlotRasterData::RGB32, bool smartDelete=true) const
Returns a new instance of a RasterPlot for this implementation with the given data and contour levels...
PlotMouseToolPtr activeTool() const
Returns the currently active tool, or NULL for none.
Definition: PlotTool.h:790
virtual std::vector< casacore::String > allNamedColors() const =0
Returns a list of all the named colors that the implementation supports.
virtual PlotPointDataPtr histogramData(PlotSingleDataPtr data, unsigned int numBins) const
Returns data objects for doubles.
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
virtual PlotSymbolPtr symbol(PlotSymbol::Symbol style, bool smartDelete=true) const =0
Returns a new symbol with the given style.
virtual PlotShapeEllipsePtr shapeEllipse(const PlotCoordinate &center, const PlotCoordinate &radii, bool smartDelete=true) const =0
Return a new instance of a PlotShapeEllipse for this implementation with the given coordinates and ra...
virtual PlotShapeArrowPtr shapeLineSegment(const PlotCoordinate &from, const PlotCoordinate &to, bool smartDelete=true) const
virtual ~PlotFactory()
Destructor.
virtual RasterPlotPtr spectrogramPlot(PlotRasterDataPtr data, const casacore::String &title="Spectrogram", bool smartDelete=true) const
Returns a new instance of a RasterPlot for this implementation interpreted as a spectrogram with the ...
SMART POINTER DEFINITIONS PlotItemPtr PlotShapeLinePtr
Definition: PlotShape.h:378
virtual PlotShapeArcPtr shapeArc(const PlotCoordinate &start, const PlotCoordinate &widthHeight, int startAngle, int spanAngle, bool smartDelete=true) const =0
Returns a new instance of a PlotShapeArc for this implementation with the given start position...
virtual PlotCanvasPtr canvas(bool smartDelete=true) const =0
Return a new instance of a PlotCanvas for this implementation.
virtual int execLoop()=0
Execution Methods //.
virtual MaskedScatterPlotPtr maskedPlot(PlotMaskedPointDataPtr data, const casacore::String &title="Masked Plot", bool smartDelete=true) const
Convenience methods for specialized scatter plot and data classes.
virtual bool canvasHasCachedAxesStack() const =0
Returns true if this implementation&#39;s PlotCanvas subclass has a cached axes stack, false otherwise.
Abstract class for area fill.
Definition: PlotOptions.h:296
virtual PlotShapePolygonPtr shapePolygon(const std::vector< PlotCoordinate > &coords, bool smartDelete=true) const =0
Return a new instance of a PlotShapePolygon for this implementation with the given coordinates...
Style
Arrow style.
Definition: PlotShape.h:214
virtual bool canvasHasThreadedDrawing() const =0
Support Methods //.
The idea behind a plot factory is to produce classes that are useful to the underlying implementation...
Definition: PlotFactory.h:52
Pattern
Pattern enum, similar in spirit to http://doc.trolltech.com/4.3/qt.html#BrushStyle-enum.
Definition: PlotOptions.h:300
SMART POINTER DEFINITIONS PlotShapeEllipsePtr
Definition: PlotShape.h:374
virtual PlotMutexPtr mutex(bool smartDelete=true) const =0
Operations //.
size_t size() const
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1444
virtual BarPlotPtr histogramPlot(PlotSingleDataPtr data, unsigned int numBins, const casacore::String &title="Histogram Plot", bool smartDelete=true) const
Returns a new instance of a BarPlot set to use histogram data for this implementation with the given ...
SMART POINTER DEFINITIONS *typedef casacore::CountedPtr< PlotPanel > PlotPanelPtr
Definition: PlotPanel.h:188
virtual PlotCheckboxPtr checkbox(const casacore::String &str, bool smartDelete=true) const =0
Return a new instance of a PlotCheckbox with the given text for this implementation.
virtual PlotSymbolPtr createSymbol(const casacore::String &descriptor, int size, const casacore::String &color, const casacore::String &fillPattern, bool outline)
virtual ColoredPlotPtr coloredPlot(PlotBinnedDataPtr data, const casacore::String &title="Colored Plot", bool smartDelete=true) const
Abstract class for a line.
Definition: PlotOptions.h:368
virtual ErrorPlotPtr errorPlot(PlotErrorDataPtr data, const casacore::String &title="Error Plot", bool smartDelete=true) const
Implementation
Static //.
Definition: Plotter.h:48
virtual ScatterPlotPtr scatterPlot(PlotPointDataPtr data, const casacore::String &title="Scatter Plot", bool smartDelete=true) const =0
PlotItem Objects //.
Style
Static //.
Definition: PlotOptions.h:373
PlotAxis
Enum for the four plot axes.
Definition: PlotOptions.h:62
SMART POINTER DEFINITIONS PlotItemPtr PlotItemPtr PlotShapePathPtr
Definition: PlotShape.h:382
virtual PlotButtonPtr button(const casacore::String &str, bool isText=true, bool toggleable=false, bool smartDelete=true) const =0
Return a new instance of a PlotButton with the given text for this implementation.
Abstract class for a symbol.
Definition: PlotOptions.h:451
virtual PlotAnnotationPtr annotation(const casacore::String &text, const PlotCoordinate &coord, bool smartDelete=true) const =0
Return a new instance of a PlotAnnotation for this implementation with the given text and coordinates...
virtual PlotLinePtr line(const casacore::String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0, bool smartDelete=true) const =0
Returns a new line with the given color, style, and width.
#define PF_DATA_DEC(TYPE)
casacore::Data Objects //
Definition: PlotFactory.h:460
ScatterPlotPtr
Definition: Plot.h:598
virtual PlotFontPtr font(const casacore::String &family="Arial", double pointSize=12, const casacore::String &color="000000", bool bold=false, bool italics=false, bool underline=false, bool smartDelete=true) const =0
Return a new font with the given characteristics.
virtual PlotTrackerToolPtr trackerTool(bool smartDelete=true) const
MaskedScatterPlotPtr
Definition: Plot.h:598
Symbol
Static //.
Definition: PlotOptions.h:456
virtual BarPlotPtr barPlot(PlotPointDataPtr data, const casacore::String &title="Bar Plot", bool smartDelete=true) const =0
Returns a new instance of a BarPlot for this implementation with the given PlotPointData and optional...
virtual bool canvasHasCachedLayerDrawing() const =0
Returns true if this implementation&#39;s PlotCanvas subclass supports cached layer drawing, false otherwise.
virtual PlotShapeRectanglePtr shapeRectangle(const PlotCoordinate &upperLeft, const PlotCoordinate &lowerRight, bool smartDelete=true) const =0
Return a new instance of a PlotShapeRectangle for this implementation with the given coordinates...
virtual PlotShapePathPtr shapePath(const std::vector< PlotCoordinate > &coords, bool smartDelete=true) const =0
Returns a new instance of a PlotShapePath for this implementation with the given coordinates.
virtual PlotterPtr plotter(const casacore::String &windowTitle="Plotter", bool showSingleCanvas=true, bool showGUI=true, int logEventFlags=PlotLogger::NO_EVENTS, bool smartDelete=true) const =0
GUI Objects //.
virtual PlotPointPtr point(const PlotCoordinate &coord, bool smartDelete=true) const =0
Returns a new instance of a PlotPoint for this implementation at the given coordinates.
virtual PlotAreaFillPtr areaFill(const casacore::String &color, PlotAreaFill::Pattern pattern=PlotAreaFill::FILL, bool smartDelete=true) const =0
Returns a new area fill with the given color and pattern.
virtual PlotSelectToolPtr selectTool(bool smartDelete=true) const
Returns tools for this implementation.
virtual PlotPanelPtr panel(bool smartDelete=true) const =0
Return a new instance of a PlotPanel for this implementation.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual PlotShapeLinePtr shapeLine(double location, PlotAxis axis, bool smartDelete=true) const =0
Returns a new instance of a PlotShapeLine for this implementation at the given location.
virtual PlotSymbolPtr uSymbol(unsigned short unicode, bool smartDelete=true) const
Return a new symbol with the given unicode #.
virtual RasterPlotPtr contouredSpectrogramPlot(PlotRasterDataPtr data, const std::vector< double > &cont, const casacore::String &title="Spectrogram Contours", bool smartDelete=true) const
Returns a new instance of a RasterPlot for this implementation interpreted as a spectrogram with the ...
Abstract class for fonts.
Definition: PlotOptions.h:200
virtual PlotZoomToolPtr zoomTool(bool smartDelete=true) const
PlotItemPtr ColoredPlotPtr
Definition: Plot.h:602
virtual unsigned int numBins() const =0
ABSTRACT METHODS //.
virtual PlotFlagAllToolPtr flagAllTool(bool smartDelete=true) const
ToolCode
Definition: PlotTool.h:233
virtual PlotColorPtr color(const casacore::String &color, bool smartDelete=true) const =0
Customization Objects //.
virtual RasterPlotPtr rasterPlot(PlotRasterDataPtr data, const casacore::String &title="Raster Plot", PlotRasterData::Format format=PlotRasterData::RGB32, bool smartDelete=true) const =0
Returns a new instance of a RasterPlot for this implementation with the given data and optional title...
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
PlotFactory()
Constructor.