Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

vtkStringDataMapper Class Reference

draw text labels at dataset points. More...

#include <vtkStringDataMapper.h>

Inheritance diagram for vtkStringDataMapper

Inheritance 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 RenderOpaqueGeometry (vtkViewport* viewport, vtkActor2D* actor)
void RenderOverlay (vtkViewport* viewport, vtkActor2D* actor)
virtual void SetInput ( vtkDataSet *)
virtual vtkDataSetGetInput ()
virtual void ReleaseGraphicsResources (vtkWindow *)
virtual void SetLabelMode ( int )
virtual int GetLabelMode ()
void SetLabelModeToLabelIds ()
void SetLabelModeToLabelScalars ()
void SetLabelModeToLabelVectors ()
void SetLabelModeToLabelNormals ()
void SetLabelModeToLabelTCoords ()
void SetLabelModeToLabelTensors ()
void SetLabelModeToLabelFieldData ()
virtual void SetFontSize ( int )
virtual int GetFontSize ()
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 SetLabelAsString ( int )
virtual int GetLabelAsString ()
virtual void LabelAsStringOn ()
virtual void LabelAsStringOff ()
virtual void SetLabeledComponent ( int )
virtual int GetLabeledComponent ()
virtual void SetFieldDataArray ( int )
virtual int GetFieldDataArray ()

Static Public Methods

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

Protected Methods

 vtkStringDataMapper ()
 ~vtkStringDataMapper ()
 vtkStringDataMapper (const vtkStringDataMapper&)
void operator= (const vtkStringDataMapper&)

Protected Attributes

vtkDataSetInput
int LabelMode
int FontSize
int Bold
int Italic
int Shadow
int FontFamily
char* LabelFormat
int LabelAsString
int LabeledComponent
int FieldDataArray
vtkTimeStamp BuildTime

Detailed Description

draw text labels at dataset points.

vtkStringDataMapper is a mapper that renders text at dataset points. Various items can be labeled including point ids, scalars, vectors, normals, texture coordinates, tensors, and field data components. This is essentially a vtkLabeledDataMapper with added option to render data as string.

The format with which the label is drawn is specified using a printf style format string. The font attributes of the text can also be set (font style, size, bold, italic, shadow). The color of the text is controlled by the actor2D's color property (i.e., the actor associated with this mapper).

By default, all the components of multi-component data such as vectors, normals, texture coordinates, tensors, and multi-component scalars are labeled. However, you can specify a single component if you prefer. (Note: the label format specifies the format to use for a single component. The label is created by looping over all components and using the label format to render each component.) For labeling strings set label mode to label field data (which must have a vtkCharArray with strings), label format to "%s" and set LabelAsString to on.

Warning:
Use this filter in combination with vtkSelectVisiblePoints if you want to label only points that are visible. If you want to label cells rather than points, use the filter vtkCellCenters to generate points at the center of the cells. Also, you can use the class vtkIdFilter to generate ids as scalars or field data, which can then be labeled.

See also:
vtkMapper2D vtkActor2D vtkTextMapper vtkSelectVisiblePoints vtkIdFilter vtkCellCenters vtkLabeledDataMapper


Member Function Documentation

vtkStringDataMapper * New ( ) [static]
 

Instantiate object with font size 12 of font Arial (bolding, italic, shadows on) and %-#6.3g label format. By default, point ids are labeled.

Reimplemented from vtkMapper2D.

void 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.

void RenderOpaqueGeometry ( vtkViewport * viewport,
vtkActor2D * actor )
 

Draw the text to the screen at each input point.

Reimplemented from vtkMapper2D.

void SetBold ( int ) [virtual]
 

Enable/Disable bolding labels.

void SetFieldDataArray ( int ) [virtual]
 

Set/Get the field data array to label. This instance variable is only applicable if field data is labeled.

void SetFontFamily ( int ) [virtual]
 

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

void SetFontSize ( int ) [virtual]
 

Set/Get the suggested font size used to label the data. (Suggested because not all font sizes may be available.) The value is expressed in points.

void SetInput ( vtkDataSet * ) [virtual]
 

Set the input dataset to the mapper.

void SetItalic ( int ) [virtual]
 

Enable/Disable italicizing labels.

void SetLabelAsString ( int ) [virtual]
 

Enable/Disable printing of strings. Strings must be provided in vtkCharArray of field data.

void SetLabelFormat ( const char * ) [virtual]
 

Set/Get the format with which to print the labels. The format needs to change depending on what you're trying to print. For example, if you're printing a vector, 3 values are printed, whereas when printing an id only one value is printed. See also the ivar LabeledComponent which can be used to specify the component to print if you want to only print one of several.

void SetLabelMode ( int ) [virtual]
 

Specify which data to plot: scalars, vectors, normals, texture coords, tensors, or field data. If the data has more than one component, use the method SetLabeledComponent to control which components to plot.

void SetLabeledComponent ( int ) [virtual]
 

Set/Get the component number to label if the data to print has more than one component. For example, all the components of scalars, vectors, normals, etc. are labeled by default (LabeledComponent=(-1)). However, if this ivar is nonnegative, then only the one component specified is labeled.

void SetShadow ( int ) [virtual]
 

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


The documentation for this class was generated from the following file:
Generated at Tue Sep 26 18:34:00 2000 for Grid Edit by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000