Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Related Pages  

vtkXYPlotActor Class Reference

generate an x-y plot from input dataset(s) or field data. More...

#include <vtkXYPlotActor.h>

Inheritance diagram for vtkXYPlotActor:

Inheritance graph
[legend]
Collaboration diagram for vtkXYPlotActor:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void AddInput (vtkDataSet *in)
void RemoveInput (vtkDataSet *in)
vtkDataSetCollectionGetInputList ()
void SetPointComponent (int i, int comp)
int GetPointComponent (int i)
virtual void SetXValues (int)
virtual int GetXValues ()
void SetXValuesToIndex ()
void SetXValuesToArcLength ()
void SetXValuesToNormalizedArcLength ()
void SetXValuesToValue ()
const char * GetXValuesAsString ()
void AddDataObjectInput (vtkDataObject *in)
void RemoveDataObjectInput (vtkDataObject *in)
vtkDataObjectCollectionGetDataObjectInputList ()
virtual void SetDataObjectPlotMode (int)
virtual int GetDataObjectPlotMode ()
void SetDataObjectPlotModeToRows ()
void SetDataObjectPlotModeToColumns ()
const char * GetDataObjectPlotModeAsString ()
void SetDataObjectXComponent (int i, int comp)
int GetDataObjectXComponent (int i)
void SetDataObjectYComponent (int i, int comp)
int GetDataObjectYComponent (int i)
void SetPlotColor (int i, float r, float g, float b)
void SetPlotColor (int i, float color[3])
float * GetPlotColor (int i)
void SetPlotSymbol (int i, vtkPolyData *input)
vtkPolyDataGetPlotSymbol (int i)
void SetPlotLabel (int i, const char *label)
const char * GetPlotLabel (int i)
vtkLegendBoxActorGetLegendBoxActor ()
vtkGlyphSource2DGetGlyphSource ()
virtual void SetTitle (const char *)
virtual char * GetTitle ()
virtual void SetXTitle (const char *)
virtual char * GetXTitle ()
virtual void SetYTitle (const char *)
virtual char * GetYTitle ()
virtual void SetXRange (float, float)
void SetXRange (float[2])
virtual float * GetXRange ()
virtual void GetXRange (float data[2])
virtual void SetYRange (float, float)
void SetYRange (float[2])
virtual float * GetYRange ()
virtual void GetYRange (float data[2])
void SetPlotRange (float xmin, float ymin, float xmax, float ymax)
virtual void SetNumberOfXLabels (int)
virtual int GetNumberOfXLabels ()
virtual void SetNumberOfYLabels (int)
virtual int GetNumberOfYLabels ()
void SetNumberOfLabels (int num)
virtual void SetLegend (int)
virtual int GetLegend ()
virtual void LegendOn ()
virtual void LegendOff ()
virtual void SetLegendPosition (float, float)
void SetLegendPosition (float[2])
virtual float * GetLegendPosition ()
virtual void GetLegendPosition (float &, float &)
virtual void GetLegendPosition (float[2])
virtual void SetLegendPosition2 (float, float)
void SetLegendPosition2 (float[2])
virtual float * GetLegendPosition2 ()
virtual void GetLegendPosition2 (float &, float &)
virtual void GetLegendPosition2 (float[2])
virtual void SetBold (int)
virtual int GetBold ()
virtual void BoldOn ()
virtual void BoldOff ()
virtual void SetItalic (int)
virtual int GetItalic ()
virtual void ItalicOn ()
virtual void ItalicOff ()
virtual void SetShadow (int)
virtual int GetShadow ()
virtual void ShadowOn ()
virtual void ShadowOff ()
virtual void SetFontFamily (int)
virtual int GetFontFamily ()
void SetFontFamilyToArial ()
void SetFontFamilyToCourier ()
void SetFontFamilyToTimes ()
virtual void SetLabelFormat (const char *)
virtual char * GetLabelFormat ()
virtual void SetBorder (int)
virtual int GetBorder ()
virtual int GetPlotPoints ()
virtual void SetPlotPoints (int)
virtual void PlotPointsOn ()
virtual void PlotPointsOff ()
virtual int GetPlotLines ()
virtual void SetPlotLines (int)
virtual void PlotLinesOn ()
virtual void PlotLinesOff ()
virtual void SetGlyphSize (float)
virtual float GetGlyphSize ()
void ViewportToPlotCoordinate (vtkViewport *viewport, float &u, float &v)
void ViewportToPlotCoordinate (vtkViewport *viewport)
virtual void SetPlotCoordinate (float, float)
void SetPlotCoordinate (float[2])
virtual float * GetPlotCoordinate ()
virtual void GetPlotCoordinate (float &, float &)
virtual void GetPlotCoordinate (float[2])
void PlotToViewportCoordinate (vtkViewport *viewport, float &u, float &v)
void PlotToViewportCoordinate (vtkViewport *viewport)
virtual void SetViewportCoordinate (float, float)
void SetViewportCoordinate (float[2])
virtual float * GetViewportCoordinate ()
virtual void GetViewportCoordinate (float &, float &)
virtual void GetViewportCoordinate (float[2])
int IsInPlot (vtkViewport *viewport, float u, float v)
unsigned long GetMTime ()
int RenderOpaqueGeometry (vtkViewport *)
int RenderOverlay (vtkViewport *)
int RenderTranslucentGeometry (vtkViewport *)
void ReleaseGraphicsResources (vtkWindow *)

