Documentation for vtkLabeledDataMapper

vtkLabeledDataMapper - draw text labels at dataset points

Super Class: vtkMapper2D

Description:

vtkLabeledDataMapper 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. 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 creating by looping over all components and using the label format to render each component.)

 

Caveats:

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

 

Methods:

void vtkLabeledDataMapper ()
void vtkLabeledDataMapper ()
const char *GetClassName ()
static vtkLabeledDataMapper *New ()
void PrintSelf (unknown & ,vtkIndent )
void Render (vtkViewport * ,vtkActor2D *)
void SetInput (vtkDataSet *)
vtkDataSet *GetInput ()
void SetLabelMode (int )
int GetLabelMode ()
void SetLabelModeToLabelIds ()
void SetLabelModeToLabelScalars ()
void SetLabelModeToLabelVectors ()
void SetLabelModeToLabelNormals ()
void SetLabelModeToLabelTCoords ()
void SetLabelModeToLabelTensors ()
void SetLabelModeToLabelFieldData ()
void SetFontSize (int )
int GetFontSize ()
void SetBold (int )
int GetBold ()
void BoldOn ()
void BoldOff ()
void SetItalic (int )
int GetItalic ()
void ItalicOn ()
void ItalicOff ()
void SetShadow (int )
int GetShadow ()
void ShadowOn ()
void ShadowOff ()
void SetFontFamily (int )
int GetFontFamily ()
void SetFontFamilyToArial ()
void SetFontFamilyToCourier ()
void SetFontFamilyToTimes ()
void SetLabelFormat (char *)
char *GetLabelFormat ()
void SetLabeledComponent (int )
int GetLabeledComponent ()
void SetFieldDataArray (int )
int GetFieldDataArray ()

 

Detailed Method Descriptions:

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

void vtkLabeledDataMapper ()

Draw the text to the screen at each input point.

void Render (vtkViewport * ,vtkActor2D *)

Set the input dataset to the mapper.

void SetInput (vtkDataSet *)
vtkDataSet *GetInput ()

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

void SetLabelMode (int )
int GetLabelMode ()
void SetLabelModeToLabelIds ()
void SetLabelModeToLabelScalars ()
void SetLabelModeToLabelVectors ()
void SetLabelModeToLabelNormals ()
void SetLabelModeToLabelTCoords ()
void SetLabelModeToLabelTensors ()
void SetLabelModeToLabelFieldData ()

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 SetFontSize (int )
int GetFontSize ()

Enable/Disable bolding labels.

void SetBold (int )
int GetBold ()
void BoldOn ()
void BoldOff ()

Enable/Disable italicizing labels.

void SetItalic (int )
int GetItalic ()
void ItalicOn ()
void ItalicOff ()

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

void SetShadow (int )
int GetShadow ()
void ShadowOn ()
void ShadowOff ()

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

void SetFontFamily (int )
int GetFontFamily ()
void SetFontFamilyToArial ()
void SetFontFamilyToCourier ()
void SetFontFamilyToTimes ()

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 SetLabelFormat (char *)
char *GetLabelFormat ()

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 SetLabeledComponent (int )
int GetLabeledComponent ()

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

void SetFieldDataArray (int )
int GetFieldDataArray ()