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

PlotItem is the superclass of any object that is meant to be placed on the canvas (plots, annotations, shapes, etc.). More...

#include <PlotItem.h>

Inheritance diagram for casa::PlotItem:
casa::Plot casa::PlotAnnotation casa::PlotPoint casa::PlotShape casa::BarPlot casa::RasterPlot casa::ScatterPlot casa::PlotShapeArc casa::PlotShapeArrow casa::PlotShapeEllipse casa::PlotShapeLine casa::PlotShapePath casa::PlotShapePolygon casa::PlotShapeRectangle

Public Member Functions

 PlotItem ()
 Constructor. More...
 
virtual ~PlotItem ()
 Destructor. More...
 
virtual PlotCanvascanvas () const =0
 Returns the canvas this item is currently attached to, or NULL for none. More...
 
virtual casacore::String title () const =0
 Returns a human-readable title for identification. More...
 
virtual void setTitle (const casacore::String &newTitle)=0
 Sets this items's title to the given. More...
 
virtual bool isValid () const =0
 Returns true if this item is valid, false otherwise. More...
 
virtual bool isQWidget () const =0
 Returns whether this item can be directly casted to a QWidget or not. More...
 
virtual PlotAxis xAxis () const =0
 Returns the item's axes. More...
 
virtual PlotAxis yAxis () const =0
 
virtual void setXAxis (PlotAxis x)=0
 Sets the item's axes. More...
 
virtual void setYAxis (PlotAxis y)=0
 
virtual void setAxes (PlotAxis x, PlotAxis y)
 Sets both the item's axes at once. More...
 
virtual unsigned int drawCount () const =0
 Returns the "draw count" for this item, which subjectively means how many indexed draw operations this item needs to make. More...
 
virtual unsigned int drawSegments (unsigned int segmentThreshold) const
 Returns the number of draw segments for this item, using the given segment threshold. More...
 

Detailed Description

PlotItem is the superclass of any object that is meant to be placed on the canvas (plots, annotations, shapes, etc.).

A PlotItem is assumed to have an x and y axis for drawing on the canvas.

Definition at line 40 of file PlotItem.h.

Constructor & Destructor Documentation

casa::PlotItem::PlotItem ( )

Constructor.

virtual casa::PlotItem::~PlotItem ( )
virtual

Destructor.

Member Function Documentation

virtual PlotCanvas* casa::PlotItem::canvas ( ) const
pure virtual

Returns the canvas this item is currently attached to, or NULL for none.

virtual unsigned int casa::PlotItem::drawCount ( ) const
pure virtual

Returns the "draw count" for this item, which subjectively means how many indexed draw operations this item needs to make.

This is used to make comparative judgments about how long each item will take to draw, and to possibly divide up the work for larger items. For example, a plot with 1000 data points might return 1000, while a square might return 1. Whatever number is returned, the item should expect to be able to draw given two indexes; for example, a plot should be able to draw from index 0 to index 100.

Implemented in casa::BarPlot, casa::PlotPoint, casa::PlotShapePath, casa::PlotShapePolygon, casa::ScatterPlot, casa::PlotAnnotation, and casa::PlotShape.

virtual unsigned int casa::PlotItem::drawSegments ( unsigned int  segmentThreshold) const
virtual

Returns the number of draw segments for this item, using the given segment threshold.

See DrawCount(). DEFAULT IMPLEMENTATION.

virtual bool casa::PlotItem::isQWidget ( ) const
pure virtual

Returns whether this item can be directly casted to a QWidget or not.

virtual bool casa::PlotItem::isValid ( ) const
pure virtual

Returns true if this item is valid, false otherwise.

Although validity varies between items, canvases should NOT draw items which are invalid.

virtual void casa::PlotItem::setAxes ( PlotAxis  x,
PlotAxis  y 
)
virtual

Sets both the item's axes at once.

DEFAULT IMPLEMENTATION.

virtual void casa::PlotItem::setTitle ( const casacore::String newTitle)
pure virtual

Sets this items's title to the given.

virtual void casa::PlotItem::setXAxis ( PlotAxis  x)
pure virtual

Sets the item's axes.

virtual void casa::PlotItem::setYAxis ( PlotAxis  y)
pure virtual
virtual casacore::String casa::PlotItem::title ( ) const
pure virtual

Returns a human-readable title for identification.

Doesn't have to be unique. Used for (for example) legends and other user-interactions. Note: PlotItems that have no titles should not be shown on the legend.

virtual PlotAxis casa::PlotItem::xAxis ( ) const
pure virtual

Returns the item's axes.

virtual PlotAxis casa::PlotItem::yAxis ( ) const
pure virtual

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