casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
casa::Plotter Class Referenceabstract

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::StringdateFormat () 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::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. 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< PlotPanelPtrallPanels ()=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 PlotFactoryimplementationFactory () 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
 

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

casa::Plotter::Plotter ( )

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 std::vector<PlotPanelPtr> casa::Plotter::allPanels ( )
pure virtual

Returns all plot panels currently shown.

virtual std::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 //.

See PlotCanvasLayout::canvasAt().

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 casacore::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 casacore::String casa::Plotter::fileChooserDialog ( const casacore::String title = "File Chooser",
const casacore::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 casacore::String is returned.

static casacore::String casa::Plotter::formattedDateString ( const casacore::String format,
double  value,
PlotAxisScale  scale,
bool  isRelative = false,
int  secPrecision = -1 
)
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
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().

casacore::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 void casa::Plotter::makeSquarePlot ( bool  square,
bool  wave 
)
pure virtual

Sets width=height but saves rectangular ratio.

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::refreshPageHeader ( )
pure virtual
virtual void casa::Plotter::refreshPageHeaderDataModel ( PageHeaderDataModelPtr  dataModel)
pure virtual
virtual void casa::Plotter::registerResizeHandler ( PlotResizeEventHandlerPtr  handler)
pure virtual

Event Handling methods //.

Registers the given resize event handler with this plotter.

virtual const casacore::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.

void casa::Plotter::setAxisLocation ( PlotAxis  xLocation,
PlotAxis  yLocation 
)
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 ( casacore::Bool  commonAxis)

Use a common x-/y- axis when plotting multiple graphs.

void casa::Plotter::setCommonAxisY ( casacore::Bool  commonAxis)
virtual void casa::Plotter::setCursor ( PlotCursor  cursor)
pure virtual
virtual void casa::Plotter::setDateFormat ( const casacore::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 casacore::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 casacore::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 casacore::String casa::Plotter::windowTitle ( ) const
pure virtual

Returns the plotter window's title.

Member Data Documentation

PlotAxis casa::Plotter::axisLocationX
protected

Definition at line 318 of file Plotter.h.

PlotAxis casa::Plotter::axisLocationY
protected

Definition at line 319 of file Plotter.h.

casacore::Bool casa::Plotter::commonAxisX
protected

PlotterControllerPtr m_controller;.

Definition at line 316 of file Plotter.h.

casacore::Bool casa::Plotter::commonAxisY
protected

Definition at line 317 of file Plotter.h.

const casacore::String casa::Plotter::DEFAULT_DATE_FORMAT
static

The default date format to use for the plotter.

See dateFormat().

Definition at line 64 of file Plotter.h.

const casacore::String casa::Plotter::DEFAULT_RELATIVE_DATE_FORMAT
static

The default relative date format to use for the plotter.

See relativeDateFormat().

Definition at line 68 of file Plotter.h.

PlotLoggerPtr casa::Plotter::m_logger
protected

Logger.

Definition at line 314 of file Plotter.h.


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