casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Plot.h
Go to the documentation of this file.
1 //# Plot.h: Plot objects to be drawn on a canvas.
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 PLOT_H_
28 #define PLOT_H_
29 
32 
33 #include <casa/BasicSL/String.h>
34 
35 namespace casa {
36 
37 // A Plot basically consists of data and customization information. The data
38 // is held by the base class whereas any customization should be handled in
39 // subclasses.
40 class Plot : public virtual PlotItem {
41 public:
42  Plot() { }
43 
44  virtual ~Plot() { }
45 
46 
47  // ABSTRACT METHODS //
48 
49  // Returns the data associated with this plot.
50  virtual PlotDataPtr data() const = 0;
51 
52  // Should be called whenever the underlying PlotData has changed, to let
53  // the plot and its attached canvas know that the plot needs to be redrawn.
54  virtual void dataChanged() = 0;
55 
56  // It's likely that any plot subclass (scatter, bar, function, etc.) will
57  // have lines of some sort, so it's safe to have in the base class.
58 
59  // Returns true if this plot has lines shown, false otherwise.
60  virtual bool linesShown() const = 0;
61 
62  // Sets whether or not lines are shown. If linesShown is true, the
63  // implementation can decide whether to choose the line style shown, or
64  // just use the last set PlotLine.
65  virtual void setLinesShown(bool linesShown = true) = 0;
66 
67  // Returns a copy of the line used for this plot. Note: if lines are not
68  // shown, then this behavior is undefined. The last shown line can be
69  // returned, or a line with style NOLINE, or a null pointer, or....
70  virtual PlotLinePtr line() const = 0;
71 
72  // Sets the plot lines to the given line. Implies setLinesShown(true)
73  // unless the given line's style is set to NOLINE.
74  virtual void setLine(const PlotLine& line) = 0;
75 
76 
77  // IMPLEMENTED METHODS //
78 
79  // Convenience methods for setting line.
80  // <group>
81  virtual void setLine(const PlotLinePtr line) {
82  if(!line.null()) setLine(*line);
83  else setLinesShown(false);
84  }
85  virtual void setLine(const casacore::String& color,
87  double width = 1.0) {
88  PlotLinePtr l = line();
89  l->setColor(color);
90  l->setStyle(style);
91  l->setWidth(width);
92  setLine(*l);
93  }
94  virtual void setLineColor(const casacore::String& color) {
95  PlotLinePtr l = line();
96  l->setColor(color);
97  setLine(*l);
98  }
99  virtual void setLineStyle(PlotLine::Style style) {
100  PlotLinePtr l = line();
101  l->setStyle(style);
102  setLine(*l);
103  }
104  virtual void setLineWidth(double width) {
105  PlotLinePtr l = line();
106  l->setWidth(width);
107  setLine(*l);
108  }
109  // </group>
110 };
111 
112 
113 // Scatter plot abstract class. In addition to the abstract methods in Plot, a
114 // scatter plot subclass should also have symbol customization for the points.
115 // A scatter plot is expected to consist of PlotPointData.
116 class ScatterPlot : public virtual Plot {
117 public:
119 
120  virtual ~ScatterPlot() { }
121 
122 
123  // Overrides Plot::data().
124  virtual PlotDataPtr data() const { return pointData(); }
125 
126  // Returns the data value at the given index. Just a thin layer over the
127  // PlotPointData functionality.
128  virtual ppoint_t pointAt(unsigned int i) const {
129  PlotPointDataPtr data = pointData();
130  if(!data.null()) return ppoint_t(data->xAt(i), data->yAt(i));
131  else return ppoint_t(0, 0);
132  }
133 
134  // Implements PlotItem::drawCount(). Provides default implementation that
135  // returns the number of plotted points.
136  virtual unsigned int drawCount() const { return pointData()->size(); }
137 
138 
139  // ABSTRACT METHODS //
140 
141  // Returns the point data used for this plot.
142  virtual PlotPointDataPtr pointData() const = 0;
143 
144  // Get/set to connect points in step rather than line
145  virtual bool linesStep() const = 0;
146  virtual void setLinesStep(bool linesStep = true) = 0;
147 
148  // Returns true if symbols are shown, false otherwise.
149  virtual bool symbolsShown() const = 0;
150 
151  // Sets whether symbols are shown or not. If symbolsShown is true, the
152  // implementation can decide whether to choose the symbol shown, or just
153  // use the last set PlotSymbol.
154  virtual void setSymbolsShown(bool symbolsShown = true) = 0;
155 
156  // Returns a copy of the symbol for this plot. Note: if symbols are not
157  // shown, then this behavior is undefined. The last shown symbol can be
158  // returned, or a symbol with style NOSYMBOL, or a null pointer, or....
159  virtual PlotSymbolPtr symbol() const = 0;
160 
161  // Sets the plot symbols to the given symbol. Implies setSymbolsShown(true)
162  // unless the symbol's style is set to NOSYMBOL.
163  virtual void setSymbol(const PlotSymbol& symbol) = 0;
164 
165 
166  // IMPLEMENTED METHODS //
167 
168  // Convenience methods for setting symbol.
169  // <group>
170  virtual void setSymbol(const PlotSymbolPtr symbol) {
171  if(!symbol.null()) setSymbol(*symbol);
172  else setSymbolsShown(false);
173  }
174  virtual void setSymbol(PlotSymbol::Symbol s) {
175  PlotSymbolPtr sym = symbol();
176  sym->setSymbol(s);
177  setSymbol(*sym);
178  }
179  virtual void setSymbol(char s) {
180  PlotSymbolPtr sym = symbol();
181  sym->setSymbol(s);
182  setSymbol(*sym);
183  }
184  virtual void setSymbolSize(double width, double height) {
185  PlotSymbolPtr sym = symbol();
186  sym->setSize(width, height);
187  setSymbol(*sym);
188  }
189  virtual void setSymbolLine(const PlotLine& line) {
190  PlotSymbolPtr sym = symbol();
191  sym->setLine(line);
192  setSymbol(*sym);
193  }
194  virtual void setSymbolLine(const PlotLinePtr line) {
195  if(!line.null()) setSymbolLine(*line); }
196  virtual void setSymbolLine(const casacore::String& color,
197  PlotLine::Style style = PlotLine::SOLID, double width = 1.0) {
198  PlotSymbolPtr sym = symbol();
199  sym->setLine(color, style, width);
200  setSymbol(*sym);
201  }
202  virtual void setSymbolAreaFill(const PlotAreaFill& fill) {
203  PlotSymbolPtr sym = symbol();
204  sym->setAreaFill(fill);
205  setSymbol(*sym);
206  }
207  virtual void setSymbolAreaFill(const PlotAreaFillPtr fill) {
208  if(!fill.null()) setSymbolAreaFill(*fill); }
211  PlotSymbolPtr sym = symbol();
212  sym->setAreaFill(color, pattern);
213  setSymbol(*sym);
214  }
215  // </group>
216 };
217 
218 
219 // Subclass of ScatterPlot that adds masking functionality. The ScatterPlot
220 // customization methods (lines, symbols, etc.) are expected to apply only to
221 // unmasked data, while additional methods are provided in MaskedScatterPlot
222 // to customize the masked data (which is not shown by default).
223 class MaskedScatterPlot : public virtual ScatterPlot {
224 public:
226 
227  virtual ~MaskedScatterPlot() { }
228 
229 
230  // Overrides ScatterPlot::pointData().
231  virtual PlotPointDataPtr pointData() const { return maskedData(); }
232 
233  // Returns whether the data at the given index is masked or not. Just a
234  // thin layer over the PlotMaskedPointData functionality.
235  virtual bool maskedAt(unsigned int index) const {
236  PlotMaskedPointDataPtr data = maskedData();
237  return !data.null() && data->maskedAt(index);
238  }
239 
240 
241  // ABSTRACT METHODS //
242 
243  // Returns the masked data used for this plot.
244  virtual PlotMaskedPointDataPtr maskedData() const = 0;
245  virtual void clearData() = 0;
246 
247  // Returns true if this plot has lines shown for masked points, false
248  // otherwise.
249  virtual bool maskedLinesShown() const = 0;
250 
251  // Sets whether or not lines are shown for masked points. If linesShown is
252  // true, the implementation can decide whether to choose the line style
253  // shown, or just use the last set PlotLine.
254  virtual void setMaskedLinesShown(bool linesShown = true) = 0;
255 
256  // Returns a copy of the line used for masked points. Note: if lines are
257  // not shown, then this behavior is undefined. The last shown line can be
258  // returned, or a line with style NOLINE, or a null pointer, or....
259  virtual PlotLinePtr maskedLine() const = 0;
260 
261  // Sets the lines for masked points to the given. Implies
262  // setMaskedLinesShown(true) unless the given line's style is set to
263  // NOLINE.
264  virtual void setMaskedLine(const PlotLine& line) = 0;
265 
266  // Convenience methods for setting line for masked points.
267  // <group>
268  virtual void setMaskedLine(const PlotLinePtr line) {
269  if(!line.null()) setMaskedLine(*line);
270  else setMaskedLinesShown(false);
271  }
272  virtual void setMaskedLine(const casacore::String& color,
274  double width = 1.0) {
275  PlotLinePtr l = maskedLine();
276  l->setColor(color);
277  l->setStyle(style);
278  l->setWidth(width);
279  setMaskedLine(*l);
280  }
282  PlotLinePtr l = maskedLine();
283  l->setColor(color);
284  setMaskedLine(*l);
285  }
286  virtual void setMaskedLineStyle(PlotLine::Style style) {
287  PlotLinePtr l = maskedLine();
288  l->setStyle(style);
289  setMaskedLine(*l);
290  }
291  virtual void setMaskedLineWidth(double width) {
292  PlotLinePtr l = maskedLine();
293  l->setWidth(width);
294  setMaskedLine(*l);
295  }
296  // Get/set connect masked points in step rather than line
297  virtual bool maskedLinesStep() const = 0;
298  virtual void setMaskedLinesStep(bool linesStep = true) = 0;
299 
300  // </group>
301 
302  // Returns true if symbols are shown for masked points, false otherwise.
303  virtual bool maskedSymbolsShown() const = 0;
304 
305  // Sets whether symbols are shown or not for masked points. If
306  // symbolsShown is true, the implementation can decide whether to choose
307  // the symbol shown, or just use the last set PlotSymbol.
308  virtual void setMaskedSymbolsShown(bool symbolsShown = true) = 0;
309 
310  // Returns a copy of the symbol for masked points. Note: if symbols are
312  // be returned, or a symbol with style NOSYMBOL, or a null pointer, or....
313  virtual PlotSymbolPtr maskedSymbol() const = 0;
314 
315  // Sets the symbols for masked points to the given. Implies
316  // setMaskedSymbolsShown(true) unless the symbol's style is set to
317  // NOSYMBOL.
318  virtual void setMaskedSymbol(const PlotSymbol& symbol) = 0;
319 
320  // Convenience methods for setting symbol for masked points.
321  // <group>
322  virtual void setMaskedSymbol(const PlotSymbolPtr symbol) {
323  if(!symbol.null()) setMaskedSymbol(*symbol);
324  else setMaskedSymbolsShown(false);
325  }
327  PlotSymbolPtr sym = maskedSymbol();
328  sym->setSymbol(s);
329  setMaskedSymbol(*sym);
330  }
331  virtual void setMaskedSymbol(char s) {
332  PlotSymbolPtr sym = maskedSymbol();
333  sym->setSymbol(s);
334  setMaskedSymbol(*sym);
335  }
336  virtual void setMaskedSymbolSize(double width, double height) {
337  PlotSymbolPtr sym = maskedSymbol();
338  sym->setSize(width, height);
339  setMaskedSymbol(*sym);
340  }
341  virtual void setMaskedSymbolLine(const PlotLine& line) {
342  PlotSymbolPtr sym = maskedSymbol();
343  sym->setLine(line);
344  setMaskedSymbol(*sym);
345  }
346  virtual void setMaskedSymbolLine(const PlotLinePtr line) {
347  if(!line.null()) setMaskedSymbolLine(*line); }
349  PlotLine::Style style = PlotLine::SOLID, double width = 1.0) {
350  PlotSymbolPtr sym = maskedSymbol();
351  sym->setLine(color, style, width);
352  setMaskedSymbol(*sym);
353  }
354  virtual void setMaskedSymbolAreaFill(const PlotAreaFill& fill) {
355  PlotSymbolPtr sym = maskedSymbol();
356  sym->setAreaFill(fill);
357  setMaskedSymbol(*sym);
358  }
359  virtual void setMaskedSymbolAreaFill(const PlotAreaFillPtr fill) {
360  if(!fill.null()) setMaskedSymbolAreaFill(*fill); }
363  PlotSymbolPtr sym = maskedSymbol();
364  sym->setAreaFill(color, pattern);
365  setMaskedSymbol(*sym);
366  }
367  // </group>
368 };
369 
370 
371 // An error plot is a scatter plot with error bars drawn. It is expected to
372 // consist of PlotErrorData.
373 class ErrorPlot : public virtual ScatterPlot {
374 public:
375  ErrorPlot() { }
376 
377  virtual ~ErrorPlot() { }
378 
379 
380  // Overrides ScatterPlot::pointData().
381  virtual PlotPointDataPtr pointData() const { return errorData(); }
382 
383 
384  // ABSTRACT METHODS //
385 
386  // Returns the error data used for this plot.
387  virtual PlotErrorDataPtr errorData() const = 0;
388 
389  // Returns whether the error bar line is shown or not.
390  virtual bool errorLineShown() const = 0;
391 
392  // Sets whether the error bar line is shown. If show is true, the
393  // implementation can decide whether to choose the line shown, or just
394  // use the last set PlotLine.
395  virtual void setErrorLineShown(bool show = true) = 0;
396 
397  // Returns the line used to draw the error bars.
398  virtual PlotLinePtr errorLine() const = 0;
399 
400  // Sets the line used to draw the error bars.
401  virtual void setErrorLine(const PlotLine& line) = 0;
402 
403  // Convenience methods for setting error line.
404  // <group>
405  virtual void setErrorLine(const PlotLinePtr line) {
406  if(!line.null()) setErrorLine(*line);
407  else setErrorLineShown(false);
408  }
409  virtual void setErrorLine(const casacore::String& color,
411  double width = 1.0) {
413  line->setColor(color);
414  line->setStyle(style);
415  line->setWidth(width);
416  setErrorLine(*line);
417  }
418  virtual void setErrorLineColor(const casacore::String& color) {
420  line->setColor(color);
421  setErrorLine(*line);
422  }
423  virtual void setErrorLineStyle(PlotLine::Style style) {
425  line->setStyle(style);
426  setErrorLine(*line);
427  }
428  virtual void setErrorLineWidth(double width) {
430  line->setWidth(width);
431  setErrorLine(*line);
432  }
433  // </group>
434 
435  // Returns the "cap" size of the error bar. The cap is the perpendicular
436  // line at the end of the error bar (that makes the error bar look like an
437  // I rather than a |).
438  virtual unsigned int errorCapSize() const = 0;
439 
440  // Sets the error bar cap size in pixels.
441  virtual void setErrorCapSize(unsigned int capSize) = 0;
442 };
443 
444 
445 // An color plot is a scatter plot with differentiated colors for points in
446 // different bins. It is expected to consist of PlotBinnedData.
447 class ColoredPlot : public virtual ScatterPlot {
448 public:
449  // Constructor.
451 
452  // Destructor.
453  virtual ~ColoredPlot() { }
454 
455 
456  // Overrides ScatterPlot::pointData().
457  virtual PlotPointDataPtr pointData() const { return binnedColorData(); }
458 
459 
460  // ABSTRACT METHODS //
461 
462  // Returns the binned data used for this plot.
463  virtual PlotBinnedDataPtr binnedColorData() const = 0;
464 
465  // Returns the color to use for the bin at the given index. The color
466  // applies to the symbol fill color.
467  virtual PlotColorPtr colorForBin(unsigned int bin) const = 0;
468 
469  // Sets the color to use for the bin at the given index. The color applies
470  // to the symbol fill color.
471  virtual void setColorForBin(unsigned int bin, const PlotColorPtr color) = 0;
472 };
473 
474 
475 // Bar plot abstract class. It is expected to take data in the form of
476 // PlotPointData. The line methods in Plot are used for the bar outlines.
477 class BarPlot : public virtual Plot {
478 public:
479  BarPlot() { }
480 
481  virtual ~BarPlot() { }
482 
483 
484  // Overrides Plot::data().
485  PlotDataPtr data() const { return pointData(); }
486 
487  // Returns the data value at the given index. Just a thin layer over the
488  // PlotPointData functionality.
489  virtual ppoint_t pointAt(unsigned int i) const {
490  PlotPointDataPtr data = pointData();
491  if(!data.null()) return ppoint_t(data->xAt(i), data->yAt(i));
492  else return ppoint_t(0, 0);
493  }
494 
495  // Implements PlotItem::drawCount(). Provides default implementation that
496  // returns the number of plotted points.
497  virtual unsigned int drawCount() const { return pointData()->size(); }
498 
499 
500  // ABSTRACT METHODS //
501 
502  // Returns the data used for the plot.
503  virtual PlotPointDataPtr pointData() const = 0;
504 
505  // Returns whether or not the bars have an area fill or not.
506  virtual bool areaIsFilled() const = 0;
507 
508  // Sets whether the bars have an area fill. If fill is true, the
509  // implementation can decide whether to choose the area fill, or just
510  // use the last set PlotAreaFill.
511  virtual void setAreaFilled(bool fill = true) = 0;
512 
513  // Returns a copy of the area fill used for the bar interiors.
514  virtual PlotAreaFillPtr areaFill() const = 0;
515 
516  // Sets the area fill used for the bars to the given.
517  virtual void setAreaFill(const PlotAreaFill& areaFill) = 0;
518 
519 
520  // IMPLEMENTED METHODS //
521 
522  // Convenience methods for setting area fill.
523  // <group>
524  virtual void setAreaFill(const PlotAreaFillPtr areaFill) {
525  if(!areaFill.null()) setAreaFill(*areaFill);
526  else setAreaFilled(false);
527  }
528  virtual void setAreaFill(const casacore::String& color,
530  PlotAreaFillPtr fill = areaFill();
531  fill->setColor(color);
532  fill->setPattern(pattern);
533  setAreaFill(*fill);
534  }
535  // </group>
536 };
537 
538 
539 // Plot used to show raster (image-like) data. Expected to use PlotRasterData.
540 // The line methods in Plot are used for contour lines (if any). A RasterPlot
541 // can either use the data values directly as colors, or automatically pick
542 // colors based on a range of values and a colorbar. (See PlotRasterData.)
543 class RasterPlot : public virtual Plot {
544 public:
546 
547  virtual ~RasterPlot() { }
548 
549 
550  // Overrides Plot::data().
551  PlotDataPtr data() const { return rasterData(); }
552 
553  // Returns the data at the given point. Just a thin layer over data
554  // functionality.
555  virtual double valueAt(double x, double y) const {
556  PlotRasterDataPtr data = rasterData();
557  if(!data.null()) return data->valueAt(x, y);
558  else return 0;
559  }
560 
561 
562  // ABSTRACT METHODS //
563 
564  // Returns the data used.
565  virtual PlotRasterDataPtr rasterData() const = 0;
566 
567  // Sets the x range.
568  virtual void setXRange(double from, double to) = 0;
569 
570  // Sets the y range.
571  virtual void setYRange(double from, double to) = 0;
572 
573  // Returns the data format. See PlotRasterData.
574  virtual PlotRasterData::Format dataFormat() const = 0;
575 
576  // Sets the data format. See PlotRasterData.
577  virtual void setDataFormat(PlotRasterData::Format f) = 0;
578 
579  // Returns the data origin. See PlotRasterData.
580  virtual PlotRasterData::Origin dataOrigin() const = 0;
581 
582  // Sets the data origin. See PlotRasterData.
583  virtual void setDataOrigin(PlotRasterData::Origin o) = 0;
584 
585  // Returns the contour line levels, if any.
586  virtual std::vector<double> contourLines() const = 0;
587 
588  // Sets the contour line levels.
589  virtual void setContourLines(const std::vector<double>& lines) = 0;
590 };
591 
592 
593 /* Smart pointer definitions */
594 
597  PlotItemPtr)
599  ScatterPlotPtr, PlotItem, PlotItemPtr)
600 INHERITANCE_POINTER(ErrorPlot, ErrorPlotPtr, ScatterPlot, ScatterPlotPtr,
601  PlotItem, PlotItemPtr)
602 INHERITANCE_POINTER(ColoredPlot, ColoredPlotPtr, ScatterPlot, ScatterPlotPtr,
603  PlotItem, PlotItemPtr)
604 INHERITANCE_POINTER(BarPlot, BarPlotPtr, Plot, PlotPtr, PlotItem, PlotItemPtr)
605 INHERITANCE_POINTER(RasterPlot, RasterPlotPtr, Plot, PlotPtr, PlotItem,
606  PlotItemPtr)
607 
608 }
609 
610 #endif /*PLOT_H_*/
virtual ~MaskedScatterPlot()
Definition: Plot.h:227
virtual PlotMaskedPointDataPtr maskedData() const =0
ABSTRACT METHODS //.
virtual void setLinesShown(bool linesShown=true)=0
Sets whether or not lines are shown.
Bool null() const
Check to see if this CountedPtr is un-initialized, null.
Definition: CountedPtr.h:237
virtual void setSymbolAreaFill(const PlotAreaFill &fill)
Definition: Plot.h:202
virtual void setMaskedSymbol(char s)
Definition: Plot.h:331
virtual void setLinesStep(bool linesStep=true)=0
virtual void setAreaFill(const PlotAreaFill &areaFill)=0
Sets the area fill used for the bars to the given.
virtual void setMaskedLinesShown(bool linesShown=true)=0
Sets whether or not lines are shown for masked points.
virtual unsigned int errorCapSize() const =0
Returns the &quot;cap&quot; size of the error bar.
virtual void setErrorLineStyle(PlotLine::Style style)
Definition: Plot.h:423
virtual void setLineStyle(PlotLine::Style style)
Definition: Plot.h:99
virtual ppoint_t pointAt(unsigned int i) const
Returns the data value at the given index.
Definition: Plot.h:128
virtual unsigned int drawCount() const
Implements PlotItem::drawCount().
Definition: Plot.h:497
virtual PlotErrorDataPtr errorData() const =0
ABSTRACT METHODS //.
virtual void setSymbol(PlotSymbol::Symbol s)
Definition: Plot.h:174
virtual PlotLinePtr line() const =0
Returns a copy of the line used for this plot.
virtual void setErrorLine(const casacore::String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
Definition: Plot.h:409
A Plot basically consists of data and customization information.
Definition: Plot.h:40
virtual void setYRange(double from, double to)=0
Sets the y range.
PlotDataPtr data() const
Overrides Plot::data().
Definition: Plot.h:485
virtual unsigned int drawCount() const
Implements PlotItem::drawCount().
Definition: Plot.h:136
virtual PlotLinePtr maskedLine() const =0
Returns a copy of the line used for masked points.
virtual void setMaskedLine(const PlotLinePtr line)
Convenience methods for setting line for masked points.
Definition: Plot.h:268
virtual void setSymbol(const PlotSymbolPtr symbol)
IMPLEMENTED METHODS //.
Definition: Plot.h:170
virtual void setAreaFilled(bool fill=true)=0
Sets whether the bars have an area fill.
virtual PlotDataPtr data() const
Overrides Plot::data().
Definition: Plot.h:124
virtual void setErrorLine(const PlotLinePtr line)
Convenience methods for setting error line.
Definition: Plot.h:405
virtual void setLine(const casacore::String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
Definition: Plot.h:85
PlotDataPtr data() const
Overrides Plot::data().
Definition: Plot.h:551
virtual void setErrorLineWidth(double width)
Definition: Plot.h:428
virtual void setAreaFill(const casacore::String &color, PlotAreaFill::Pattern pattern=PlotAreaFill::FILL)
Definition: Plot.h:528
virtual void setMaskedSymbolAreaFill(const PlotAreaFill &fill)
Definition: Plot.h:354
virtual void setSymbolLine(const PlotLine &line)
Definition: Plot.h:189
virtual PlotPointDataPtr pointData() const =0
ABSTRACT METHODS //.
virtual void setMaskedSymbolAreaFill(const casacore::String &color, PlotAreaFill::Pattern pattern=PlotAreaFill::FILL)
Definition: Plot.h:361
Abstract class for area fill.
Definition: PlotOptions.h:296
ColoredPlot()
Constructor.
Definition: Plot.h:450
virtual void setMaskedSymbolAreaFill(const PlotAreaFillPtr fill)
Definition: Plot.h:359
virtual ~ColoredPlot()
Destructor.
Definition: Plot.h:453
Pattern
Pattern enum, similar in spirit to http://doc.trolltech.com/4.3/qt.html#BrushStyle-enum.
Definition: PlotOptions.h:300
Plot used to show raster (image-like) data.
Definition: Plot.h:543
An color plot is a scatter plot with differentiated colors for points in different bins...
Definition: Plot.h:447
virtual void setErrorLineShown(bool show=true)=0
Sets whether the error bar line is shown.
virtual ~RasterPlot()
Definition: Plot.h:547
virtual PlotPointDataPtr pointData() const
Overrides ScatterPlot::pointData().
Definition: Plot.h:231
virtual ~ScatterPlot()
Definition: Plot.h:120
virtual void setMaskedSymbol(const PlotSymbol &symbol)=0
Sets the symbols for masked points to the given.
An error plot is a scatter plot with error bars drawn.
Definition: Plot.h:373
virtual void setErrorLineColor(const casacore::String &color)
Definition: Plot.h:418
void show(const variant &v)
ScatterPlot
Definition: Plot.h:598
virtual void setMaskedLineColor(const casacore::String &color)
Definition: Plot.h:281
virtual void setDataOrigin(PlotRasterData::Origin o)=0
Sets the data origin.
virtual void setAreaFill(const PlotAreaFillPtr areaFill)
IMPLEMENTED METHODS //.
Definition: Plot.h:524
TableExprNode pattern(const TableExprNode &node)
Definition: ExprNode.h:1444
virtual bool maskedLinesStep() const =0
Get/set connect masked points in step rather than line.
virtual PlotPointDataPtr pointData() const
Overrides ScatterPlot::pointData().
Definition: Plot.h:457
virtual void setErrorCapSize(unsigned int capSize)=0
Sets the error bar cap size in pixels.
virtual bool symbolsShown() const =0
Returns true if symbols are shown, false otherwise.
virtual void setSymbol(const PlotSymbol &symbol)=0
Sets the plot symbols to the given symbol.
virtual ~Plot()
Definition: Plot.h:44
virtual bool maskedSymbolsShown() const =0
Returns true if symbols are shown for masked points, false otherwise.
virtual bool maskedLinesShown() const =0
Returns true if this plot has lines shown for masked points, false otherwise.
virtual PlotPointDataPtr pointData() const
Overrides ScatterPlot::pointData().
Definition: Plot.h:381
virtual void setSymbolLine(const casacore::String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
Definition: Plot.h:196
Scatter plot abstract class.
Definition: Plot.h:116
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
virtual void setSymbolAreaFill(const casacore::String &color, PlotAreaFill::Pattern pattern=PlotAreaFill::FILL)
Definition: Plot.h:209
virtual void setLineColor(const casacore::String &color)
Definition: Plot.h:94
Subclass of ScatterPlot that adds masking functionality.
Definition: Plot.h:223
virtual PlotLinePtr errorLine() const =0
Returns the line used to draw the error bars.
virtual PlotAreaFillPtr areaFill() const =0
Returns a copy of the area fill used for the bar interiors.
virtual void setMaskedLine(const PlotLine &line)=0
Sets the lines for masked points to the given.
virtual ~ErrorPlot()
Definition: Plot.h:377
Abstract class for a line.
Definition: PlotOptions.h:368
virtual void setColorForBin(unsigned int bin, const PlotColorPtr color)=0
Sets the color to use for the bin at the given index.
PlotItem
Definition: Plot.h:598
Style
Static //.
Definition: PlotOptions.h:373
virtual bool errorLineShown() const =0
Returns whether the error bar line is shown or not.
Origin
casacore::Data for raster plots, which can be thought of as three-dimensional.
Definition: PlotData.h:263
virtual void setErrorLine(const PlotLine &line)=0
Sets the line used to draw the error bars.
virtual void setMaskedLineWidth(double width)
Definition: Plot.h:291
Abstract class for a symbol.
Definition: PlotOptions.h:451
virtual std::vector< double > contourLines() const =0
Returns the contour line levels, if any.
virtual void setMaskedSymbolSize(double width, double height)
Definition: Plot.h:336
virtual PlotBinnedDataPtr binnedColorData() const =0
ABSTRACT METHODS //.
virtual double valueAt(double x, double y) const
Returns the data at the given point.
Definition: Plot.h:555
virtual void setMaskedSymbolLine(const PlotLine &line)
Definition: Plot.h:341
PlotItem is the superclass of any object that is meant to be placed on the canvas (plots...
Definition: PlotItem.h:40
ScatterPlotPtr
Definition: Plot.h:598
Plot()
Definition: Plot.h:42
virtual PlotSymbolPtr symbol() const =0
Returns a copy of the symbol for this plot.
virtual void setContourLines(const std::vector< double > &lines)=0
Sets the contour line levels.
virtual void setMaskedSymbolsShown(bool symbolsShown=true)=0
Sets whether symbols are shown or not for masked points.
INHERITANCE_POINTER2(PlotLayoutSingle, PlotLayoutSinglePtr, PlotCanvasLayout, PlotCanvasLayoutPtr) INHERITANCE_POINTER2(PlotLayoutGrid
virtual ~BarPlot()
Definition: Plot.h:481
virtual void setSymbol(char s)
Definition: Plot.h:179
virtual void setMaskedSymbol(const PlotSymbolPtr symbol)
Convenience methods for setting symbol for masked points.
Definition: Plot.h:322
MaskedScatterPlotPtr
Definition: Plot.h:598
std::pair< double, double > ppoint_t
Typedef for a point, which is two doubles (x and y).
Definition: PlotData.h:41
virtual void setSymbolAreaFill(const PlotAreaFillPtr fill)
Definition: Plot.h:207
Symbol
Static //.
Definition: PlotOptions.h:456
virtual void setMaskedLineStyle(PlotLine::Style style)
Definition: Plot.h:286
virtual PlotRasterData::Format dataFormat() const =0
Returns the data format.
casacore::CountedPtr< PlotItem > PlotItemPtr
Definition: PlotItem.h:98
virtual void setMaskedSymbolLine(const PlotLinePtr line)
Definition: Plot.h:346
virtual void setSymbolsShown(bool symbolsShown=true)=0
Sets whether symbols are shown or not.
virtual PlotColorPtr colorForBin(unsigned int bin) const =0
Returns the color to use for the bin at the given index.
virtual bool linesShown() const =0
It&#39;s likely that any plot subclass (scatter, bar, function, etc.) will have lines of some sort...
Bar plot abstract class.
Definition: Plot.h:477
virtual PlotSymbolPtr maskedSymbol() const =0
Returns a copy of the symbol for masked points.
virtual void setMaskedLine(const casacore::String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
Definition: Plot.h:272
virtual void setMaskedSymbol(PlotSymbol::Symbol s)
Definition: Plot.h:326
virtual void setMaskedSymbolLine(const casacore::String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
Definition: Plot.h:348
virtual bool linesStep() const =0
Get/set to connect points in step rather than line.
virtual bool maskedAt(unsigned int index) const
Returns whether the data at the given index is masked or not.
Definition: Plot.h:235
virtual void setSymbolLine(const PlotLinePtr line)
Definition: Plot.h:194
virtual PlotDataPtr data() const =0
ABSTRACT METHODS //.
virtual void clearData()=0
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual PlotPointDataPtr pointData() const =0
ABSTRACT METHODS //.
virtual PlotRasterData::Origin dataOrigin() const =0
Returns the data origin.
virtual ppoint_t pointAt(unsigned int i) const
Returns the data value at the given index.
Definition: Plot.h:489
virtual void dataChanged()=0
Should be called whenever the underlying PlotData has changed, to let the plot and its attached canva...
virtual void setMaskedLinesStep(bool linesStep=true)=0
virtual void setLine(const PlotLinePtr line)
IMPLEMENTED METHODS //.
Definition: Plot.h:81
virtual PlotRasterDataPtr rasterData() const =0
ABSTRACT METHODS //.
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
INHERITANCE_POINTER(PlotFlagAllTool, PlotFlagAllToolPtr, PlotMouseTool, PlotMouseToolPtr, PlotTool, PlotToolPtr) TOOL NOTIFICATION CLASSESInterface for objects that want to be notified when the selection tool changes.*/class PlotSelectToolNotifier
Definition: PlotTool.h:675
PlotItemPtr ColoredPlotPtr
Definition: Plot.h:602
virtual void setLineWidth(double width)
Definition: Plot.h:104
virtual void setXRange(double from, double to)=0
Sets the x range.
virtual void setSymbolSize(double width, double height)
Definition: Plot.h:184
virtual bool areaIsFilled() const =0
Returns whether or not the bars have an area fill or not.
virtual void setLine(const PlotLine &line)=0
Sets the plot lines to the given line.
virtual void setDataFormat(PlotRasterData::Format f)=0
Sets the data format.