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

vtkTextMapper Class Reference

2D text annotation. More...

#include <vtkTextMapper.h>

Inheritance diagram for vtkTextMapper:

Inheritance graph
[legend]
Collaboration diagram for vtkTextMapper:

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)
virtual void GetSize (vtkViewport *, int size[2])
int GetWidth (vtkViewport *)
int GetHeight (vtkViewport *)
void SetInput (const char *inputString)
virtual char * GetInput ()
virtual void SetFontSize (int size)
virtual int GetFontSize ()
void SetBold (int val)
virtual int GetBold ()
virtual void BoldOn ()
virtual void BoldOff ()
void SetItalic (int val)
virtual int GetItalic ()
virtual void ItalicOn ()
virtual void ItalicOff ()
void SetShadow (int val)
virtual int GetShadow ()
virtual void ShadowOn ()
virtual void ShadowOff ()
void SetFontFamily (int val)
virtual int GetFontFamily ()
void SetFontFamilyToArial ()
void SetFontFamilyToCourier ()
void SetFontFamilyToTimes ()
virtual void SetJustification (int)
virtual int GetJustification ()
void SetJustificationToLeft ()
void SetJustificationToCentered ()
void SetJustificationToRight ()
virtual void SetVerticalJustification (int)
virtual int GetVerticalJustification ()
void SetVerticalJustificationToBottom ()
void SetVerticalJustificationToCentered ()
void SetVerticalJustificationToTop ()
virtual void SetLineOffset (float)
virtual float GetLineOffset ()
virtual void SetLineSpacing (float)
virtual float GetLineSpacing ()
virtual int GetNumberOfLines ()
void ShallowCopy (vtkTextMapper *tm)
int GetNumberOfLines (const char *input)

Static Public Methods

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

Protected Methods

 vtkTextMapper ()
 ~vtkTextMapper ()
 vtkTextMapper (const vtkTextMapper &)
void operator= (const vtkTextMapper &)
char * NextLine (const char *input, int lineNum)
void GetMultiLineSize (vtkViewport *viewport, int size[2])
void RenderOverlayMultipleLines (vtkViewport *viewport, vtkActor2D *actor)
void RenderOpaqueGeometryMultipleLines (vtkViewport *viewport, vtkActor2D *actor)

Protected Attributes

int Italic
int Bold
int Shadow
int FontSize
int FontFamily
char * Input
int Justification
int VerticalJustification
vtkTimeStamp FontMTime
int LineSize
float LineOffset
float LineSpacing
int NumberOfLines
int NumberOfLinesAllocated
vtkTextMapper ** TextLines

Detailed Description

2D text annotation.

Date:
2000/12/10 20:09:14
Revision:
1.33
Thanks:
Thanks to Matt Turek who developed this class.
vtkTextMapper provides 2D text annotation support for vtk. It is a vtkMapper2D that can be associated with a vtkActor2D and placed into a vtkRenderer or vtkImager.

To use vtkTextMapper, specify an input text string, a font size, a font name, and whether to turn on bold or shadows (shadows make the font more visible when on top of other objects). You'll also need to create a vtkActor2D and add it to the renderer or imager. You can create multiple lines by embedding "
" in the Input string.

The position of the text can be controlled by setting the justification to right, centered, or left. If you have specified multiple lines, all lines will be justified the same way.

See also:
vtkMapper2D vtkActor2D
Examples:
vtkTextMapper (examples)


Member Function Documentation

virtual const char* vtkTextMapper::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 vtkMapper2D.

Reimplemented in vtkWin32OpenGLTextMapper.

virtual int vtkTextMapper::GetFontSize   [virtual]
 

Return the font size actually in use by the mapper. This value may not match the value specified in the last SetFontSize if the last size was unavailable.

int vtkTextMapper::GetNumberOfLines const char *    input
 

Determine the number of lines in the Input string (delimited by "
").

virtual void vtkTextMapper::GetSize vtkViewport  ,
int    size[2]
[inline, virtual]
 

Return the size[2]/width/height of the rectangle required to draw this mapper (in pixels).

Reimplemented in vtkWin32TextMapper.

virtual int vtkTextMapper::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 vtkMapper2D.

Reimplemented in vtkWin32OpenGLTextMapper.

int vtkTextMapper::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 vtkMapper2D.

Reimplemented in vtkWin32OpenGLTextMapper.

vtkTextMapper* vtkTextMapper::New   [static]
 

Creates a new text mapper with Font size 12, bold off, italic off, and Arial font.

Reimplemented from vtkMapper2D.

Reimplemented in vtkWin32OpenGLTextMapper.

void vtkTextMapper::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 vtkMapper2D.

vtkTextMapper* vtkTextMapper::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 vtkMapper2D.

Reimplemented in vtkWin32OpenGLTextMapper.

void vtkTextMapper::SetBold int    val
 

Enable/disable text bolding.

void vtkTextMapper::SetFontFamily int    val
 

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

virtual void vtkTextMapper::SetFontSize int    size [virtual]
 

Set the font size used by the mapper. The subclasses can override this function since all font sizes may not be available (especially in X).

Reimplemented in vtkXTextMapper.

void vtkTextMapper::SetInput const char *    inputString
 

Set the input text string to the mapper. The mapper recognizes "
" as a carriage return/linefeed (line separator).

void vtkTextMapper::SetItalic int    val
 

Enable/disable text italic.

virtual void vtkTextMapper::SetJustification int    [virtual]
 

Set/Get the horizontal justification to left (default), centered, or right.

virtual void vtkTextMapper::SetLineOffset float    [virtual]
 

These methods can be used to control the spacing and placement of text (in the vertical direction). LineOffset is a vertical offset (measured in lines); LineSpacing is the spacing between lines.

void vtkTextMapper::SetShadow int    val
 

Enable/disable text shadows.

virtual void vtkTextMapper::SetVerticalJustification int    [virtual]
 

Set/Get the vertical justification to bottom (default), middle, or top.

void vtkTextMapper::ShallowCopy vtkTextMapper *    tm
 

Shallow copy of an actor.


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