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 //. | |
virtual | ~Plotter () |
Destructor. | |
virtual void | showGUI (bool showGUI=true)=0 |
ABSTRACT METHODS //. | |
virtual std::pair< int, int > | size () const =0 |
Returns the current size of the plotter GUI in pixels (width x height). | |
virtual void | setSize (int width, int height)=0 |
Sets the plotter GUI size in pixels. | |
virtual void | setCanvasCachedAxesStackImageSize (int width, int height) |
Set the size of cached axes stack image. | |
virtual String | windowTitle () const =0 |
Returns the plotter window's title. | |
virtual void | setWindowTitle (const String &newTitle)=0 |
Sets the plotter window's title to the given. | |
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). | |
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. | |
virtual int | displayDPI () const =0 |
Returns the DPI used in the GUI display. | |
virtual bool | isQWidget () const =0 |
Returns true if the plotter window can be casted to a QWidget, false otherwise. | |
virtual PlotCursor | cursor () const =0 |
Gets/sets cursor for the whole plotter. | |
virtual void | setCursor (PlotCursor cursor)=0 |
virtual void | refresh ()=0 |
Refreshes the plotter GUI. | |
virtual void | updateScriptGui ()=0 |
Forces the script client to refresh. | |
virtual void | close ()=0 |
Closes the plotter window. | |
virtual PlotCanvasLayoutPtr | canvasLayout ()=0 |
Canvas Layout methods //. | |
virtual void | setCanvasLayout (PlotCanvasLayoutPtr layout)=0 |
Sets the canvas layout to the given. | |
virtual void | canvasLayoutChanged (PlotCanvasLayout &layout)=0 |
Method for when the layout has changed (i.e. | |
virtual const String & | dateFormat () const =0 |
Gets/Sets the date format for the plotter and all current and future canvases. | |
virtual void | setDateFormat (const String &dateFormat)=0 |
virtual const 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. | |
virtual void | setRelativeDateFormat (const String &dateFormat)=0 |
virtual bool | defaultPanelShown (DefaultPanel panel)=0 |
Panel methods //. | |
virtual void | showDefaultPanel (DefaultPanel panel, bool show=true)=0 |
Shows/hides the given default panel. | |
virtual int | addPanel (PlotPanelPtr panel)=0 |
Adds the given plot panel and returns its index. | |
virtual vector< PlotPanelPtr > | allPanels ()=0 |
Returns all plot panels currently shown. | |
virtual unsigned int | numPanels ()=0 |
Returns the number of plot panels currently on the plotter. | |
virtual PlotPanelPtr | getPanel (int index)=0 |
Returns the plot panel at the given index, or a null pointer for an invalid index. | |
virtual int | panelIndex (PlotPanelPtr panel)=0 |
Returns the index of the given plot panel, or -1 if not on canvas or null. | |
virtual void | clearPanels ()=0 |
Clears all plot panels from the plotter. | |
virtual void | removePanel (PlotPanelPtr panel)=0 |
Removes the given plot panel from the plotter. | |
virtual void | removePanel (int id)=0 |
Removes the plot panel with the given index from the plotter. | |
virtual void | removeLastPanel ()=0 |
Removes the last-added plot panel from the plotter. | |
void | setCommonAxisX (Bool commonAxis) |
Use a common x-/y- axis when plotting multiple graphs. | |
void | setCommonAxisY (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 //. | |
virtual PlotFactory * | implementationFactory () const =0 |
Returns a new instance of a PlotFactory that can create plot items for this implementation. | |
virtual bool | exportToFile (const PlotExportFormat &format)=0 |
Exports the plotter (all canvases) using the given format. | |
virtual String | fileChooserDialog (const String &title="File Chooser", const String &directory="")=0 |
Shows a file chooser dialog and returns the absolute filename that the user chooses. | |
virtual void | registerResizeHandler (PlotResizeEventHandlerPtr handler)=0 |
Event Handling methods //. | |
virtual vector < PlotResizeEventHandlerPtr > | allResizeHandlers () const =0 |
Returns a list of all registered resize event handlers for this plotter. | |
virtual void | unregisterResizeHandler (PlotResizeEventHandlerPtr handler)=0 |
Unregisters the given resize event handler with this plotter. | |
virtual PlotCanvasPtr | canvasAt (const PlotLayoutCoordinate &coord) |
IMPLEMENTED METHODS //. | |
virtual PlotCanvasPtr | canvas () |
See PlotCanvasLayout::canvas(). | |
virtual void | setCanvas (PlotCanvasPtr canvas) |
Sets the layout to a single layout with the given canvas. | |
LogMessage::Priority | logFilterMinPriority () const |
See PlotLogger::filterMinPriority(). | |
void | setLogFilterMinPriority (PlotLogMessage::Priority minPriority) |
See PlotLogger::setFilterMinPriority(). | |
virtual bool | logFilterEventFlag (int flag) const |
See PlotLogger::eventFlag(). | |
virtual void | setLogFilterEventFlag (int flag, bool on) |
See PlotLogger::setEventFlag(). | |
virtual int | logFilterEventFlags () const |
See PlotLogger::eventFlags(). | |
virtual void | setLogFilterEventFlags (int flags) |
See PlotLogger::setEventFlags(). | |
virtual PlotLoggerPtr | logger () const |
Gets the PlotLogger associated with this Plotter. | |
virtual bool | exportPlot (const PlotExportFormat &format)=0 |
bool | isVisible (PlotCanvasPtr &canvas) |
Static Public Member Functions | |
static String | formattedDateString (const String &format, double value, PlotAxisScale scale, bool isRelative=false) |
Returns a String for the given date value using the given format (see dateFormat()) and scale. | |
Static Public Attributes | |
static const String | DEFAULT_DATE_FORMAT |
The default date format to use for the plotter. | |
static const String | DEFAULT_RELATIVE_DATE_FORMAT |
The default relative date format to use for the plotter. | |
Protected Attributes | |
PlotLoggerPtr | m_logger |
Logger. | |
Bool | commonAxisX |
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.
Definition at line 43 of file Plotter.h.
casa::Plotter::Plotter | ( | ) |
Non-Static //.
Constructor.
virtual casa::Plotter::~Plotter | ( | ) | [virtual] |
Destructor.
virtual int casa::Plotter::addPanel | ( | PlotPanelPtr | panel | ) | [pure virtual] |
Adds the given plot panel and returns its index.
virtual vector<PlotPanelPtr> casa::Plotter::allPanels | ( | ) | [pure virtual] |
Returns all plot panels currently shown.
virtual vector<PlotResizeEventHandlerPtr> casa::Plotter::allResizeHandlers | ( | ) | const [pure virtual] |
Returns a list of all registered resize event handlers for this plotter.
virtual PlotCanvasPtr casa::Plotter::canvas | ( | ) | [virtual] |
virtual std::pair<int, int> casa::Plotter::canvasAreaSize | ( | ) | const [pure virtual] |
Returns the size of the canvas area (i.e., minus bordering panels) in pixels (width x height).
virtual PlotCanvasPtr casa::Plotter::canvasAt | ( | const PlotLayoutCoordinate & | coord | ) | [virtual] |
IMPLEMENTED METHODS //.
virtual PlotCanvasLayoutPtr casa::Plotter::canvasLayout | ( | ) | [pure virtual] |
Canvas Layout methods //.
Returns the current layout, or a null pointer if none has been set.
virtual void casa::Plotter::canvasLayoutChanged | ( | PlotCanvasLayout & | layout | ) | [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.
virtual void casa::Plotter::clearPanels | ( | ) | [pure virtual] |
Clears all plot panels from the plotter.
virtual void casa::Plotter::close | ( | ) | [pure virtual] |
Closes the plotter window.
virtual PlotCursor casa::Plotter::cursor | ( | ) | const [pure virtual] |
Gets/sets cursor for the whole plotter.
Can be overridden by individual canvases.
virtual const String& casa::Plotter::dateFormat | ( | ) | const [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.
virtual bool casa::Plotter::defaultPanelShown | ( | DefaultPanel | panel | ) | [pure virtual] |
Panel methods //.
Returns whether or not the given default panel is shown.
virtual int casa::Plotter::displayDPI | ( | ) | const [pure virtual] |
Returns the DPI used in the GUI display.
virtual bool casa::Plotter::exportPlot | ( | const PlotExportFormat & | format | ) | [pure virtual] |
virtual bool casa::Plotter::exportToFile | ( | const PlotExportFormat & | format | ) | [pure virtual] |
Exports the plotter (all canvases) using the given format.
virtual String casa::Plotter::fileChooserDialog | ( | const String & | title = "File Chooser" , |
|
const String & | directory = "" | |||
) | [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 String is returned.
static String casa::Plotter::formattedDateString | ( | const String & | format, | |
double | value, | |||
PlotAxisScale | scale, | |||
bool | isRelative = false | |||
) | [static] |
Returns a 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.
PlotAxis casa::Plotter::getAxisLocationX | ( | ) | const |
PlotAxis casa::Plotter::getAxisLocationY | ( | ) | const |
virtual PlotPanelPtr casa::Plotter::getPanel | ( | int | index | ) | [pure virtual] |
Returns the plot panel at the given index, or a null pointer for an invalid index.
virtual Implementation casa::Plotter::implementation | ( | ) | const [pure virtual] |
Plotting Functionality methods //.
Returns the implementation of this plotter.
virtual PlotFactory* casa::Plotter::implementationFactory | ( | ) | const [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 |
virtual bool casa::Plotter::isQWidget | ( | ) | const [pure virtual] |
Returns true if the plotter window can be casted to a QWidget, false otherwise.
bool casa::Plotter::isVisible | ( | PlotCanvasPtr & | canvas | ) |
virtual bool casa::Plotter::logFilterEventFlag | ( | int | flag | ) | const [virtual] |
See PlotLogger::eventFlag().
virtual int casa::Plotter::logFilterEventFlags | ( | ) | const [virtual] |
See PlotLogger::eventFlags().
LogMessage::Priority casa::Plotter::logFilterMinPriority | ( | ) | const |
virtual PlotLoggerPtr casa::Plotter::logger | ( | ) | const [virtual] |
Gets the PlotLogger associated with this Plotter.
There should be exactly one PlotLogger per Plotter.
virtual unsigned int casa::Plotter::numPanels | ( | ) | [pure virtual] |
Returns the number of plot panels currently on the plotter.
virtual int casa::Plotter::panelIndex | ( | PlotPanelPtr | panel | ) | [pure virtual] |
Returns the index of the given plot panel, or -1 if not on canvas or null.
virtual void casa::Plotter::refresh | ( | ) | [pure virtual] |
Refreshes the plotter GUI.
virtual void casa::Plotter::registerResizeHandler | ( | PlotResizeEventHandlerPtr | handler | ) | [pure virtual] |
Event Handling methods //.
Registers the given resize event handler with this plotter.
virtual const String& casa::Plotter::relativeDateFormat | ( | ) | const [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.
virtual void casa::Plotter::removeLastPanel | ( | ) | [pure virtual] |
Removes the last-added plot panel from the plotter.
virtual void casa::Plotter::removePanel | ( | int | id | ) | [pure virtual] |
Removes the plot panel with the given index from the plotter.
virtual void casa::Plotter::removePanel | ( | PlotPanelPtr | panel | ) | [pure virtual] |
Removes the given plot panel from the plotter.
virtual void casa::Plotter::setCanvas | ( | PlotCanvasPtr | canvas | ) | [virtual] |
Sets the layout to a single layout with the given canvas.
virtual void casa::Plotter::setCanvasCachedAxesStackImageSize | ( | int | width, | |
int | height | |||
) | [virtual] |
Set the size of cached axes stack image.
virtual void casa::Plotter::setCanvasLayout | ( | PlotCanvasLayoutPtr | layout | ) | [pure virtual] |
Sets the canvas layout to the given.
Clears out old canvases as needed.
virtual void casa::Plotter::setCanvasSize | ( | int | width, | |
int | height, | |||
bool | resizeWindow = true | |||
) | [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 | ( | Bool | commonAxis | ) |
Use a common x-/y- axis when plotting multiple graphs.
void casa::Plotter::setCommonAxisY | ( | Bool | commonAxis | ) |
virtual void casa::Plotter::setCursor | ( | PlotCursor | cursor | ) | [pure virtual] |
virtual void casa::Plotter::setDateFormat | ( | const String & | dateFormat | ) | [pure virtual] |
virtual void casa::Plotter::setLogFilterEventFlag | ( | int | flag, | |
bool | on | |||
) | [virtual] |
See PlotLogger::setEventFlag().
virtual void casa::Plotter::setLogFilterEventFlags | ( | int | flags | ) | [virtual] |
See PlotLogger::setEventFlags().
void casa::Plotter::setLogFilterMinPriority | ( | PlotLogMessage::Priority | minPriority | ) |
virtual void casa::Plotter::setRelativeDateFormat | ( | const String & | dateFormat | ) | [pure virtual] |
virtual void casa::Plotter::setSize | ( | int | width, | |
int | height | |||
) | [pure virtual] |
Sets the plotter GUI size in pixels.
virtual void casa::Plotter::setWindowTitle | ( | const String & | newTitle | ) | [pure virtual] |
Sets the plotter window's title to the given.
virtual void casa::Plotter::showDefaultPanel | ( | DefaultPanel | panel, | |
bool | show = true | |||
) | [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.
virtual void casa::Plotter::showGUI | ( | bool | showGUI = true |
) | [pure virtual] |
ABSTRACT METHODS //.
Top-Level GUI methods //
Shows/hides the plotter GUI.
virtual std::pair<int, int> casa::Plotter::size | ( | ) | const [pure virtual] |
Returns the current size of the plotter GUI in pixels (width x height).
virtual void casa::Plotter::unregisterResizeHandler | ( | PlotResizeEventHandlerPtr | handler | ) | [pure virtual] |
Unregisters the given resize event handler with this plotter.
virtual void casa::Plotter::updateScriptGui | ( | ) | [pure virtual] |
Forces the script client to refresh.
virtual String casa::Plotter::windowTitle | ( | ) | const [pure virtual] |
Returns the plotter window's title.
PlotAxis casa::Plotter::axisLocationX [protected] |
PlotAxis casa::Plotter::axisLocationY [protected] |
Bool casa::Plotter::commonAxisX [protected] |
Bool casa::Plotter::commonAxisY [protected] |
const String casa::Plotter::DEFAULT_DATE_FORMAT [static] |
The default date format to use for the plotter.
See dateFormat().
const String casa::Plotter::DEFAULT_RELATIVE_DATE_FORMAT [static] |
The default relative date format to use for the plotter.
See relativeDateFormat().
PlotLoggerPtr casa::Plotter::m_logger [protected] |