Static Public Methods

int IsTypeOf (const char *type)
vtkXYPlotActor * SafeDownCast (vtkObject *o)
vtkXYPlotActor * New ()

Protected Methods

 vtkXYPlotActor ()
 ~vtkXYPlotActor ()
 vtkXYPlotActor (const vtkXYPlotActor &)
void operator= (const vtkXYPlotActor &)
void InitializeEntries ()
void ComputeXRange (float range[2], float *lengths)
void ComputeYRange (float range[2])
void ComputeDORange (float xrange[2], float yrange[2], float *lengths)
virtual void CreatePlotData (int *pos, int *pos2, float xRange[2], float yRange[2], float *norms, int numDS, int numDO)
void PlaceAxes (vtkViewport *viewport, int *size, int pos[2], int pos2[2])
void GenerateClipPlanes (int *pos, int *pos2)
float ComputeGlyphScale (int i, int *pos, int *pos2)
void ClipPlotData (int *pos, int *pos2, vtkPolyData *pd)

Protected Attributes

vtkDataSetCollectionInputList
vtkDataObjectCollectionDataObjectInputList
char * Title
char * XTitle
char * YTitle
int XValues
int NumberOfXLabels
int NumberOfYLabels
int Bold
int Italic
int Shadow
int FontFamily
char * LabelFormat
float XRange [2]
float YRange [2]
float XComputedRange [2]
float YComputedRange [2]
int Border
int PlotLines
int PlotPoints
vtkTextMapperTitleMapper
vtkActor2DTitleActor
vtkAxisActor2DXAxis
vtkAxisActor2DYAxis
float ViewportCoordinate [2]
float PlotCoordinate [2]
int DataObjectPlotMode
vtkIntArrayXComponent
vtkIntArrayYComponent
int NumberOfInputs
vtkPolyData ** PlotData
vtkGlyph2D ** PlotGlyph
vtkAppendPolyData ** PlotAppend
vtkPolyDataMapper2D ** PlotMapper
vtkActor2D ** PlotActor
int Legend
float LegendPosition [2]
float LegendPosition2 [2]
vtkLegendBoxActorLegendActor
vtkGlyphSource2DGlyphSource
vtkPlanesClipPlanes
float GlyphSize
int CachedSize [2]
vtkTimeStamp BuildTime

Detailed Description

generate an x-y plot from input dataset(s) or field data.

Date:
2000/12/10 20:08:28
Revision:
1.9
Thanks:
Thanks to Kitware & RPI/SCOREC who supported the development of this class.
vtkXYPlotActor creates an x-y plot of data from one or more input data sets or field data. The class plots dataset scalar values (y-axis) against the points (x-axis). The x-axis values are generated by taking the point ids, computing a cumulative arc length, or a normalized arc length. More than one input data set can be specified to generate multiple plots. Alternatively, if field data is supplied as input, the class plots one component against another. (The user must specify which component to use as the x-axis and which for the y-axis.)

To use this class to plot (a) dataset(s), you must specify one or more input data set containing scalar and point data. You'll probably also want to invoke a method to control how the point coordinates are converted into x values (by default point ids are used).

To use this class to plot field data, you must specify one or more input data objects with its associated field data. You'll also want to specify which component to use as the x-axis and which to use as the y-axis. Note that when plotting field data, the x and y values are used directly (i.e., there are no options to normalize the components).

Once you've set up the plot, you'll want to position it. The PositionCoordinate defines the lower-left location of the x-y plot (specified in normalized viewport coordinates) and the Position2Coordinate define the upper-right corner. (Note: the Position2Coordinate is relative to PositionCoordinate, so you can move the vtkXYPlotActor around the viewport by setting just the PositionCoordinate.) The combination of the two position coordinates specifies a rectangle in which the plot will lie.

