casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes
casa::Plotter Class Reference

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>

List of all members.

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 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 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 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 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 StringdateFormat () 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 StringrelativeDateFormat () 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< PlotPanelPtrallPanels ()=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.
virtual Implementation implementation () const =0
 Plotting Functionality methods //.
virtual PlotFactoryimplementationFactory () 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.

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.

Detailed Description

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.


Member Enumeration Documentation

Default implementation-specific GUI panels that can be turned on or off.

Enumerator:
HAND_TOOLS 
EXPORT_TOOLS 

(optionally) turn on/off tracker; (optionally) show/hide and position legend

Definition at line 56 of file Plotter.h.

Static //.

This enum should contain all known implementations.

Enumerator:
QWT 
DEFAULT 

Default plotter implementation is set here.

Definition at line 48 of file Plotter.h.


Constructor & Destructor Documentation

Non-Static //.

Constructor.

virtual casa::Plotter::~Plotter ( ) [virtual]

Destructor.


Member Function Documentation

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 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 //.

See PlotCanvasLayout::canvasAt().

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::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.

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.

virtual bool casa::Plotter::isQWidget ( ) const [pure virtual]

Returns true if the plotter window can be casted to a QWidget, false otherwise.

virtual bool casa::Plotter::logFilterEventFlag ( int  flag) const [virtual]

See PlotLogger::eventFlag().

virtual int casa::Plotter::logFilterEventFlags ( ) const [virtual]

See PlotLogger::eventFlags().

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 ( PlotPanelPtr  panel) [pure virtual]

Removes the given 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::setCanvas ( PlotCanvasPtr  canvas) [virtual]

Sets the layout to a single layout with the given canvas.

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.

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().

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 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 String casa::Plotter::windowTitle ( ) const [pure virtual]

Returns the plotter window's title.


Member Data Documentation

The default date format to use for the plotter.

See dateFormat().

Definition at line 64 of file Plotter.h.

The default relative date format to use for the plotter.

See relativeDateFormat().

Definition at line 68 of file Plotter.h.

Logger.

Definition at line 287 of file Plotter.h.


The documentation for this class was generated from the following file: