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 Member Functions | Protected Attributes
casa::PlotCanvas Class Reference

PlotCanvas is an area for different PlotItems to be attached and drawn. More...

#include <PlotCanvas.h>

List of all members.

Public Types

enum  LegendPosition {
  INT_URIGHT,
  INT_LRIGHT,
  INT_ULEFT,
  INT_LLEFT,
  EXT_RIGHT,
  EXT_TOP,
  EXT_LEFT,
  EXT_BOTTOM
}
 Static //. More...

Public Member Functions

 PlotCanvas ()
 Non-Static //.
virtual ~PlotCanvas ()
 Destructor.
virtual bool hasThreadedDrawing () const
 Support Methods //.
virtual bool hasCachedLayerDrawing () const
 See PlotFactory::canvasHasCachedLayerDrawing().
virtual bool hasCachedAxesStack () const
 See PlotFactory::hasCachedAxesStack().
virtual pair< int, int > size () const =0
 GUI Methods //.
virtual String title () const =0
 Returns the text of the canvas title, or an empty String if none is shown.
virtual void setTitle (const String &title)=0
 Sets the text of the canvas title to the given.
virtual PlotFontPtr titleFont () const =0
 Returns a copy of the font used for the canvas title.
virtual void setTitleFont (const PlotFont &font)=0
 Set the font of the canvas title to the given.
virtual void setTitleFont (const PlotFontPtr font)
 Convenience method for setting title font.
virtual PlotAreaFillPtr background () const =0
 Returns a copy of the canvas background.
virtual void setBackground (const PlotAreaFill &areaFill)=0
 Sets the background of the canvas to the given.
virtual void setBackground (const PlotAreaFillPtr areaFill)
 Convenience methods for setting background.
virtual void setBackground (const String &color, PlotAreaFill::Pattern pattern=PlotAreaFill::FILL)
virtual PlotCursor cursor () const =0
 Gets/sets the cursor for this canvas.
virtual void setCursor (PlotCursor cursor)=0
virtual void refresh ()=0
 
 Refreshes the GUI, which includes redrawing plot items as needed even if

drawing is currently being held.

virtual void refresh (int drawLayersFlag)=0
 Refreshes the GUI, ONLY for the layers as indicated by the flag.
virtual bool isQWidget () const =0
 Indicates whether a cast to QWidget would succeed for this object.
virtual PlotAxisBitset shownAxes () const =0
 Axes Methods //.
virtual void showAxes (PlotAxisBitset axes)=0
 Shows/Hides axes based on the given bitset, which should be a bitwise-or of PlotAxis values.
virtual void showAxis (PlotAxis axis, bool show=true)
 Shows/hides the given axis.
virtual void showAxes (PlotAxis xAxis, PlotAxis yAxis, bool show=true)
 Convenience method for showing/hiding two axes at once.
virtual void showAllAxes (bool show)
 Convenience method for showing/hiding all four axes at once.
virtual PlotAxisScale axisScale (PlotAxis axis) const =0
 Returns the scale for the given axis.
virtual void setAxisScale (PlotAxis axis, PlotAxisScale scale)=0
 Sets the scale for the given axis and rescales accordingly.
virtual void setAxesScales (PlotAxis xAxis, PlotAxisScale xScale, PlotAxis yAxis, PlotAxisScale yScale)
 Convenience method for setting the axis scale for two axes at once.
virtual bool axisReferenceValueSet (PlotAxis axis) const =0
 Gets/Sets the reference values for the given axis.
virtual double axisReferenceValue (PlotAxis axis) const =0
virtual void setAxisReferenceValue (PlotAxis axis, bool on, double value=0)=0
virtual bool cartesianAxisShown (PlotAxis axis) const =0
 Returns whether the given Cartesian axis is shown or not.
virtual void showCartesianAxis (PlotAxis mirrorAxis, PlotAxis secondaryAxis, bool show=true, bool hideNormalAxis=true)=0
 Show or hide the given Cartesian axis.
virtual void showCartesianAxis (PlotAxis mirrorAxis, bool show=true, bool hideNormalAxis=true)
 Convenience methods for most common Cartesian axes cases.
virtual void showCartesianAxes (bool show=true, bool hideNormal=true)
virtual String axisLabel (PlotAxis axis) const =0
 Returns the label for the given axis, or an empty String if none is shown.
virtual void setAxisLabel (PlotAxis axis, const String &title)=0
 Sets the label of an axis title to the given.
virtual void clearAxesLabels ()
 Convenience method for clearing labels from all axes.
virtual PlotFontPtr axisFont (PlotAxis axis) const =0
 Returns a copy of the font used for the given axis label.
virtual void setAxisFont (PlotAxis axis, const PlotFont &font)=0
 Set the font of the axis title to the given.
virtual void setAxisFont (PlotAxis axis, const PlotFontPtr font)
 Convenience method for setting axis font.
virtual bool colorBarShown (PlotAxis axis=Y_RIGHT) const =0
 Returns true if a color bar is shown on the given axis, false otherwise.
virtual void showColorBar (bool show=true, PlotAxis axis=Y_RIGHT)=0
 Shows/hides a color bar is shown on the given axis.
virtual prange_t axisRange (PlotAxis axis) const =0
 Axes Range Methods //.
virtual PlotRegion axesRanges (PlotAxis xAxis, PlotAxis yAxis) const
 Returns the displayed ranges of the given axes, in world coordinates.
virtual void setAxisRange (PlotAxis axis, double from, double to)=0
 Sets the displayed range of the given axis, in world coordinates.
virtual void setAxisRange (PlotAxis axis, const prange_t &range)
 See setAxisRange(PlotAxis, double, double).
virtual void setAxesRanges (PlotAxis xAxis, double xFrom, double xTo, PlotAxis yAxis, double yFrom, double yTo)
 Sets the displayed ranges of the given axes, in world coordinates.
virtual void setAxesRanges (PlotAxis xAxis, const prange_t &xRange, PlotAxis yAxis, const prange_t &yRange)
virtual void setAxesRegion (PlotAxis xAxis, PlotAxis yAxis, const PlotRegion &region)
 Sets the displayed range of the given axes.
virtual void moveAxisRange (PlotAxis axis, double delta)
 Moves (pans) the axes range by the given delta, in world coordinates.
virtual void moveAxesRanges (PlotAxis xAxis, double xDelta, PlotAxis yAxis, double yDelta)
virtual bool axesAutoRescale () const =0
 Returns true if the axes are set to autorescale when a new plot item is added, false otherwise.
virtual void setAxesAutoRescale (bool autoRescale=true)=0
 Sets auto-rescaling for future plot items.
virtual void rescaleAxes ()=0
 Rescales the axis to show all plot items on the canvas.
virtual bool axesRatioLocked () const =0
 Returns true if the axes ratio is locked, false otherwise.
virtual void setAxesRatioLocked (bool locked=true)=0
 Sets whether the axes ratio is locked or not.
virtual PlotAxesStackaxesStack ()
 Stack Methods //.
virtual const PlotAxesStackaxesStack () const
virtual bool axesStackMove (int delta)
 Convenience method to move along the PlotAxesStack associated with this canvas (see axesStack()).
virtual int axesStackLengthLimit () const
 Gets/Sets the length limit on the PlotAxesStack associated with this canvas.
virtual void setAxesStackLengthLimit (int lengthLimit)
virtual int cachedAxesStackSizeLimit () const =0
 Gets/Sets the size limit, in kilobytes, on the draw cache for the axes stack associated with this canvas (see PlotFactory::canvasHasCachedAxesStack()).
virtual void setCachedAxesStackSizeLimit (int sizeInKilobytes)=0
virtual pair< int, int > cachedAxesStackImageSize () const
 Gets/Sets the size of the image used for the cached axes stack, in pixels.
