27 #ifndef PLOTFACTORY_H_
28 #define PLOTFACTORY_H_
105 bool showSingleCanvas =
true,
bool showGUI =
true,
107 bool smartDelete =
true)
const = 0;
117 bool smartDelete =
true)
const = 0;
127 bool smartDelete =
true);
140 bool toggleable =
false,
bool smartDelete =
true)
const = 0;
145 bool smartDelete =
true)
const = 0;
159 bool smartDelete =
true)
const = 0;
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;
172 const casacore::String& title =
"Colored Plot",
bool smartDelete=
true)
const;
177 virtual BarPlotPtr
barPlot(PlotPointDataPtr data,
178 const casacore::String& title =
"Bar Plot",
bool smartDelete=
true)
const= 0;
185 bool smartDelete =
true)
const;
189 virtual RasterPlotPtr
rasterPlot(PlotRasterDataPtr data,
191 PlotRasterData::Format format = PlotRasterData::RGB32,
192 bool smartDelete =
true)
const = 0;
197 virtual RasterPlotPtr
contourPlot(PlotRasterDataPtr data,
198 const std::vector<double>& contours,
200 PlotRasterData::Format format = PlotRasterData::RGB32,
201 bool smartDelete =
true)
const;
207 const casacore::String& title =
"Spectrogram",
bool smartDelete=
true)
const;
214 const std::vector<double>& cont,
216 bool smartDelete =
true)
const;
221 const PlotCoordinate& coord,
bool smartDelete =
true)
const = 0;
227 double y,
bool smartDelete =
true)
const;
231 virtual PlotShapeRectanglePtr
shapeRectangle(
const PlotCoordinate& upperLeft,
232 const PlotCoordinate& lowerRight,
bool smartDelete=
true)
const= 0;
237 virtual PlotShapeRectanglePtr
shapeRectangle(
double left,
double top,
238 double right,
double bottom,
bool smartDelete =
true)
const;
243 const PlotCoordinate& radii,
bool smartDelete =
true)
const = 0;
248 double xRadius,
double yRadius,
bool smartDelete =
true)
const;
253 const std::vector<PlotCoordinate>& coords,
254 bool smartDelete =
true)
const = 0;
259 virtual PlotShapePolygonPtr
shapePolygon(
const std::vector<double>& x,
260 const std::vector<double>& y,
bool smartDelete =
true)
const;
265 bool smartDelete =
true)
const = 0;
269 virtual PlotShapeArrowPtr
shapeArrow(
const PlotCoordinate& from,
278 virtual PlotShapeArrowPtr
shapeArrow(
double fromX,
double fromY,
283 const PlotCoordinate& to,
bool smartDelete =
true)
const;
285 double toX,
double toY,
bool smartDelete =
true)
const;
291 const std::vector<PlotCoordinate>& coords,
292 bool smartDelete =
true)
const = 0;
298 const std::vector<double>& y,
bool smartDelete =
true)
const;
303 virtual PlotShapeArcPtr
shapeArc(
const PlotCoordinate& start,
304 const PlotCoordinate& widthHeight,
int startAngle,
305 int spanAngle,
bool smartDelete =
true)
const = 0;
309 virtual PlotPointPtr
point(
const PlotCoordinate& coord,
310 bool smartDelete =
true)
const = 0;
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;
328 bool smartDelete =
true)
const = 0;
332 bool smartDelete =
true)
const = 0;
337 bool smartDelete =
true)
const;
346 bool bold =
false,
bool italics =
false,
347 bool underline =
false,
bool smartDelete =
true)
const = 0;
351 bool smartDelete =
true)
const = 0;
356 bool smartDelete =
true)
const;
362 bool smartDelete =
true)
const = 0;
366 bool smartDelete =
true)
const = 0;
371 bool smartDelete =
true)
const;
377 bool smartDelete =
true)
const = 0;
381 bool smartDelete =
true)
const = 0;
386 bool smartDelete =
true)
const;
391 bool smartDelete =
true)
const = 0;
400 bool smartDelete =
true)
const;
404 bool smartDelete =
true)
const = 0;
409 bool smartDelete =
true)
const;
418 bool smartDelete =
true)
const;
424 PlotAxis yAxis, PlotCoordinate::System sys,
426 bool smartDelete =
true)
const;
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;
438 PlotCoordinate::System system,
bool smartDelete =
true)
const;
440 PlotCoordinate::System system,
bool smartDelete =
true)
const;
442 PlotCoordinate::System system,
bool smartDelete =
true)
const;
444 PlotCoordinate::System system,
bool smartDelete =
true)
const;
446 PlotCoordinate::System system,
bool smartDelete =
true)
const;
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;
544 virtual PlotPointDataPtr
histogramData(PlotSingleDataPtr data,
545 unsigned int numBins) const;
virtual Plotter::Implementation implementation() const =0
Return which implementation this factory is producing.
static const int NO_EVENTS
No events.
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.
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 ¢er, 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
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's PlotCanvas subclass has a cached axes stack, false otherwise.
Abstract class for area fill.
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...
virtual bool canvasHasThreadedDrawing() const =0
Support Methods //.
The idea behind a plot factory is to produce classes that are useful to the underlying implementation...
Pattern
Pattern enum, similar in spirit to http://doc.trolltech.com/4.3/qt.html#BrushStyle-enum.
SMART POINTER DEFINITIONS PlotShapeEllipsePtr
virtual PlotMutexPtr mutex(bool smartDelete=true) const =0
Operations //.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
TableExprNode pattern(const TableExprNode &node)
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
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.
virtual ErrorPlotPtr errorPlot(PlotErrorDataPtr data, const casacore::String &title="Error Plot", bool smartDelete=true) const
virtual ScatterPlotPtr scatterPlot(PlotPointDataPtr data, const casacore::String &title="Scatter Plot", bool smartDelete=true) const =0
PlotItem Objects //.
PlotAxis
Enum for the four plot axes.
SMART POINTER DEFINITIONS PlotItemPtr PlotItemPtr PlotShapePathPtr
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.
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 //
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
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'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.
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.
virtual PlotZoomToolPtr zoomTool(bool smartDelete=true) const
PlotItemPtr ColoredPlotPtr
virtual unsigned int numBins() const =0
ABSTRACT METHODS //.
virtual PlotFlagAllToolPtr flagAllTool(bool smartDelete=true) const
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
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.
PlotFactory()
Constructor.