Optional features include the ability to specify axes labels, label format, plot title, and control font properties and type. You can also manually specify the x and y plot ranges (by default they are computed automatically). The Border instance variable is used to create space between the boundary of the plot window (specified by PositionCoordinate and Position2Coordinate) and the plot itself.

Warning:
If you are interested in plotting something other than scalar data, you can use the vtk data shuffling filters (e.g., vtkAttributeDataToFieldDataFilter snd vtkFieldDataToAttributeDataFilter) to convert the data into scalar data and/or points.
See also:
vtkActor2D vtkTextMapper vtkScalarBarActor vtkAxisActor2D vtkCubeAxesActor vtkAttributeDataToFieldDataFilter vtkFieldDataToAttributeDataFilter
Examples:
vtkXYPlotActor (examples)


Member Function Documentation

void vtkXYPlotActor::AddDataObjectInput vtkDataObject   in
 

Add a dataset to the list of data to append.

void vtkXYPlotActor::AddInput vtkDataSet   in
 

Add a dataset to the list of data to append.

virtual const char* vtkXYPlotActor::GetClassName   [virtual]
 

Return the class name as a string. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

vtkDataObjectCollection* vtkXYPlotActor::GetDataObjectInputList   [inline]
 

Return the list of inputs to this filter.

vtkDataSetCollection* vtkXYPlotActor::GetInputList   [inline]
 

Return the list of inputs to this filter.

vtkLegendBoxActor* vtkXYPlotActor::GetLegendBoxActor   [inline]
 

Retrieve handles to the legend box and glyph source. This is useful if you would like to change the default behavior of the legend box or glyph source. For example, the default glyph can be changed from a line to a vertex plus line, etc.)

unsigned long vtkXYPlotActor::GetMTime   [virtual]
 

Take into account the modified time of internal helper classes. region used by the plot plus the labels)?

Reimplemented from vtkActor2D.

virtual int vtkXYPlotActor::GetPlotLines   [virtual]
 

Set/Get whether the lines are rendered. The line width can be set in the property object.

virtual int vtkXYPlotActor::GetPlotPoints   [virtual]
 

Set/Get whether the points are rendered. The point size can be set in the property object. This is a global flag which affects the plot only if per curve symbols are not defined.