virtual void setCachedAxesStackImageSize (int width, int height)
virtual bool plotItem (PlotItemPtr item, PlotCanvasLayer layer=MAIN)=0
 Plot Methods //.
virtual bool plot (PlotPtr plot, bool overplot=true)
 Item-specific add methods.
virtual bool plotPoint (PlotPointPtr point)
virtual bool drawShape (PlotShapePtr shape)
virtual bool drawAnnotation (PlotAnnotationPtr annotation)
virtual vector< PlotItemPtrallPlotItems () const =0
 Returns all plot items currently on the canvas.
virtual vector< PlotPtr > allPlots () const
 Item-specific all methods.
virtual vector< PlotPointPtr > allPoints () const
virtual vector< PlotShapePtrallShapes () const
virtual vector< PlotAnnotationPtr > allAnnotations () const
virtual unsigned int numPlotItems () const
 Returns the number of plot items currently on the canvas.
virtual unsigned int numPlots () const
 Item-specific num methods.
virtual unsigned int numPoints () const
virtual unsigned int numShapes () const
virtual unsigned int numAnnotations () const
virtual vector< PlotItemPtrlayerPlotItems (PlotCanvasLayer layer) const =0
 Returns all plot items currently on the given layer of the canvas.
virtual vector< PlotPtr > layerPlots (PlotCanvasLayer layer) const
 Item-specific layer methods.
virtual vector< PlotPointPtr > layerPoints (PlotCanvasLayer layer) const
virtual vector< PlotShapePtrlayerShapes (PlotCanvasLayer layer) const
virtual vector< PlotAnnotationPtr > layerAnnotations (PlotCanvasLayer l) const
virtual unsigned int numLayerPlotItems (PlotCanvasLayer layer) const
 Returns the number of plot items currently on the given layer of the canvas.
virtual unsigned int numLayerPlots (PlotCanvasLayer layer) const
 Item-specific layer num methods.
virtual unsigned int numLayerPoints (PlotCanvasLayer layer) const
virtual unsigned int numLayerShapes (PlotCanvasLayer layer) const
virtual unsigned int numLayerAnnotations (PlotCanvasLayer layer) const
virtual void removePlotItem (PlotItemPtr item)
 Removes the given item from this canvas (if valid) and updates the GUI.
virtual void removePlot (PlotPtr plot)
 Item-specific remove methods.
virtual void removePoint (PlotPointPtr point)
virtual void removeShape (PlotShapePtr shape)
virtual void removeAnnotation (PlotAnnotationPtr annotation)
virtual void removePlotItems (const vector< PlotItemPtr > &items)=0
 Removes the given items from this canvas (if valid) and updates the GUI.
virtual void removeLastPlotItem ()
 Removes the last plot item added to the canvas and updates the GUI.
virtual void removeLastPlot ()
 Item-specific remove last methods.
virtual void removeLastPoint ()
virtual void removeLastShape ()
virtual void removeLastAnnotation ()
virtual void clearItems ()
 Clears all plot items from this canvas and updates the GUI.
virtual void clearPlots ()
 Item-specific clear methods.
virtual void clearPoints ()
virtual void clearShapes ()
virtual void clearAnnotations ()
virtual void clearLayer (PlotCanvasLayer layer)
 Clears all plot items from the given layer on this canvas and updates the GUI.
virtual void holdDrawing ()=0
 Draw Methods //.
virtual void releaseDrawing ()=0
virtual bool drawingIsHeld () const =0
virtual void registerDrawWatcher (PlotDrawWatcherPtr watcher)
 Registers/Unregisters the given draw watcher for this canvas.
virtual void unregisterDrawWatcher (PlotDrawWatcherPtr watcher)
virtual PlotOperationPtr operationDraw ()
 Returns a PlotOperation object that can be used to track drawing progress across threads.
virtual PlotOperationPtr operationDraw (PlotMutexPtr mutex)
virtual bool selectLineShown () const
 Selection Methods //.
virtual void setSelectLineShown (bool shown=true)=0
 Sets whether a line is shown for the selection tool.
virtual PlotLinePtr selectLine () const =0
 returns a copy of the line for the selection tool
virtual void setSelectLine (const PlotLine &line)=0
 set the line for the selection tool
virtual void setSelectLine (const PlotLinePtr line)
 Convenience methods for setting selection line.
