casa
5.7.0-16
|
A Plotter can be thought of as a frame that holds one or more PlotCanvases in a configuration determined by a given PlotCanvasLayout. More...
#include <Plotter.h>
Public Types | |
enum | Implementation { QWT, DEFAULT } |
Static //. More... | |
enum | DefaultPanel { HAND_TOOLS, EXPORT_TOOLS } |
Default implementation-specific GUI panels that can be turned on or off. More... | |
Public Member Functions | |
Plotter () | |
Non-Static //. More... | |
virtual | ~Plotter () |
Destructor. More... | |
virtual void | showGUI (bool showGUI=true)=0 |
ABSTRACT METHODS //. More... | |
virtual std::pair< int, int > | size () const =0 |
Returns the current size of the plotter GUI in pixels (width x height). More... | |
virtual void | setSize (int width, int height)=0 |
Sets the plotter GUI size in pixels. More... | |
virtual void | makeSquarePlot (bool square, bool wave)=0 |
Sets width=height but saves rectangular ratio. More... | |
virtual void | setCanvasCachedAxesStackImageSize (int width, int height) |
Set the size of cached axes stack image. More... | |
virtual casacore::String | windowTitle () const =0 |
Returns the plotter window's title. More... | |
virtual void | setWindowTitle (const casacore::String &newTitle)=0 |
Sets the plotter window's title to the given. More... | |
virtual std::pair< int, int > | canvasAreaSize () const =0 |
Returns the size of the canvas area (i.e., minus bordering panels) in pixels (width x height). More... | |
virtual void | setCanvasSize (int width, int height, bool resizeWindow=true)=0 |
If the plotter has a single canvas, sets the size of the canvas to the given. More... | |
virtual int | displayDPI () const =0 |
Returns the DPI used in the GUI display. More... | |
virtual bool | isQWidget () const =0 |
Returns true if the plotter window can be casted to a QWidget, false otherwise. More... | |
virtual PlotCursor | cursor () const =0 |
Gets/sets cursor for the whole plotter. More... | |
virtual void | setCursor (PlotCursor cursor)=0 |
virtual void | refresh ()=0 |
Refreshes the plotter GUI. More... | |
virtual void | updateScriptGui ()=0 |
Forces the script client to refresh. More... | |
virtual void | close ()=0 |
Closes the plotter window. More... | |
virtual PlotCanvasLayoutPtr | canvasLayout ()=0 |
Canvas Layout methods //. More... | |
virtual void | setCanvasLayout (PlotCanvasLayoutPtr layout)=0 |
Sets the canvas layout to the given. More... | |
virtual void | canvasLayoutChanged (PlotCanvasLayout &layout)=0 |
Method for when the layout has changed (i.e. More... | |
virtual const casacore::String & | dateFormat () const =0 |
Gets/Sets the date format for the plotter and all current and future canvases. More... | |
virtual void | setDateFormat (const casacore::String &dateFormat)=0 |
virtual const casacore::String & | relativeDateFormat () const =0 |
Gets/Sets the date format for relative values (i.e., for reference values on axes) for the plotter and all current and future canvases. More... | |
virtual void | setRelativeDateFormat (const casacore::String &dateFormat)=0 |
virtual bool | defaultPanelShown (DefaultPanel panel)=0 |
Panel methods //. More... | |
virtual void | showDefaultPanel (DefaultPanel panel, bool show=true)=0 |
Shows/hides the given default panel. More... | |
virtual int | addPanel (PlotPanelPtr panel)=0 |
Adds the given plot panel and returns its index. More... | |
virtual std::vector< PlotPanelPtr > | allPanels ()=0 |
Returns all plot panels currently shown. More... | |
virtual unsigned int | numPanels ()=0 |
Returns the number of plot panels currently on the plotter. More... | |
virtual PlotPanelPtr | getPanel (int index)=0 |
Returns the plot panel at the given index, or a null pointer for an invalid index. More... | |
virtual int | panelIndex (PlotPanelPtr panel)=0 |
Returns the index of the given plot panel, or -1 if not on canvas or null. More... | |
virtual void | clearPanels ()=0 |
Clears all plot panels from the plotter. More... | |
virtual void | removePanel (PlotPanelPtr panel)=0 |
Removes the given plot panel from the plotter. More... | |
virtual void | removePanel (int id)=0 |
Removes the plot panel with the given index from the plotter. More... | |
virtual void | removeLastPanel ()=0 |
Removes the last-added plot panel from the plotter. More... | |
void | setCommonAxisX (casacore::Bool commonAxis) |
Use a common x-/y- axis when plotting multiple graphs. More... | |
void | setCommonAxisY (casacore::Bool commonAxis) |
bool | isCommonAxisX () const |
bool | isCommonAxisY () const |
void | setAxisLocation (PlotAxis xLocation, PlotAxis yLocation) |
PlotAxis | getAxisLocationX () const |
PlotAxis | getAxisLocationY () const |
virtual Implementation | implementation () const =0 |
Plotting Functionality methods //. More... | |
virtual PlotFactory * | implementationFactory () const =0 |
Returns a new instance of a PlotFactory that can create plot items for this implementation. More... | |
virtual bool | exportToFile (const PlotExportFormat &format)=0 |
Exports the plotter (all canvases) using the given format. More... | |
virtual casacore::String | fileChooserDialog (const casacore::String &title="File Chooser", const casacore::String &directory="")=0 |
Shows a file chooser dialog and returns the absolute filename that the user chooses. More... | |
virtual void | registerResizeHandler (PlotResizeEventHandlerPtr handler)=0 |
Event Handling methods //. More... | |
virtual std::vector < PlotResizeEventHandlerPtr > | allResizeHandlers () const =0 |
Returns a list of all registered resize event handlers for this plotter. More... | |
virtual void | unregisterResizeHandler (PlotResizeEventHandlerPtr handler)=0 |
Unregisters the given resize event handler with this plotter. More... | |
virtual PlotCanvasPtr | canvasAt (const PlotLayoutCoordinate &coord) |
IMPLEMENTED METHODS //. More... | |
virtual PlotCanvasPtr | canvas () |
See PlotCanvasLayout::canvas(). More... | |
virtual void | setCanvas (PlotCanvasPtr canvas) |
Sets the layout to a single layout with the given canvas. More... | |
casacore::LogMessage::Priority | logFilterMinPriority () const |
See PlotLogger::filterMinPriority(). More... | |
void | setLogFilterMinPriority (PlotLogMessage::Priority minPriority) |
See PlotLogger::setFilterMinPriority(). More... | |
virtual bool | logFilterEventFlag (int flag) const |
See PlotLogger::eventFlag(). More... | |
virtual void | setLogFilterEventFlag (int flag, bool on) |
See PlotLogger::setEventFlag(). More... | |
virtual int | logFilterEventFlags () const |
See PlotLogger::eventFlags(). More... | |
virtual void | setLogFilterEventFlags (int flags) |
See PlotLogger::setEventFlags(). More... | |
virtual PlotLoggerPtr | logger () const |
Gets the PlotLogger associated with this Plotter. More... | |
virtual bool | exportPlot (const PlotExportFormat &format)=0 |
bool | isVisible (PlotCanvasPtr &canvas) |
virtual void | refreshPageHeader ()=0 |
virtual void | refreshPageHeaderDataModel (PageHeaderDataModelPtr dataModel)=0 |
Static Public Member Functions | |
static casacore::String | formattedDateString (const casacore::String &format, double value, PlotAxisScale scale, bool isRelative=false, int secPrecision=-1) |
Returns a casacore::String for the given date value using the given format (see dateFormat()) and scale. More... | |
Static Public Attributes | |
static const casacore::String | DEFAULT_DATE_FORMAT |
The default date format to use for the plotter. More... | |
static const casacore::String | DEFAULT_RELATIVE_DATE_FORMAT |
The default relative date format to use for the plotter. More... | |
Protected Attributes | |
PlotLoggerPtr | m_logger |
Logger. More... | |
casacore::Bool | commonAxisX |
PlotterControllerPtr m_controller;. More... | |
casacore::Bool | commonAxisY |
PlotAxis | axisLocationX |
PlotAxis | axisLocationY |
A Plotter can be thought of as a frame that holds one or more PlotCanvases in a configuration determined by a given PlotCanvasLayout.
It also has some top-level and main-window functionality.
casa::Plotter::Plotter | ( | ) |
Non-Static //.
Constructor.
|
virtual |
Destructor.
|
pure virtual |
Adds the given plot panel and returns its index.
|
pure virtual |
Returns all plot panels currently shown.
|
pure virtual |
Returns a list of all registered resize event handlers for this plotter.
|
virtual |
|
pure virtual |
Returns the size of the canvas area (i.e., minus bordering panels) in pixels (width x height).
|
virtual |
IMPLEMENTED METHODS //.
|
pure virtual |
Canvas Layout methods //.
Returns the current layout, or a null pointer if none has been set.
|
pure virtual |
Method for when the layout has changed (i.e.
changed canvases, etc.). This should only be used by the layout currently being used by the plotter.
|
pure virtual |
Clears all plot panels from the plotter.
|
pure virtual |
Closes the plotter window.
|
pure virtual |
Gets/sets cursor for the whole plotter.
Can be overridden by individual canvases.
|
pure virtual |
Gets/Sets the date format for the plotter and all current and future canvases.
This format should be used anywhere date values are displayed to the user, such as for axis ticks and tracker tools. A format can consist of the following tags: y : year m : month d : day of month h : hours n : minutes s : seconds The format can optionally have the following tags: pX : precision to display for seconds, with X being an integer; if X is less than zero, the default is used. Applies to any seconds tags that are AFTER the precision tag.
|
pure virtual |
Panel methods //.
Returns whether or not the given default panel is shown.
|
pure virtual |
Returns the DPI used in the GUI display.
|
pure virtual |
|
pure virtual |
Exports the plotter (all canvases) using the given format.
|
pure virtual |
Shows a file chooser dialog and returns the absolute filename that the user chooses.
If a directory is given, start the dialog there. If the user cancels, an empty casacore::String is returned.
|
static |
Returns a casacore::String for the given date value using the given format (see dateFormat()) and scale.
If isRelative is true, the value is treated as a relative value (i.e., +X seconds past a reference date); otherwise it is treated as an absolute value. For relative values years, months, and days are ignored. Default precision for seconds is 4; use secPrecision to change this
PlotAxis casa::Plotter::getAxisLocationX | ( | ) | const |
PlotAxis casa::Plotter::getAxisLocationY | ( | ) | const |
|
pure virtual |
Returns the plot panel at the given index, or a null pointer for an invalid index.
|
pure virtual |
Plotting Functionality methods //.
Returns the implementation of this plotter.
|
pure virtual |
Returns a new instance of a PlotFactory that can create plot items for this implementation.
It is the caller's responsibility to delete the PlotFactory when finished.
bool casa::Plotter::isCommonAxisX | ( | ) | const |
bool casa::Plotter::isCommonAxisY | ( | ) | const |
|
pure virtual |
Returns true if the plotter window can be casted to a QWidget, false otherwise.
bool casa::Plotter::isVisible | ( | PlotCanvasPtr & | canvas | ) |
|
virtual |
See PlotLogger::eventFlag().
|
virtual |
See PlotLogger::eventFlags().
casacore::LogMessage::Priority casa::Plotter::logFilterMinPriority | ( | ) | const |
|
virtual |
Gets the PlotLogger associated with this Plotter.
There should be exactly one PlotLogger per Plotter.
|
pure virtual |
Sets width=height but saves rectangular ratio.
|
pure virtual |
Returns the number of plot panels currently on the plotter.
|
pure virtual |
Returns the index of the given plot panel, or -1 if not on canvas or null.
|
pure virtual |
Refreshes the plotter GUI.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Event Handling methods //.
Registers the given resize event handler with this plotter.
|
pure virtual |
Gets/Sets the date format for relative values (i.e., for reference values on axes) for the plotter and all current and future canvases.
This format should be used anywhere relative date values are displayed to the user, such as for axis ticks when a reference value is set. See dateFormat() for information on the format.
|
pure virtual |
Removes the last-added plot panel from the plotter.
|
pure virtual |
Removes the given plot panel from the plotter.
|
pure virtual |
Removes the plot panel with the given index from the plotter.
|
virtual |
Sets the layout to a single layout with the given canvas.
|
virtual |
Set the size of cached axes stack image.
|
pure virtual |
Sets the canvas layout to the given.
Clears out old canvases as needed.
|
pure virtual |
If the plotter has a single canvas, sets the size of the canvas to the given.
If resizeWindow is true, the plotter is resized to fit the new canvas size.
void casa::Plotter::setCommonAxisX | ( | casacore::Bool | commonAxis | ) |
Use a common x-/y- axis when plotting multiple graphs.
void casa::Plotter::setCommonAxisY | ( | casacore::Bool | commonAxis | ) |
|
pure virtual |
|
pure virtual |
|
virtual |
See PlotLogger::setEventFlag().
|
virtual |
See PlotLogger::setEventFlags().
void casa::Plotter::setLogFilterMinPriority | ( | PlotLogMessage::Priority | minPriority | ) |
|
pure virtual |
|
pure virtual |
Sets the plotter GUI size in pixels.
|
pure virtual |
Sets the plotter window's title to the given.
|
pure virtual |
Shows/hides the given default panel.
Note: the default panels are for convenience's sake and are left completely up to the implementation.
|
pure virtual |
ABSTRACT METHODS //.
Top-Level GUI methods //
Shows/hides the plotter GUI.
|
pure virtual |
Returns the current size of the plotter GUI in pixels (width x height).
|
pure virtual |
Unregisters the given resize event handler with this plotter.
|
pure virtual |
Forces the script client to refresh.
|
pure virtual |
Returns the plotter window's title.
|
protected |
|
protected |
|
static |
The default date format to use for the plotter.
See dateFormat().
|
static |
The default relative date format to use for the plotter.
See relativeDateFormat().
|
protected |