VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkPlot Class Reference

Abstract class for 2D plots. More...

#include <vtkPlot.h>

Inheritance diagram for vtkPlot:
[legend]
Collaboration diagram for vtkPlot:
[legend]

Public Types

typedef vtkContextItem Superclass
 
- Public Types inherited from vtkContextItem
typedef vtkAbstractContextItem Superclass
 
- Public Types inherited from vtkAbstractContextItem
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void SetWidth (float width)
 
virtual float GetWidth ()
 
virtual void SetLabel (const vtkStdString &label)
 
virtual vtkStdString GetLabel ()
 
virtual void SetLabels (vtkStringArray *labels)
 
virtual vtkStringArrayGetLabels ()
 
virtual int GetNumberOfLabels ()
 
vtkStdString GetLabel (vtkIdType index)
 
void SetIndexedLabels (vtkStringArray *labels)
 
virtual vtkStringArrayGetIndexedLabels ()
 
virtual vtkTable * GetInput ()
 
virtual void SetInputArray (int index, const vtkStdString &name)
 
virtual void SetSelection (vtkIdTypeArray *id)
 
virtual vtkIdTypeArrayGetSelection ()
 
virtual bool PaintLegend (vtkContext2D *painter, const vtkRectf &rect, int legendIndex)
 
virtual void SetTooltipLabelFormat (const vtkStdString &label)
 
virtual vtkStdString GetTooltipLabelFormat ()
 
virtual vtkStdString GetTooltipLabel (const vtkVector2f &plotPos, vtkIdType seriesIndex, vtkIdType segmentIndex)
 
virtual vtkIdType GetNearestPoint (const vtkVector2f &point, const vtkVector2f &tolerance, vtkVector2f *location)
 
virtual bool SelectPoints (const vtkVector2f &min, const vtkVector2f &max)
 
virtual void SetColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 
virtual void SetColor (double r, double g, double b)
 
virtual void GetColor (double rgb[3])
 
void GetColor (unsigned char rgb[3])
 
virtual vtkPenGetPen ()
 
virtual vtkBrushGetBrush ()
 
virtual vtkContextMapper2DGetData ()
 
virtual bool GetUseIndexForXSeries ()
 
virtual void SetUseIndexForXSeries (bool)
 
virtual void SetInput (vtkTable *table)
 
virtual void SetInput (vtkTable *table, const vtkStdString &xColumn, const vtkStdString &yColumn)
 
void SetInput (vtkTable *table, vtkIdType xColumn, vtkIdType yColumn)
 
virtual vtkAxisGetXAxis ()
 
virtual void SetXAxis (vtkAxis *axis)
 
virtual vtkAxisGetYAxis ()
 
virtual void SetYAxis (vtkAxis *axis)
 
virtual void GetBounds (double bounds[4])
 
virtual void SetProperty (const vtkStdString &property, const vtkVariant &var)
 
virtual vtkVariant GetProperty (const vtkStdString &property)
 
- Public Member Functions inherited from vtkContextItem
virtual double GetOpacity ()
 
virtual void SetOpacity (double)
 
- Public Member Functions inherited from vtkAbstractContextItem
virtual void Update ()
 
virtual bool Paint (vtkContext2D *painter)
 
bool PaintChildren (vtkContext2D *painter)
 
virtual void ReleaseGraphicsResources ()
 
unsigned int AddItem (vtkAbstractContextItem *item)
 
bool RemoveItem (vtkAbstractContextItem *item)
 
bool RemoveItem (unsigned int index)
 
vtkAbstractContextItemGetItem (unsigned int index)
 
unsigned int GetNumberOfItems ()
 
void ClearItems ()
 
virtual bool Hit (const vtkContextMouseEvent &mouse)
 
virtual vtkAbstractContextItemGetPickedItem (const vtkContextMouseEvent &mouse)
 
virtual bool MouseEnterEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseMoveEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseLeaveEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseButtonPressEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseButtonReleaseEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseDoubleClickEvent (const vtkContextMouseEvent &mouse)
 
virtual void SetScene (vtkContextScene *scene)
 
virtual void SetParent (vtkAbstractContextItem *parent)
 
virtual vtkVector2f MapToParent (const vtkVector2f &point)
 
virtual vtkVector2f MapFromParent (const vtkVector2f &point)
 
virtual vtkVector2f MapToScene (const vtkVector2f &point)
 
virtual vtkVector2f MapFromScene (const vtkVector2f &point)
 
virtual bool MouseWheelEvent (const vtkContextMouseEvent &mouse, int delta)
 
vtkContextSceneGetScene ()
 
vtkAbstractContextItemGetParent ()
 
virtual bool GetVisible ()
 
virtual void SetVisible (bool)
 
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
 
virtual void DebugOff ()
 
unsigned char GetDebug ()
 
void SetDebug (unsigned char debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &os)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkPlotSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkContextItem
static int IsTypeOf (const char *type)
 
static vtkContextItemSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkAbstractContextItem
static int IsTypeOf (const char *type)
 
static vtkAbstractContextItemSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObject *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkPlot ()
 
 ~vtkPlot ()
 
vtkStdString GetNumber (double position, vtkAxis *axis)
 
- Protected Member Functions inherited from vtkContextItem
 vtkContextItem ()
 
 ~vtkContextItem ()
 
- Protected Member Functions inherited from vtkAbstractContextItem
 vtkAbstractContextItem ()
 
 ~vtkAbstractContextItem ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &os)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkPenPen
 
vtkBrushBrush
 
vtkSmartPointer< vtkStringArrayLabels
 
vtkSmartPointer< vtkStringArrayAutoLabels
 
vtkSmartPointer< vtkStringArrayIndexedLabels
 
bool UseIndexForXSeries
 
vtkContextMapper2DData
 
vtkIdTypeArraySelection
 
vtkAxisXAxis
 
vtkAxisYAxis
 
vtkStdString TooltipLabelFormat
 
vtkStdString TooltipDefaultLabelFormat
 
- Protected Attributes inherited from vtkContextItem
double Opacity
 
- Protected Attributes inherited from vtkAbstractContextItem
vtkContextSceneScene
 
vtkAbstractContextItemParent
 
vtkContextScenePrivateChildren
 
bool Visible
 
- Protected Attributes inherited from vtkObject
unsigned char Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
int ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Abstract class for 2D plots.

The base class for all plot types used in vtkChart derived charts.

See Also
vtkPlotPoints vtkPlotLine vtkPlotBar vtkChart vtkChartXY
Examples:
vtkPlot (Examples)
Tests:
vtkPlot (Tests)

Definition at line 50 of file vtkPlot.h.

Member Typedef Documentation

Definition at line 53 of file vtkPlot.h.

Constructor & Destructor Documentation

vtkPlot::vtkPlot ( )
protected
vtkPlot::~vtkPlot ( )
protected

Member Function Documentation

virtual const char* vtkPlot::GetClassName ( )
virtual
static int vtkPlot::IsTypeOf ( const char *  type)
static
virtual int vtkPlot::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkContextItem.

Reimplemented in vtkPlotPoints, vtkPlotStacked, vtkPlotBar, vtkPiecewiseControlPointsItem, vtkCompositeControlPointsItem, vtkControlPointsItem, vtkScalarsToColorsItem, vtkColorTransferControlPointsItem, vtkPlotParallelCoordinates, vtkPlotPie, vtkPlotHistogram2D, vtkPlotLine, vtkColorTransferFunctionItem, vtkLookupTableItem, vtkCompositeTransferFunctionItem, and vtkPiecewiseFunctionItem.

static vtkPlot* vtkPlot::SafeDownCast ( vtkObject o)
static
virtual void vtkPlot::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkContextItem.

Reimplemented in vtkPlotPoints, vtkPlotStacked, vtkPlotBar, vtkPiecewiseControlPointsItem, vtkCompositeControlPointsItem, vtkControlPointsItem, vtkScalarsToColorsItem, vtkColorTransferControlPointsItem, vtkPlotParallelCoordinates, vtkPlotPie, vtkPlotHistogram2D, vtkPlotLine, vtkColorTransferFunctionItem, vtkLookupTableItem, vtkCompositeTransferFunctionItem, and vtkPiecewiseFunctionItem.

virtual bool vtkPlot::PaintLegend ( vtkContext2D painter,
const vtkRectf rect,
int  legendIndex 
)
virtual

Paint legend event for the plot, called whenever the legend needs the plot items symbol/mark/line drawn. A rect is supplied with the lower left corner of the rect (elements 0 and 1) and with width x height (elements 2 and 3). The plot can choose how to fill the space supplied. The index is used by Plots that return more than one label.

Reimplemented in vtkPlotStacked, vtkPlotPoints, vtkPlotBar, vtkPlotParallelCoordinates, vtkPlotPie, and vtkPlotLine.

virtual void vtkPlot::SetTooltipLabelFormat ( const vtkStdString label)
virtual

Sets/gets a printf-style string to build custom tooltip labels from. An empty string generates the default tooltip labels. The following case-sensitive format tags (without quotes) are recognized: 'x' The X value of the plot element 'y' The Y value of the plot element 'i' The IndexedLabels entry for the plot element 'l' The value of the plot's GetLabel() function 's' (vtkPlotBar only) The Labels entry for the bar segment Any other characters or unrecognized format tags are printed in the tooltip label verbatim.

virtual vtkStdString vtkPlot::GetTooltipLabelFormat ( )
virtual

Sets/gets a printf-style string to build custom tooltip labels from. An empty string generates the default tooltip labels. The following case-sensitive format tags (without quotes) are recognized: 'x' The X value of the plot element 'y' The Y value of the plot element 'i' The IndexedLabels entry for the plot element 'l' The value of the plot's GetLabel() function 's' (vtkPlotBar only) The Labels entry for the bar segment Any other characters or unrecognized format tags are printed in the tooltip label verbatim.

virtual vtkStdString vtkPlot::GetTooltipLabel ( const vtkVector2f plotPos,
vtkIdType  seriesIndex,
vtkIdType  segmentIndex 
)
virtual

Generate and return the tooltip label string for this plot The segmentIndex parameter is ignored, except for vtkPlotBar

Reimplemented in vtkPlotBar.

virtual vtkIdType vtkPlot::GetNearestPoint ( const vtkVector2f point,
const vtkVector2f tolerance,
vtkVector2f location 
)
virtual

Function to query a plot for the nearest point to the specified coordinate. Returns the index of the data series with which the point is associated, or -1 if no point was found.

Reimplemented in vtkPlotBar, vtkPlotPoints, vtkPlotStacked, and vtkPlotPie.

virtual bool vtkPlot::SelectPoints ( const vtkVector2f min,
const vtkVector2f max 
)
virtual

Select all points in the specified rectangle.

Reimplemented in vtkPlotBar, vtkPlotPoints, vtkPlotStacked, and vtkControlPointsItem.

virtual void vtkPlot::SetColor ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)
virtual

Set the plot color

Reimplemented in vtkPlotBar, and vtkPlotStacked.

virtual void vtkPlot::SetColor ( double  r,
double  g,
double  b 
)
virtual

Set the plot color

Reimplemented in vtkPlotBar, and vtkPlotStacked.

virtual void vtkPlot::GetColor ( double  rgb[3])
virtual

Set the plot color

Reimplemented in vtkPlotBar, and vtkPlotStacked.

void vtkPlot::GetColor ( unsigned char  rgb[3])

Set the plot color

virtual void vtkPlot::SetWidth ( float  width)
virtual

Set the width of the line.

Reimplemented in vtkPlotBar.

virtual float vtkPlot::GetWidth ( )
virtual

Get the width of the line.

Reimplemented in vtkPlotBar.

virtual vtkPen* vtkPlot::GetPen ( )
virtual

Get a pointer to the vtkPen object that controls the was this plot draws lines.

virtual vtkBrush* vtkPlot::GetBrush ( )
virtual

Get a pointer to the vtkBrush object that controls the was this plot fills shapes.

virtual void vtkPlot::SetLabel ( const vtkStdString label)
virtual

Set the label of this plot.

virtual vtkStdString vtkPlot::GetLabel ( )
virtual

Get the label of this plot.

virtual void vtkPlot::SetLabels ( vtkStringArray labels)
virtual

Set the plot labels, these are used for stacked chart variants, with the index referring to the stacking index.

virtual vtkStringArray* vtkPlot::GetLabels ( )
virtual

Get the plot labels. If this array has a length greater than 1 the index refers to the stacked objects in the plot. See vtkPlotBar for example.

Reimplemented in vtkPlotBar, and vtkPlotStacked.

virtual int vtkPlot::GetNumberOfLabels ( )
virtual

Get the number of labels associated with this plot.

vtkStdString vtkPlot::GetLabel ( vtkIdType  index)

Get the label at the specified index.

void vtkPlot::SetIndexedLabels ( vtkStringArray labels)

Set indexed labels for the plot. If set, this array can be used to provide custom labels for each point in a plot. This array should be the same length as the points array. Default is null (no indexed labels).

virtual vtkStringArray* vtkPlot::GetIndexedLabels ( )
virtual

Get the indexed labels array.

virtual vtkContextMapper2D* vtkPlot::GetData ( )
virtual

Get the data object that the plot will draw.

virtual bool vtkPlot::GetUseIndexForXSeries ( )
virtual

Use the Y array index for the X value. If true any X column setting will be ignored, and the X values will simply be the index of the Y column.

virtual void vtkPlot::SetUseIndexForXSeries ( bool  )
virtual