virtual void setSelectLine (const String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
virtual bool gridShown (bool *xMajor=NULL, bool *xMinor=NULL, bool *yMajor=NULL, bool *yMinor=NULL) const =0
 Grid Methods //.
virtual void showGrid (bool xMajor, bool xMinor, bool yMajor, bool yMinor)=0
 Sets whether the grid is shown, for each of the given line groups.
virtual void showGrid (bool showAll=true)
 Convenience methods for showing/hiding the grid.
virtual void showGridMajor (bool show=true)
virtual void showGridMinor (bool show=true)
virtual bool gridXMajorShown () const
 Gets/Sets whether major grid lines are shown for the x-axis.
virtual void showGridXMajor (bool s=true)
virtual bool gridXMinorShown () const
 Gets/Sets whether minor grid lines are shown for the x-axis.
virtual void showGridXMinor (bool s=true)
virtual bool gridYMajorShown () const
 Gets/Sets whether major grid lines are shown for the y-axis.
virtual void showGridYMajor (bool s=true)
virtual bool gridYMinorShown () const
 Gets/Sets whether minor grid lines are shown for the y-axis.
virtual void showGridYMinor (bool s=true)
virtual PlotLinePtr gridMajorLine () const =0
 Returns a copy of the line used to draw the major grid lines.
virtual void setGridMajorLine (const PlotLine &line)=0
 Sets the line used to draw the major grid lines.
virtual PlotLinePtr gridMinorLine () const =0
 Returns a copy of the line used to draw the minor grid lines.
virtual void setGridMinorLine (const PlotLine &line)=0
 Sets the line used to draw the minor grid lines.
virtual void setGridMajorLine (const PlotLinePtr line)
 Convenience methods for setting major/minor grid lines.
virtual void setGridMajorLine (const String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
virtual void setGridMinorLine (const PlotLinePtr line)
virtual void setGridMinorLine (const String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
virtual bool legendShown () const =0
 Legend Methods //.
virtual void showLegend (bool on=true, LegendPosition position=EXT_BOTTOM)=0
 Show/hide the legend.
virtual LegendPosition legendPosition () const =0
 Returns the position of the legend.
virtual void setLegendPosition (LegendPosition position)=0
 Sets the position of the legend, if it is shown.
virtual PlotLinePtr legendLine () const =0
 Returns a copy of the line used to outline the legend.
virtual void setLegendLine (const PlotLine &line)=0
 Sets the line used to outline the legend.
virtual void setLegendLine (const PlotLinePtr line)
 Convenience methods for setting legend line.
virtual void setLegendLine (const String &color, PlotLine::Style style=PlotLine::SOLID, double width=1.0)
virtual PlotAreaFillPtr legendFill () const =0
 Returns a copy of the area fill used for the legend background.
virtual void setLegendFill (const PlotAreaFill &area)=0
 Sets the area fill used for the legend background.
virtual void setLegendFill (const PlotAreaFillPtr area)
 Convenience methods for setting legend background.
virtual void setLegendFill (const String &color, PlotAreaFill::Pattern pattern=PlotAreaFill::FILL)
virtual PlotFontPtr legendFont () const =0
 Returns a copy of the font used for the legend text.
virtual void setLegendFont (const PlotFont &font)=0
 Sets the font used for the legend text.
virtual void setLegendFont (const PlotFontPtr font)
 Convenience method for setting legend font.
virtual bool autoIncrementColors () const =0
 Miscellaneous Plotting Functionality //.
virtual void setAutoIncrementColors (bool autoInc=true)=0
 Sets whether adding new overplotted plots should automatically "increment" colors or not.
virtual bool exportToFile (const PlotExportFormat &format)=0
 Exports this canvas to the given format and returns true on success.
virtual PlotOperationPtr operationExport ()
 Returns a PlotOperation object that can be used to track export progress across threads.
virtual PlotOperationPtr operationExport (PlotMutexPtr mutex)
virtual String fileChooserDialog (const String &title="File Chooser", const String &directory="")=0
 Shows a file chooser dialog and return the absolute filename that the user chooses.
virtual const StringdateFormat () const =0
 Gets/Sets the date format for this canvas.
virtual void setDateFormat (const String &dateFormat)=0
virtual const StringrelativeDateFormat () const =0
 Gets/Sets the date format for values relative to a reference value for this canvas.
virtual void setRelativeDateFormat (const String &dateFormat)=0
virtual PlotCoordinate convertCoordinate (const PlotCoordinate &coord, PlotCoordinate::System newSystem=PlotCoordinate::WORLD) const =0
 Converts the given coordinate into a coordinate with the given system.
virtual PlotRegion convertRegion (const PlotRegion &region, PlotCoordinate::System newSystem) const
 Converts the given region into a region with the given system.
virtual vector< double > textWidthHeightDescent (const String &text, PlotFontPtr font) const =0
 Returns the width, height, and descent for the given text in the given font.
virtual vector< double > annotationWidthHeightDescent (const PlotAnnotationPtr annot) const
 Returns the width, height, and descent for the given annotation.
virtual int implementation () const =0
 Returns the implementation of this canvas as a Plotter::Implementation value.
virtual PlotFactoryimplementationFactory () const =0
 Returns a new instance of a PlotFactory that can create plot items for this implementation.
virtual PlotMutexPtr mutex () const
 Returns a mutex appropriate for this implementation.
virtual vector< vector< pair
< unsigned int, unsigned int > > > * 
locate (const PlotRegion &region) const
 Locate data indices that have values within the given region such that: x >= region.upperLeft().x() && x <= region.lowerRight().x() && y <= region.upperLeft().y() && y >= region.lowerRight().y().
virtual void locateAndLog (const PlotRegion &region, PlotLoggerPtr logger) const
 Calls locate() and posts the result to the given log.
virtual void registerMouseTool (PlotMouseToolPtr tool, bool activate=true, bool blocking=false)
 Tool Methods //.
virtual vector< PlotMouseToolPtr > allMouseTools () const
virtual vector< PlotMouseToolPtr > activeMouseTools () const
virtual void unregisterMouseTool (PlotMouseToolPtr tool)
virtual
PlotStandardMouseToolGroupPtr 
standardMouseTools ()
 Returns the standard mouse tools associated with this canvas.
virtual void registerSelectHandler (PlotSelectEventHandlerPtr handler, PlotCoordinate::System system=PlotCoordinate::WORLD)
 Event Handler Methods //.
virtual vector
< PlotSelectEventHandlerPtr
allSelectHandlers () const
virtual void unregisterSelectHandler (PlotSelectEventHandlerPtr handler)
virtual void registerClickHandler (PlotClickEventHandlerPtr handler, PlotCoordinate::System system=PlotCoordinate::WORLD)
 Manage click handlers.
virtual vector
< PlotClickEventHandlerPtr
allClickHandlers () const
virtual void unregisterClickHandler (PlotClickEventHandlerPtr handler)
virtual void registerMousePressHandler (PlotMousePressEventHandlerPtr hndlr, PlotCoordinate::System system=PlotCoordinate::WORLD)
 Manage mouse press handlers.
virtual vector
< PlotMousePressEventHandlerPtr
allMousePressHandlers () const
virtual void unregisterMousePressHandler (PlotMousePressEventHandlerPtr handler)
virtual void registerMouseReleaseHandler (PlotMouseReleaseEventHandlerPtr handler, PlotCoordinate::System system=PlotCoordinate::WORLD)
 Manage mouse release handlers.
virtual vector
< PlotMouseReleaseEventHandlerPtr
allMouseReleaseHandlers () const
virtual void unregisterMouseReleaseHandler (PlotMouseReleaseEventHandlerPtr handler)
virtual void registerMouseDragHandler (PlotMouseDragEventHandlerPtr h, PlotCoordinate::System system=PlotCoordinate::WORLD)
 Manage mouse drag handlers.
virtual vector
< PlotMouseDragEventHandlerPtr
allMouseDragHandlers () const
virtual void unregisterMouseDragHandler (PlotMouseDragEventHandlerPtr h)
virtual void registerMouseMoveHandler (PlotMouseMoveEventHandlerPtr h, PlotCoordinate::System system=PlotCoordinate::WORLD)
 Manage mouse move handlers.
virtual vector
< PlotMouseMoveEventHandlerPtr
allMouseMoveHandlers () const
virtual void unregisterMouseMoveHandler (PlotMouseMoveEventHandlerPtr h)
virtual void registerWheelHandler (PlotWheelEventHandlerPtr handler, PlotCoordinate::System system=PlotCoordinate::WORLD)
 Manage wheel handlers.
virtual vector
< PlotWheelEventHandlerPtr
allWheelHandlers () const
virtual void unregisterWheelHandler (PlotWheelEventHandlerPtr handler)
virtual void registerKeyHandler (PlotKeyEventHandlerPtr handler)
 Manage key handlers.
virtual vector
< PlotKeyEventHandlerPtr
allKeyHandlers () const
virtual void unregisterKeyHandler (PlotKeyEventHandlerPtr handler)
virtual void registerResizeHandler (PlotResizeEventHandlerPtr handler)
 Manage resize handlers.
virtual vector
< PlotResizeEventHandlerPtr
allResizeHandlers () const
virtual void unregisterResizeHandler (PlotResizeEventHandlerPtr handler)

Static Public Member Functions

static vector< LegendPositionallLegendPositions ()
 Returns all legend positions.
static vector< StringallLegendPositionStrings ()
static String legendPosition (LegendPosition p)
 Converts between legend positions and their String representations.
static LegendPosition legendPosition (String p, bool *ok=NULL)
static bool legendPositionIsInternal (LegendPosition p)
 Indicates whether the given legend position is internal to the canvas or not.
static vector< PlotAxisallAxes ()
 Returns a vector containing all values in the PlotAxis enum, ordered from lowest value to highest value.
static int allAxesFlag ()
 Returns the or'ed value of all PlotAxis enum values.
static vector< PlotCanvasLayerallLayers ()
 Returns a vector containing all values in the PlotCanvasLayer enum, ordered from lowest value to highest value.
static int allLayersFlag ()
 Returns the or'ed value of all PlotCanvasLayer enum values.

Static Public Attributes

static const String OPERATION_DRAW
 Convenient access to operation names.
static const String OPERATION_EXPORT

Protected Member Functions

void resetMouseTools ()
 Resets mouse tools.
bool notifyDrawWatchers (PlotOperationPtr drawOperation, bool drawingIsThreaded, int drawnLayersFlag)
 Notifies any registered draw watchers that a draw is about to begin, and returns the AND of the PlotDrawWatcher::canvasDrawBeginning() results.
bool notifySelectHandlers (const PlotRegion &selectedRegion)
 Notification methods for event handlers.
bool notifyMouseHandlers (PlotMouseEvent::Type type, PlotMouseEvent::Button button, const PlotCoordinate &coord)
bool notifyClickHandlers (PlotMouseEvent::Button button, const PlotCoordinate &coord)
bool notifyPressHandlers (PlotMouseEvent::Button button, const PlotCoordinate &coord)
bool notifyReleaseHandlers (PlotMouseEvent::Button button, const PlotCoordinate &coord)
bool notifyDragHandlers (PlotMouseEvent::Button button, const PlotCoordinate &coord)
bool notifyMoveHandlers (PlotMouseEvent::Button button, const PlotCoordinate &coord)
bool notifyWheelHandlers (int delta, const PlotCoordinate &coord)
bool notifyKeyHandlers (char key, const vector< PlotKeyEvent::Modifier > &modifiers)
bool notifyResizeHandlers (int oldWidth, int oldHeight, int newWidth, int newHeight)

Protected Attributes

PlotAxesStack m_stack
 
     

PlotOperationPtr m_drawOperation
 One-per-canvas operations.
PlotOperationPtr m_exportOperation
vector< PlotDrawWatcherPtrm_drawWatchers
 Draw watchers.
PlotStandardMouseToolGroupPtr m_standardTools
 One-per-canvas standard mouse tools.
vector< PlotMouseToolPtr > m_mouseTools
 Registered mouse tools.
vector< pair
< PlotSelectEventHandlerPtr,
PlotCoordinate::System > > 
m_selectHandlers
 Event handlers.
vector< pair
< PlotClickEventHandlerPtr,
PlotCoordinate::System > > 
m_clickHandlers
vector< pair
< PlotMousePressEventHandlerPtr,
PlotCoordinate::System > > 
m_pressHandlers
vector< pair
< PlotMouseReleaseEventHandlerPtr,
PlotCoordinate::System > > 
m_releaseHandlers
vector< pair
< PlotMouseDragEventHandlerPtr,
PlotCoordinate::System > > 
m_dragHandlers
vector< pair
< PlotMouseMoveEventHandlerPtr,
PlotCoordinate::System > > 
m_moveHandlers
vector< pair
< PlotWheelEventHandlerPtr,
PlotCoordinate::System > > 
m_wheelHandlers
vector< PlotKeyEventHandlerPtrm_keyHandlers
vector< PlotResizeEventHandlerPtrm_resizeHandlers

Detailed Description

PlotCanvas is an area for different PlotItems to be attached and drawn.

It also has axes and other properties. It's one of the more important plotting classes.

Definition at line 85 of file PlotCanvas.h.


Member Enumeration Documentation

Static //.

Position that the legend can be in, relative to the canvas.

Enumerator:
INT_URIGHT 
INT_LRIGHT 
INT_ULEFT 
INT_LLEFT 
EXT_RIGHT 
EXT_TOP 
EXT_LEFT 
EXT_BOTTOM 

Definition at line 90 of file PlotCanvas.h.


Constructor & Destructor Documentation

Non-Static //.

Constructor.

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

Destructor.


Member Function Documentation

virtual vector<PlotMouseToolPtr> casa::PlotCanvas::activeMouseTools ( ) const [virtual]
virtual vector<PlotAnnotationPtr> casa::PlotCanvas::allAnnotations ( ) const [virtual]
ENUMS Enum for the four plot axes If this enum is changed casa::PlotCanvas::allAxes ( ) [static]

Returns a vector containing all values in the PlotAxis enum, ordered from lowest value to highest value.

static int casa::PlotCanvas::allAxesFlag ( ) [static]

Returns the or'ed value of all PlotAxis enum values.

virtual vector<PlotClickEventHandlerPtr> casa::PlotCanvas::allClickHandlers ( ) const [virtual]
virtual vector<PlotKeyEventHandlerPtr> casa::PlotCanvas::allKeyHandlers ( ) const [virtual]
static vector<PlotCanvasLayer> casa::PlotCanvas::allLayers ( ) [static]

Returns a vector containing all values in the PlotCanvasLayer enum, ordered from lowest value to highest value.

static int casa::PlotCanvas::allLayersFlag ( ) [static]

Returns the or'ed value of all PlotCanvasLayer enum values.

Returns all legend positions.

virtual vector<PlotMouseToolPtr> casa::PlotCanvas::allMouseTools ( ) const [virtual]
virtual vector<PlotItemPtr> casa::PlotCanvas::allPlotItems ( ) const [pure virtual]

Returns all plot items currently on the canvas.

virtual vector<PlotPtr> casa::PlotCanvas::allPlots ( ) const [virtual]

Item-specific all methods.

DEFAULT IMPLEMENTATION.

virtual vector<PlotPointPtr> casa::PlotCanvas::allPoints ( ) const [virtual]
virtual vector<PlotShapePtr> casa::PlotCanvas::allShapes ( ) const [virtual]
virtual vector<PlotWheelEventHandlerPtr> casa::PlotCanvas::allWheelHandlers ( ) const [virtual]
virtual vector<double> casa::PlotCanvas::annotationWidthHeightDescent ( const PlotAnnotationPtr  annot) const [virtual]

Returns the width, height, and descent for the given annotation.

Note: this was put into place for use in a matplotlib backend, but probably doesn't have much use outside that. DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::autoIncrementColors ( ) const [pure virtual]

Miscellaneous Plotting Functionality //.

Returns true if autoincrementcolors is on, false otherwise. (See setAutoIncrementColors().)

virtual bool casa::PlotCanvas::axesAutoRescale ( ) const [pure virtual]

Returns true if the axes are set to autorescale when a new plot item is added, false otherwise.

virtual PlotRegion casa::PlotCanvas::axesRanges ( PlotAxis  xAxis,
PlotAxis  yAxis 
) const [virtual]

Returns the displayed ranges of the given axes, in world coordinates.

DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::axesRatioLocked ( ) const [pure virtual]

Returns true if the axes ratio is locked, false otherwise.

If the ratio is locked, resizing one axis will resize the others proportionally.

Stack Methods //.

Returns a single PlotAxesStack associated with this canvas. Note that the canvas itself doesn't modify/use this stack AT ALL; it is expressly for outside tools/classes/etc to have a single stack per canvas. DEFAULT IMPLEMENTATION.

virtual const PlotAxesStack& casa::PlotCanvas::axesStack ( ) const [virtual]
virtual int casa::PlotCanvas::axesStackLengthLimit ( ) const [virtual]

Gets/Sets the length limit on the PlotAxesStack associated with this canvas.

See PlotAxesStack::lengthLimit() and PlotAxesStack::setLengthLimit(). DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::axesStackMove ( int  delta) [virtual]

Convenience method to move along the PlotAxesStack associated with this canvas (see axesStack()).

Calls the stack's moveAndReturn method, and then sets the axes ranges to the returned PlotRegion. If delta is 0, the stack is moved to its base; otherwise it moves forward or backward from the current stack index (see PlotAxesStack::moveAndReturn()). Returns true if the operation succeeded, false otherwise (for invalid delta). DEFAULT IMPLEMENTATION.

virtual PlotFontPtr casa::PlotCanvas::axisFont ( PlotAxis  axis) const [pure virtual]

Returns a copy of the font used for the given axis label.

If no title is shown this behavior is undefined.

virtual String casa::PlotCanvas::axisLabel ( PlotAxis  axis) const [pure virtual]

Returns the label for the given axis, or an empty String if none is shown.

virtual prange_t casa::PlotCanvas::axisRange ( PlotAxis  axis) const [pure virtual]

Axes Range Methods //.

Returns the displayed range of the given axis, in world coordinates.

virtual double casa::PlotCanvas::axisReferenceValue ( PlotAxis  axis) const [pure virtual]
virtual bool casa::PlotCanvas::axisReferenceValueSet ( PlotAxis  axis) const [pure virtual]

Gets/Sets the reference values for the given axis.

If a reference value is set for an axis, its tick labels use an offset from that value instead of the actual tick value. For example, if a reference value is set to 15, instead of ticks reading "14 15 16" they would read "-1 0 1".

virtual PlotAxisScale casa::PlotCanvas::axisScale ( PlotAxis  axis) const [pure virtual]

Returns the scale for the given axis.

virtual PlotAreaFillPtr casa::PlotCanvas::background ( ) const [pure virtual]

Returns a copy of the canvas background.

virtual pair<int, int> casa::PlotCanvas::cachedAxesStackImageSize ( ) const [virtual]

Gets/Sets the size of the image used for the cached axes stack, in pixels.

The default implementation is set to (-1, -1) which means that the images are set to the current size of the canvas. It could be useful to set this value to a large size so that, for example, resizing wouldn't require a redraw of the whole canvas but rather just resizing the larger image to a smaller one. DEFAULT IMPLEMENTATION.

virtual int casa::PlotCanvas::cachedAxesStackSizeLimit ( ) const [pure virtual]

Gets/Sets the size limit, in kilobytes, on the draw cache for the axes stack associated with this canvas (see PlotFactory::canvasHasCachedAxesStack()).

A zero or negative value means no limit. NOTE: Only valid for implementations that supports a cached axes stack.

virtual bool casa::PlotCanvas::cartesianAxisShown ( PlotAxis  axis) const [pure virtual]

Returns whether the given Cartesian axis is shown or not.

(See showCartesianAxis().)

virtual void casa::PlotCanvas::clearAnnotations ( ) [virtual]
virtual void casa::PlotCanvas::clearAxesLabels ( ) [virtual]

Convenience method for clearing labels from all axes.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::clearItems ( ) [virtual]

Clears all plot items from this canvas and updates the GUI.

May reset registered PlotTools. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::clearLayer ( PlotCanvasLayer  layer) [virtual]

Clears all plot items from the given layer on this canvas and updates the GUI.

May reset registered PlotTools. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::clearPlots ( ) [virtual]

Item-specific clear methods.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::clearPoints ( ) [virtual]
virtual void casa::PlotCanvas::clearShapes ( ) [virtual]
virtual bool casa::PlotCanvas::colorBarShown ( PlotAxis  axis = Y_RIGHT) const [pure virtual]

Returns true if a color bar is shown on the given axis, false otherwise.

A color bar should only be shown when one of more of the items on the canvas is a RasterPlot or a SpectrogramPlot. If there are multiple raster or spectrograms, behavior is undefined.

virtual PlotCoordinate casa::PlotCanvas::convertCoordinate ( const PlotCoordinate &  coord,
PlotCoordinate::System  newSystem = PlotCoordinate::WORLD 
) const [pure virtual]

Converts the given coordinate into a coordinate with the given system.

virtual PlotRegion casa::PlotCanvas::convertRegion ( const PlotRegion region,
PlotCoordinate::System  newSystem 
) const [virtual]

Converts the given region into a region with the given system.

DEFAULT IMPLEMENTATION.

virtual PlotCursor casa::PlotCanvas::cursor ( ) const [pure virtual]

Gets/sets the cursor for this canvas.

virtual const String& casa::PlotCanvas::dateFormat ( ) const [pure virtual]

Gets/Sets the date format for this canvas.

See Plotter::dateFormat().

virtual bool casa::PlotCanvas::drawAnnotation ( PlotAnnotationPtr  annotation) [virtual]
virtual bool casa::PlotCanvas::drawingIsHeld ( ) const [pure virtual]
virtual bool casa::PlotCanvas::drawShape ( PlotShapePtr  shape) [virtual]
virtual bool casa::PlotCanvas::exportToFile ( const PlotExportFormat format) [pure virtual]

Exports this canvas to the given format and returns true on success.

virtual String casa::PlotCanvas::fileChooserDialog ( const String title = "File Chooser",
const String directory = "" 
) [pure virtual]

Shows a file chooser dialog and return the absolute filename that the user chooses.

If a directory is given, start the dialog there. If the user cancels the dialog, an empty String should be returned.

virtual PlotLinePtr casa::PlotCanvas::gridMajorLine ( ) const [pure virtual]

Returns a copy of the line used to draw the major grid lines.

virtual PlotLinePtr casa::PlotCanvas::gridMinorLine ( ) const [pure virtual]

Returns a copy of the line used to draw the minor grid lines.

virtual bool casa::PlotCanvas::gridShown ( bool *  xMajor = NULL,
bool *  xMinor = NULL,
bool *  yMajor = NULL,
bool *  yMinor = NULL 
) const [pure virtual]

Grid Methods //.

Returns true if any grid lines are shown, false otherwise. If bool parameters are given, they will be set for if each line group is shown or not.

virtual bool casa::PlotCanvas::gridXMajorShown ( ) const [virtual]

Gets/Sets whether major grid lines are shown for the x-axis.

DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::gridXMinorShown ( ) const [virtual]

Gets/Sets whether minor grid lines are shown for the x-axis.

DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::gridYMajorShown ( ) const [virtual]

Gets/Sets whether major grid lines are shown for the y-axis.

DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::gridYMinorShown ( ) const [virtual]

Gets/Sets whether minor grid lines are shown for the y-axis.

DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::hasCachedAxesStack ( ) const [virtual]

See PlotFactory::hasCachedAxesStack().

DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::hasCachedLayerDrawing ( ) const [virtual]

See PlotFactory::canvasHasCachedLayerDrawing().

DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::hasThreadedDrawing ( ) const [virtual]

Support Methods //.

See PlotFactory::canvasHasThreadedDrawing(). DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::holdDrawing ( ) [pure virtual]

Draw Methods //.

Hold or release drawing of plot items on the canvas. This can be used, for example, when adding many items to a canvas to avoid redrawing the canvas until all items are on. Hold/release are NOT recursive.

virtual int casa::PlotCanvas::implementation ( ) const [pure virtual]

Returns the implementation of this canvas as a Plotter::Implementation value.

virtual PlotFactory* casa::PlotCanvas::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::PlotCanvas::isQWidget ( ) const [pure virtual]

Indicates whether a cast to QWidget would succeed for this object.

virtual vector<PlotAnnotationPtr> casa::PlotCanvas::layerAnnotations ( PlotCanvasLayer  l) const [virtual]
virtual vector<PlotItemPtr> casa::PlotCanvas::layerPlotItems ( PlotCanvasLayer  layer) const [pure virtual]

Returns all plot items currently on the given layer of the canvas.

virtual vector<PlotPtr> casa::PlotCanvas::layerPlots ( PlotCanvasLayer  layer) const [virtual]

Item-specific layer methods.

DEFAULT IMPLEMENTATION.

virtual vector<PlotPointPtr> casa::PlotCanvas::layerPoints ( PlotCanvasLayer  layer) const [virtual]
virtual vector<PlotShapePtr> casa::PlotCanvas::layerShapes ( PlotCanvasLayer  layer) const [virtual]
virtual PlotAreaFillPtr casa::PlotCanvas::legendFill ( ) const [pure virtual]

Returns a copy of the area fill used for the legend background.

virtual PlotFontPtr casa::PlotCanvas::legendFont ( ) const [pure virtual]

Returns a copy of the font used for the legend text.

virtual PlotLinePtr casa::PlotCanvas::legendLine ( ) const [pure virtual]

Returns a copy of the line used to outline the legend.

Converts between legend positions and their String representations.

static LegendPosition casa::PlotCanvas::legendPosition ( String  p,
bool *  ok = NULL 
) [static]
virtual LegendPosition casa::PlotCanvas::legendPosition ( ) const [pure virtual]

Returns the position of the legend.

Note: if the legend is hidden, this behavior is undefined.

Indicates whether the given legend position is internal to the canvas or not.

virtual bool casa::PlotCanvas::legendShown ( ) const [pure virtual]

Legend Methods //.

Returns whether the legend is shown or not

virtual vector<vector<pair<unsigned int, unsigned int> > >* casa::PlotCanvas::locate ( const PlotRegion region) const [virtual]

Locate data indices that have values within the given region such that: x >= region.upperLeft().x() && x <= region.lowerRight().x() && y <= region.upperLeft().y() && y >= region.lowerRight().y().

The returned vector has length equal to allPlots().size() (in other words, each plot on the canvas has an index in the returned vector). Each element of the returned vector is a list of all the data indices that are in the region. Each element in this list is a range of indices. For plots that have no data in the region, the list is empty.

For example, say there are two plots on the canvas. In the first plot, indices 1, 2, 3, 7, and 10 are in the region; in the second plot, indices 6 and 7 are in the region. The returned value would be a vector of size 2. The first element would be the list [(1, 3), (7, 7), (10, 10)] while the second element would be the list [(6, 7)]. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::locateAndLog ( const PlotRegion region,
PlotLoggerPtr  logger 
) const [virtual]

Calls locate() and posts the result to the given log.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::moveAxesRanges ( PlotAxis  xAxis,
double  xDelta,
PlotAxis  yAxis,
double  yDelta 
) [virtual]
virtual void casa::PlotCanvas::moveAxisRange ( PlotAxis  axis,
double  delta 
) [virtual]

Moves (pans) the axes range by the given delta, in world coordinates.

Implies setAxesAutoRescale(false), and does NOT reset tool stacks since the tools may be using these methods. DEFAULT IMPLEMENTATION.

virtual PlotMutexPtr casa::PlotCanvas::mutex ( ) const [virtual]

Returns a mutex appropriate for this implementation.

DEFAULT IMPLEMENTATION.

bool casa::PlotCanvas::notifyClickHandlers ( PlotMouseEvent::Button  button,
const PlotCoordinate &  coord 
) [protected]
bool casa::PlotCanvas::notifyDragHandlers ( PlotMouseEvent::Button  button,
const PlotCoordinate &  coord 
) [protected]
bool casa::PlotCanvas::notifyDrawWatchers ( PlotOperationPtr  drawOperation,
bool  drawingIsThreaded,
int  drawnLayersFlag 
) [protected]

Notifies any registered draw watchers that a draw is about to begin, and returns the AND of the PlotDrawWatcher::canvasDrawBeginning() results.

See PlotDrawWatcher::canvasDrawBeginning() for parameters.

bool casa::PlotCanvas::notifyKeyHandlers ( char  key,
const vector< PlotKeyEvent::Modifier > &  modifiers 
) [protected]
bool casa::PlotCanvas::notifyMouseHandlers ( PlotMouseEvent::Type  type,
PlotMouseEvent::Button  button,
const PlotCoordinate &  coord 
) [protected]
bool casa::PlotCanvas::notifyMoveHandlers ( PlotMouseEvent::Button  button,
const PlotCoordinate &  coord 
) [protected]
bool casa::PlotCanvas::notifyPressHandlers ( PlotMouseEvent::Button  button,
const PlotCoordinate &  coord 
) [protected]
bool casa::PlotCanvas::notifyReleaseHandlers ( PlotMouseEvent::Button  button,
const PlotCoordinate &  coord 
) [protected]
bool casa::PlotCanvas::notifyResizeHandlers ( int  oldWidth,
int  oldHeight,
int  newWidth,
int  newHeight 
) [protected]
bool casa::PlotCanvas::notifySelectHandlers ( const PlotRegion selectedRegion) [protected]

Notification methods for event handlers.

Returns true if one mouse tool or event handler was available to handle the event, false otherwise.

bool casa::PlotCanvas::notifyWheelHandlers ( int  delta,
const PlotCoordinate &  coord 
) [protected]
virtual unsigned int casa::PlotCanvas::numAnnotations ( ) const [virtual]
virtual unsigned int casa::PlotCanvas::numLayerAnnotations ( PlotCanvasLayer  layer) const [virtual]
virtual unsigned int casa::PlotCanvas::numLayerPlotItems ( PlotCanvasLayer  layer) const [virtual]

Returns the number of plot items currently on the given layer of the canvas.

DEFAULT IMPLEMENTATION.

virtual unsigned int casa::PlotCanvas::numLayerPlots ( PlotCanvasLayer  layer) const [virtual]

Item-specific layer num methods.

DEFAULT IMPLEMENTATION.

virtual unsigned int casa::PlotCanvas::numLayerPoints ( PlotCanvasLayer  layer) const [virtual]
virtual unsigned int casa::PlotCanvas::numLayerShapes ( PlotCanvasLayer  layer) const [virtual]
virtual unsigned int casa::PlotCanvas::numPlotItems ( ) const [virtual]

Returns the number of plot items currently on the canvas.

DEFAULT IMPLEMENTATION.

virtual unsigned int casa::PlotCanvas::numPlots ( ) const [virtual]

Item-specific num methods.

DEFAULT IMPLEMENTATION.

virtual unsigned int casa::PlotCanvas::numPoints ( ) const [virtual]
virtual unsigned int casa::PlotCanvas::numShapes ( ) const [virtual]

Returns a PlotOperation object that can be used to track drawing progress across threads.

There must be one PlotOperation for drawing per canvas. DEFAULT IMPLEMENTATION.

Returns a PlotOperation object that can be used to track export progress across threads.

There must be one PlotOperation for export per canvas. DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::plot ( PlotPtr  plot,
bool  overplot = true 
) [virtual]

Item-specific add methods.

DEFAULT IMPLEMENTATION.

virtual bool casa::PlotCanvas::plotItem ( PlotItemPtr  item,
PlotCanvasLayer  layer = MAIN 
) [pure virtual]

Plot Methods //.

Adds the given plot item to this canvas, if not null or otherwise invalid. Returns whether the adding succeeded or not. May reset registered PlotTools.

virtual bool casa::PlotCanvas::plotPoint ( PlotPointPtr  point) [virtual]
virtual void casa::PlotCanvas::refresh ( ) [pure virtual]

 Refreshes the GUI, which includes redrawing plot items as needed even if

drawing is currently being held.

virtual void casa::PlotCanvas::refresh ( int  drawLayersFlag) [pure virtual]

Refreshes the GUI, ONLY for the layers as indicated by the flag.

The flag should be a bitwise-or of PlotCanvasLayer values.

virtual void casa::PlotCanvas::registerClickHandler ( PlotClickEventHandlerPtr  handler,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
) [virtual]

Manage click handlers.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerDrawWatcher ( PlotDrawWatcherPtr  watcher) [virtual]

Registers/Unregisters the given draw watcher for this canvas.

See documentation for PlotDrawWatcher. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerKeyHandler ( PlotKeyEventHandlerPtr  handler) [virtual]

Manage key handlers.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerMouseDragHandler ( PlotMouseDragEventHandlerPtr  h,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
) [virtual]

Manage mouse drag handlers.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerMouseMoveHandler ( PlotMouseMoveEventHandlerPtr  h,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
) [virtual]

Manage mouse move handlers.

NOTE: since this can be costly, it should be avoided if possible. Implementation canvases are expected to conserve resources if no move handlers are registered. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerMousePressHandler ( PlotMousePressEventHandlerPtr  hndlr,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
) [virtual]

Manage mouse press handlers.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerMouseReleaseHandler ( PlotMouseReleaseEventHandlerPtr  handler,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
) [virtual]

Manage mouse release handlers.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerMouseTool ( PlotMouseToolPtr  tool,
bool  activate = true,
bool  blocking = false 
) [virtual]

Tool Methods //.

Manage mouse tools. DEFAULT IMPLEMENTATION.

Manage resize handlers.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerSelectHandler ( PlotSelectEventHandlerPtr  handler,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
) [virtual]

Event Handler Methods //.

Manage select handlers. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::registerWheelHandler ( PlotWheelEventHandlerPtr  handler,
PlotCoordinate::System  system = PlotCoordinate::WORLD 
) [virtual]

Manage wheel handlers.

DEFAULT IMPLEMENTATION.

virtual const String& casa::PlotCanvas::relativeDateFormat ( ) const [pure virtual]

Gets/Sets the date format for values relative to a reference value for this canvas.

See Plotter::relativeDateFormat().

virtual void casa::PlotCanvas::releaseDrawing ( ) [pure virtual]
virtual void casa::PlotCanvas::removeAnnotation ( PlotAnnotationPtr  annotation) [virtual]
virtual void casa::PlotCanvas::removeLastAnnotation ( ) [virtual]
virtual void casa::PlotCanvas::removeLastPlot ( ) [virtual]

Item-specific remove last methods.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::removeLastPlotItem ( ) [virtual]

Removes the last plot item added to the canvas and updates the GUI.

May reset registered PlotTools. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::removeLastPoint ( ) [virtual]
virtual void casa::PlotCanvas::removeLastShape ( ) [virtual]
virtual void casa::PlotCanvas::removePlot ( PlotPtr  plot) [virtual]

Item-specific remove methods.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::removePlotItem ( PlotItemPtr  item) [virtual]

Removes the given item from this canvas (if valid) and updates the GUI.

May reset registered PlotTools. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::removePlotItems ( const vector< PlotItemPtr > &  items) [pure virtual]

Removes the given items from this canvas (if valid) and updates the GUI.

May reset registered PlotTools.

virtual void casa::PlotCanvas::removePoint ( PlotPointPtr  point) [virtual]
virtual void casa::PlotCanvas::removeShape ( PlotShapePtr  shape) [virtual]
virtual void casa::PlotCanvas::rescaleAxes ( ) [pure virtual]

Rescales the axis to show all plot items on the canvas.

Implies setAxesAutoRescale(false), and may reset PlotTools.

void casa::PlotCanvas::resetMouseTools ( ) [protected]

Resets mouse tools.

virtual PlotLinePtr casa::PlotCanvas::selectLine ( ) const [pure virtual]

returns a copy of the line for the selection tool

virtual bool casa::PlotCanvas::selectLineShown ( ) const [virtual]

Selection Methods //.

Returns true if a line is shown for the selection tool, false otherwise. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setAutoIncrementColors ( bool  autoInc = true) [pure virtual]

Sets whether adding new overplotted plots should automatically "increment" colors or not.

If this property is true, each new overplotted plot should have a different color. The specific handling of this behavior is left up to the implementation.

virtual void casa::PlotCanvas::setAxesAutoRescale ( bool  autoRescale = true) [pure virtual]

Sets auto-rescaling for future plot items.

If autoRescale is true, implies setAxesRatioLocked(false).

virtual void casa::PlotCanvas::setAxesRanges ( PlotAxis  xAxis,
double  xFrom,
double  xTo,
PlotAxis  yAxis,
double  yFrom,
double  yTo 
) [virtual]

Sets the displayed ranges of the given axes, in world coordinates.

Implies setAxesAutoRescale(false), and does NOT reset tool stacks since the tools may be using this method. It is recommended that subclasses reimplement this to be more efficient. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setAxesRanges ( PlotAxis  xAxis,
const prange_t xRange,
PlotAxis  yAxis,
const prange_t yRange 
) [virtual]
virtual void casa::PlotCanvas::setAxesRatioLocked ( bool  locked = true) [pure virtual]

Sets whether the axes ratio is locked or not.

virtual void casa::PlotCanvas::setAxesRegion ( PlotAxis  xAxis,
PlotAxis  yAxis,
const PlotRegion region 
) [virtual]

Sets the displayed range of the given axes.

Implies setAxesAutoRescale(false), and does NOT reset tool stacks since the tools may be using this method. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setAxesScales ( PlotAxis  xAxis,
PlotAxisScale  xScale,
PlotAxis  yAxis,
PlotAxisScale  yScale 
) [virtual]

Convenience method for setting the axis scale for two axes at once.

May reset tool stacks. DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setAxesStackLengthLimit ( int  lengthLimit) [virtual]
virtual void casa::PlotCanvas::setAxisFont ( PlotAxis  axis,
const PlotFont font 
) [pure virtual]

Set the font of the axis title to the given.

virtual void casa::PlotCanvas::setAxisFont ( PlotAxis  axis,
const PlotFontPtr  font 
) [virtual]

Convenience method for setting axis font.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setAxisLabel ( PlotAxis  axis,
const String title 
) [pure virtual]

Sets the label of an axis title to the given.

Setting the title to an empty string should remove the title from the axis.

virtual void casa::PlotCanvas::setAxisRange ( PlotAxis  axis,
double  from,
double  to 
) [pure virtual]

Sets the displayed range of the given axis, in world coordinates.

Implies setAxesAutoRescale(false), and does NOT reset tool stacks since the tools may be using this method.

virtual void casa::PlotCanvas::setAxisRange ( PlotAxis  axis,
const prange_t range 
) [virtual]

See setAxisRange(PlotAxis, double, double).

DEFAULT IMPLEMTNATION.

virtual void casa::PlotCanvas::setAxisReferenceValue ( PlotAxis  axis,
bool  on,
double  value = 0 
) [pure virtual]
virtual void casa::PlotCanvas::setAxisScale ( PlotAxis  axis,
PlotAxisScale  scale 
) [pure virtual]

Sets the scale for the given axis and rescales accordingly.

May reset tool stacks.

virtual void casa::PlotCanvas::setBackground ( const PlotAreaFill areaFill) [pure virtual]

Sets the background of the canvas to the given.

virtual void casa::PlotCanvas::setBackground ( const PlotAreaFillPtr  areaFill) [virtual]

Convenience methods for setting background.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setBackground ( const String color,
PlotAreaFill::Pattern  pattern = PlotAreaFill::FILL 
) [virtual]
virtual void casa::PlotCanvas::setCachedAxesStackImageSize ( int  width,
int  height 
) [virtual]
virtual void casa::PlotCanvas::setCachedAxesStackSizeLimit ( int  sizeInKilobytes) [pure virtual]
virtual void casa::PlotCanvas::setCursor ( PlotCursor  cursor) [pure virtual]
virtual void casa::PlotCanvas::setDateFormat ( const String dateFormat) [pure virtual]
virtual void casa::PlotCanvas::setGridMajorLine ( const PlotLine line) [pure virtual]

Sets the line used to draw the major grid lines.

virtual void casa::PlotCanvas::setGridMajorLine ( const PlotLinePtr  line) [virtual]

Convenience methods for setting major/minor grid lines.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setGridMajorLine ( const String color,
PlotLine::Style  style = PlotLine::SOLID,
double  width = 1.0 
) [virtual]
virtual void casa::PlotCanvas::setGridMinorLine ( const PlotLine line) [pure virtual]

Sets the line used to draw the minor grid lines.

virtual void casa::PlotCanvas::setGridMinorLine ( const PlotLinePtr  line) [virtual]
virtual void casa::PlotCanvas::setGridMinorLine ( const String color,
PlotLine::Style  style = PlotLine::SOLID,
double  width = 1.0 
) [virtual]
virtual void casa::PlotCanvas::setLegendFill ( const PlotAreaFill area) [pure virtual]

Sets the area fill used for the legend background.

virtual void casa::PlotCanvas::setLegendFill ( const PlotAreaFillPtr  area) [virtual]

Convenience methods for setting legend background.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setLegendFill ( const String color,
PlotAreaFill::Pattern  pattern = PlotAreaFill::FILL 
) [virtual]
virtual void casa::PlotCanvas::setLegendFont ( const PlotFont font) [pure virtual]

Sets the font used for the legend text.

virtual void casa::PlotCanvas::setLegendFont ( const PlotFontPtr  font) [virtual]

Convenience method for setting legend font.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setLegendLine ( const PlotLine line) [pure virtual]

Sets the line used to outline the legend.

virtual void casa::PlotCanvas::setLegendLine ( const PlotLinePtr  line) [virtual]

Convenience methods for setting legend line.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setLegendLine ( const String color,
PlotLine::Style  style = PlotLine::SOLID,
double  width = 1.0 
) [virtual]
virtual void casa::PlotCanvas::setLegendPosition ( LegendPosition  position) [pure virtual]

Sets the position of the legend, if it is shown.

virtual void casa::PlotCanvas::setRelativeDateFormat ( const String dateFormat) [pure virtual]
virtual void casa::PlotCanvas::setSelectLine ( const PlotLine line) [pure virtual]

set the line for the selection tool

virtual void casa::PlotCanvas::setSelectLine ( const PlotLinePtr  line) [virtual]

Convenience methods for setting selection line.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::setSelectLine ( const String color,
PlotLine::Style  style = PlotLine::SOLID,
double  width = 1.0 
) [virtual]
virtual void casa::PlotCanvas::setSelectLineShown ( bool  shown = true) [pure virtual]

Sets whether a line is shown for the selection tool.

virtual void casa::PlotCanvas::setTitle ( const String title) [pure virtual]

Sets the text of the canvas title to the given.

Setting the title to an empty string should remove the title from the canvas.

virtual void casa::PlotCanvas::setTitleFont ( const PlotFont font) [pure virtual]

Set the font of the canvas title to the given.

virtual void casa::PlotCanvas::setTitleFont ( const PlotFontPtr  font) [virtual]

Convenience method for setting title font.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::showAllAxes ( bool  show) [virtual]

Convenience method for showing/hiding all four axes at once.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::showAxes ( PlotAxisBitset  axes) [pure virtual]

Shows/Hides axes based on the given bitset, which should be a bitwise-or of PlotAxis values.

virtual void casa::PlotCanvas::showAxes ( PlotAxis  xAxis,
PlotAxis  yAxis,
bool  show = true 
) [virtual]

Convenience method for showing/hiding two axes at once.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::showAxis ( PlotAxis  axis,
bool  show = true 
) [virtual]

Shows/hides the given axis.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::showCartesianAxes ( bool  show = true,
bool  hideNormal = true 
) [virtual]
virtual void casa::PlotCanvas::showCartesianAxis ( PlotAxis  mirrorAxis,
PlotAxis  secondaryAxis,
bool  show = true,
bool  hideNormalAxis = true 
) [pure virtual]

Show or hide the given Cartesian axis.

A Cartesian axis is different from a normal axis in that it is inside the graph, corresponding to the (0,0) location of the plot(s), rather than outside the graph. The secondary axis is the axis at which the mirrored axis will be placed at the 0 value of. For example, to show the Cartesian X_BOTTOM axis you'd likely want to mirror the axis at Y_LEFT = 0, so that would be the secondary axis. If hideNormalAxis is true, it is equivalent to showAxis(mirrorAxis, !hideNormalAxis).

virtual void casa::PlotCanvas::showCartesianAxis ( PlotAxis  mirrorAxis,
bool  show = true,
bool  hideNormalAxis = true 
) [virtual]

Convenience methods for most common Cartesian axes cases.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::showColorBar ( bool  show = true,
PlotAxis  axis = Y_RIGHT 
) [pure virtual]

Shows/hides a color bar is shown on the given axis.

(See colorBarShown().)

virtual void casa::PlotCanvas::showGrid ( bool  xMajor,
bool  xMinor,
bool  yMajor,
bool  yMinor 
) [pure virtual]

Sets whether the grid is shown, for each of the given line groups.

virtual void casa::PlotCanvas::showGrid ( bool  showAll = true) [virtual]

Convenience methods for showing/hiding the grid.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotCanvas::showGridMajor ( bool  show = true) [virtual]
virtual void casa::PlotCanvas::showGridMinor ( bool  show = true) [virtual]
virtual void casa::PlotCanvas::showGridXMajor ( bool  s = true) [virtual]
virtual void casa::PlotCanvas::showGridXMinor ( bool  s = true) [virtual]
virtual void casa::PlotCanvas::showGridYMajor ( bool  s = true) [virtual]
virtual void casa::PlotCanvas::showGridYMinor ( bool  s = true) [virtual]
virtual void casa::PlotCanvas::showLegend ( bool  on = true,
LegendPosition  position = EXT_BOTTOM 
) [pure virtual]

Show/hide the legend.

If on is true, show the legend in the given position.

virtual PlotAxisBitset casa::PlotCanvas::shownAxes ( ) const [pure virtual]

Axes Methods //.

Returns a bitwise-or of PlotAxis values corresponding to which sides are shown

virtual pair<int, int> casa::PlotCanvas::size ( ) const [pure virtual]

GUI Methods //.

Returns the canvas size in pixels (width x height).

virtual PlotStandardMouseToolGroupPtr casa::PlotCanvas::standardMouseTools ( ) [virtual]

Returns the standard mouse tools associated with this canvas.

If none is associated, creates and associates one that is non-active. DEFAULT IMPLEMENTATION.

virtual vector<double> casa::PlotCanvas::textWidthHeightDescent ( const String text,
PlotFontPtr  font 
) const [pure virtual]

Returns the width, height, and descent for the given text in the given font.

Note: this was put into place for use in a matplotlib backend, but probably doesn't have much use outside that.

virtual String casa::PlotCanvas::title ( ) const [pure virtual]

Returns the text of the canvas title, or an empty String if none is shown.

The title is shown above the plotting area.

virtual PlotFontPtr casa::PlotCanvas::titleFont ( ) const [pure virtual]

Returns a copy of the font used for the canvas title.

If no title is shown this behavior is undefined.

virtual void casa::PlotCanvas::unregisterDrawWatcher ( PlotDrawWatcherPtr  watcher) [virtual]
virtual void casa::PlotCanvas::unregisterMouseTool ( PlotMouseToolPtr  tool) [virtual]

Member Data Documentation

vector<pair<PlotClickEventHandlerPtr, PlotCoordinate::System> > casa::PlotCanvas::m_clickHandlers [protected]

Definition at line 981 of file PlotCanvas.h.

vector<pair<PlotMouseDragEventHandlerPtr, PlotCoordinate::System> > casa::PlotCanvas::m_dragHandlers [protected]

Definition at line 987 of file PlotCanvas.h.

One-per-canvas operations.

Definition at line 963 of file PlotCanvas.h.

Draw watchers.

Definition at line 968 of file PlotCanvas.h.

Definition at line 964 of file PlotCanvas.h.

Definition at line 992 of file PlotCanvas.h.

vector<PlotMouseToolPtr> casa::PlotCanvas::m_mouseTools [protected]

Registered mouse tools.

Definition at line 974 of file PlotCanvas.h.

vector<pair<PlotMouseMoveEventHandlerPtr, PlotCoordinate::System> > casa::PlotCanvas::m_moveHandlers [protected]

Definition at line 989 of file PlotCanvas.h.

vector<pair<PlotMousePressEventHandlerPtr, PlotCoordinate::System> > casa::PlotCanvas::m_pressHandlers [protected]

Definition at line 983 of file PlotCanvas.h.

vector<pair<PlotMouseReleaseEventHandlerPtr, PlotCoordinate::System> > casa::PlotCanvas::m_releaseHandlers [protected]

Definition at line 985 of file PlotCanvas.h.

Definition at line 993 of file PlotCanvas.h.

vector<pair<PlotSelectEventHandlerPtr, PlotCoordinate::System> > casa::PlotCanvas::m_selectHandlers [protected]

Event handlers.

Definition at line 979 of file PlotCanvas.h.

     

One-per-canvas axes stack.

Definition at line 959 of file PlotCanvas.h.

PlotStandardMouseToolGroupPtr casa::PlotCanvas::m_standardTools [protected]

One-per-canvas standard mouse tools.

Definition at line 971 of file PlotCanvas.h.

vector<pair<PlotWheelEventHandlerPtr, PlotCoordinate::System> > casa::PlotCanvas::m_wheelHandlers [protected]

Definition at line 991 of file PlotCanvas.h.

Convenient access to operation names.

Definition at line 133 of file PlotCanvas.h.

Definition at line 134 of file PlotCanvas.h.


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