virtual int vtkXYPlotActor::IsA const char *    type [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 vtkActor2D.

int vtkXYPlotActor::IsInPlot vtkViewport   viewport,
float    u,
float    v
 

Is the specified viewport position within the plot area (as opposed to the region used by the plot plus the labels)?

int vtkXYPlotActor::IsTypeOf const char *    type [static]
 

Return 1 if this class type 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 vtkActor2D.

vtkXYPlotActor* vtkXYPlotActor::New   [static]
 

Instantiate object with autorange computation; bold, italic, and shadows on; arial font family; the number of labels set to 5 for the x and y axes; a label format of "%-#6.3g"; and x coordinates computed from point ids.

Reimplemented from vtkActor2D.

void vtkXYPlotActor::PlotToViewportCoordinate vtkViewport   viewport
 

An alternate form of PlotToViewportCoordinate() above. This method inputs the plot coordinate pair (defined in the ivar PlotCoordinate) and then stores them in the ivar ViewportCoordinate. (This method can be wrapped.)

void vtkXYPlotActor::PlotToViewportCoordinate vtkViewport   viewport,
float &    u,
float &    v
 

Given a plot coordinate, return the viewpoint position

void vtkXYPlotActor::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 vtkActor2D.

void vtkXYPlotActor::ReleaseGraphicsResources vtkWindow   [virtual]
 

Release any graphics resources that are being consumed by this actor. The parameter window could be used to determine which graphic resources to release.

Reimplemented from vtkActor2D.

void vtkXYPlotActor::RemoveDataObjectInput vtkDataObject   in
 

Remove a dataset from the list of data to append.

void vtkXYPlotActor::RemoveInput vtkDataSet   in
 

Remove a dataset from the list of data to append.

int vtkXYPlotActor::RenderOpaqueGeometry vtkViewport   [virtual]
 

WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS. Draw the x-y plot.

Reimplemented from vtkActor2D.

int vtkXYPlotActor::RenderOverlay vtkViewport   [virtual]
 

Support the standard render methods.

Reimplemented from vtkActor2D.

vtkXYPlotActor* vtkXYPlotActor::SafeDownCast vtkObject   o [static]
 

Will cast the supplied object to vtkObject* is this is a safe operation (i.e., a safe downcast); otherwise NULL is returned. This method is defined in all subclasses of vtkObject with the vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkActor2D.

virtual void vtkXYPlotActor::SetBold int    [virtual]
 

Enable/Disable bolding annotation text.

virtual void vtkXYPlotActor::SetBorder int    [virtual]
 

Set/Get the spacing between the plot window and the plot. The value is specified in pixels.

virtual void vtkXYPlotActor::SetDataObjectPlotMode int    [virtual]
 

Indicate whether to plot rows or columns. If plotting rows, then the dependent variables is taken from a specified row, versus rows (y).

void vtkXYPlotActor::SetDataObjectXComponent int    i,
int    comp
 

Specify which component of the input data object to use as the independent variable for the ith input data object. (This ivar is ignored if plotting the index.) Note that the value is interpreted differently depending on DataObjectPlotMode. If the mode is Rows, then the value of DataObjectXComponent is the row number; otherwise it's the column number.

void vtkXYPlotActor::SetDataObjectYComponent int    i,
int    comp
 

Specify which component of the input data object to use as the dependent variable for the ith input data object. (This ivar is ignored if plotting the index.) Note that the value is interpreted differently depending on DataObjectPlotMode. If the mode is Rows, then the value of DataObjectYComponent is the row number; otherwise it's the column number.

virtual void vtkXYPlotActor::SetFontFamily int    [virtual]
 

Set/Get the font family for the annotation text. Three font types are available: Arial (VTK_ARIAL), Courier (VTK_COURIER), and Times (VTK_TIMES).

virtual void vtkXYPlotActor::SetGlyphSize float    [virtual]
 

Set/Get the factor that controls how big glyphs are in the plot. The number is expressed as a fraction of the length of the diagonal of the plot bounding box.

virtual void vtkXYPlotActor::SetItalic int    [virtual]
 

Enable/Disable italicizing annotation text.

virtual void vtkXYPlotActor::SetLabelFormat const char *    [virtual]
 

Set/Get the format with which to print the labels on the scalar bar.

virtual void vtkXYPlotActor::SetLegend int    [virtual]
 

Enable/Disable the creation of a legend. If on, the legend labels will be created automatically unless the per plot legend symbol has been set.

virtual void vtkXYPlotActor::SetLegendPosition float   ,
float   
[virtual]
 

Use these methods to control the position of the legend. The variables LegendPosition and LegendPosition2 define the lower-left and upper-right position of the legend. The coordinates are expressed as normalized values with respect to the rectangle defined by PositionCoordinate and Position2Coordinate. Note that LegendPosition2 is relative to LegendPosition.

virtual void vtkXYPlotActor::SetNumberOfXLabels int    [virtual]
 

Set/Get the number of annotation labels to show along the x and y axes. This values is a suggestion: the number of labels may vary depending on the particulars of the data. The convenience method SetNumberOfLables() sets the number of x and y labels to the same value.

void vtkXYPlotActor::SetPointComponent int    i,
int    comp
 

If plotting points by value, which component to use to determine the value. This sets a value per each input dataset (i.e., the ith dataset).

virtual void vtkXYPlotActor::SetShadow int    [virtual]
 

Enable/Disable creating shadows on the annotation text. Shadows make the text easier to read.

virtual void vtkXYPlotActor::SetTitle const char *    [virtual]
 

Set/Get the title of the x-y plot, and the title along the x and y axes.

virtual void vtkXYPlotActor::SetXRange float   ,
float   
[virtual]
 

Set the plot range (range of independent and dependent variables) to plot. Data outside of the range will be clipped. If the plot range of either the x or y variables is set to (v1,v2), where v1 == v2, then the range will be computed automatically. Note that the x-range values should be consistent with the way the independent variable is created (via INDEX, DISTANCE, or ARC_LENGTH).

virtual void vtkXYPlotActor::SetXValues int    [virtual]
 

Specify how the independent (x) variable is computed from the points. The independent variable can be the scalar/point index (i.e., point id), the accumulated arc length along the points, the normalized arc length, or by component value. If plotting datasets (e.g., points), the value that is used is specified by the PointComponent ivar. (Note: these methods also control how field data is plotted. Field data is usually plotted by value or index, if plotting length 1-dimensional length measures are used.)

void vtkXYPlotActor::ViewportToPlotCoordinate vtkViewport   viewport
 

An alternate form of ViewportToPlotCoordinate() above. This method inputs the viewport coordinate pair (defined by the ivar ViewportCoordinate)and then stores them in the ivar PlotCoordinate.

void vtkXYPlotActor::ViewportToPlotCoordinate vtkViewport   viewport,
float &    u,
float &    v
 

Given a position within the viewport used by the plot, return the the plot coordinates (XAxis value, YAxis value)


The documentation for this class was generated from the following file:
Generated on Tue Mar 19 13:36:01 2002 for VTK by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002