Use the Y array index for the X value. If true any X column setting will be ignored, and the X values will simply be the index of the Y column.

virtual void vtkPlot::SetInput ( vtkTable *  table)
virtual

This is a convenience function to set the input table and the x, y column for the plot.

Reimplemented in vtkPlotParallelCoordinates, and vtkPlotHistogram2D.

virtual void vtkPlot::SetInput ( vtkTable *  table,
const vtkStdString xColumn,
const vtkStdString yColumn 
)
virtual

This is a convenience function to set the input table and the x, y column for the plot.

Reimplemented in vtkPlotParallelCoordinates, and vtkPlotHistogram2D.

void vtkPlot::SetInput ( vtkTable *  table,
vtkIdType  xColumn,
vtkIdType  yColumn 
)

This is a convenience function to set the input table and the x, y column for the plot.

virtual vtkTable* vtkPlot::GetInput ( )
virtual

Get the input table used by the plot.

virtual void vtkPlot::SetInputArray ( int  index,
const vtkStdString name 
)
virtual

Convenience function to set the input arrays. For most plots index 0 is the x axis, and index 1 is the y axis. The name is the name of the column in the vtkTable.

Reimplemented in vtkPlotBar, and vtkPlotStacked.

virtual void vtkPlot::SetSelection ( vtkIdTypeArray id)
virtual
virtual vtkIdTypeArray* vtkPlot::GetSelection ( )
virtual
virtual vtkAxis* vtkPlot::GetXAxis ( )
virtual

Get/set the X axis associated with this plot.

virtual void vtkPlot::SetXAxis ( vtkAxis axis)
virtual

Get/set the X axis associated with this plot.

virtual vtkAxis* vtkPlot::GetYAxis ( )
virtual

Get/set the Y axis associated with this plot.

virtual void vtkPlot::SetYAxis ( vtkAxis axis)
virtual

Get/set the Y axis associated with this plot.

virtual void vtkPlot::GetBounds ( double  bounds[4])
inlinevirtual
virtual void vtkPlot::SetProperty ( const vtkStdString property,
const vtkVariant var 
)
virtual

A General setter/getter that should be overridden. It can silently drop options, case is important

virtual vtkVariant vtkPlot::GetProperty ( const vtkStdString property)
virtual

A General setter/getter that should be overridden. It can silently drop options, case is important

vtkStdString vtkPlot::GetNumber ( double  position,
vtkAxis axis 
)
protected

Get the properly formatted number for the supplied position and axis.

Member Data Documentation

vtkPen* vtkPlot::Pen
protected

This object stores the vtkPen that controls how the plot is drawn.

Definition at line 235 of file vtkPlot.h.

vtkBrush* vtkPlot::Brush
protected

This object stores the vtkBrush that controls how the plot is drawn.

Definition at line 238 of file vtkPlot.h.

vtkSmartPointer<vtkStringArray> vtkPlot::Labels
protected

Plot labels, used by legend.

Definition at line 241 of file vtkPlot.h.

vtkSmartPointer<vtkStringArray> vtkPlot::AutoLabels
protected

Holds Labels when they're auto-created

Definition at line 244 of file vtkPlot.h.

vtkSmartPointer<vtkStringArray> vtkPlot::IndexedLabels
protected

Holds Labels when they're auto-created

Definition at line 247 of file vtkPlot.h.

bool vtkPlot::UseIndexForXSeries
protected

Use the Y array index for the X value. If true any X column setting will be ignored, and the X values will simply be the index of the Y column.

Definition at line 252 of file vtkPlot.h.

vtkContextMapper2D* vtkPlot::Data
protected

This data member contains the data that will be plotted, it inherits from vtkAlgorithm.

Definition at line 256 of file vtkPlot.h.

vtkIdTypeArray* vtkPlot::Selection
protected

Selected indices for the table the plot is rendering

Definition at line 259 of file vtkPlot.h.

vtkAxis* vtkPlot::XAxis
protected

The X axis associated with this plot.

Definition at line 262 of file vtkPlot.h.

vtkAxis* vtkPlot::YAxis
protected

The X axis associated with this plot.

Definition at line 265 of file vtkPlot.h.

vtkStdString vtkPlot::TooltipLabelFormat
protected

A printf-style string to build custom tooltip labels from. See the accessor/mutator functions for full documentation.

Definition at line 269 of file vtkPlot.h.

vtkStdString vtkPlot::TooltipDefaultLabelFormat
protected

The default printf-style string to build custom tooltip labels from. See the accessor/mutator functions for full documentation.

Definition at line 273 of file vtkPlot.h.


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