Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File 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 SetFontSize (int size)
void ShallowCopy (vtkTextMapper *tm)
int GetNumberOfLines (const char *input)
virtual void GetSize (vtkViewport *, int size[2])
int GetWidth (vtkViewport *)
int GetHeight (vtkViewport *)
void SetInput (const char *inputString)
virtual char * GetInput ()
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 ()

Static Public Methods

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

Protected Methods

 vtkTextMapper ()
 ~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:
2001/10/11 13:38:25
Revision:
1.37
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 vtkLegendBoxActor vtkCaptionActor2D vtkVectorText
Examples:
vtkTextMapper (Examples)
Tests:
vtkTextMapper (Tests)

Definition at line 91 of file vtkTextMapper.h.


Constructor & Destructor Documentation

vtkTextMapper::vtkTextMapper   [protected]
 

vtkTextMapper::~vtkTextMapper   [protected]
 


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 vtkQuartzTextMapper, vtkWin32OpenGLTextMapper, vtkWin32TextMapper, vtkXMesaTextMapper, vtkXOpenGLTextMapper, and vtkXTextMapper.

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 vtkQuartzTextMapper, vtkWin32OpenGLTextMapper, vtkWin32TextMapper, vtkXMesaTextMapper, vtkXOpenGLTextMapper, and vtkXTextMapper.

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 vtkQuartzTextMapper, vtkWin32OpenGLTextMapper, vtkWin32TextMapper, vtkXMesaTextMapper, vtkXOpenGLTextMapper, and vtkXTextMapper.

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 vtkQuartzTextMapper, vtkWin32OpenGLTextMapper, vtkWin32TextMapper, vtkXMesaTextMapper, vtkXOpenGLTextMapper, and vtkXTextMapper.

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::New   [static]
 

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

Reimplemented from vtkMapper2D.

Reimplemented in vtkQuartzTextMapper, vtkWin32OpenGLTextMapper, vtkWin32TextMapper, vtkXMesaTextMapper, vtkXOpenGLTextMapper, and vtkXTextMapper.

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

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

Reimplemented in vtkQuartzTextMapper, vtkWin32TextMapper, and vtkXTextMapper.

Definition at line 104 of file vtkTextMapper.h.

int vtkTextMapper::GetWidth vtkViewport  
 

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

int vtkTextMapper::GetHeight vtkViewport  
 

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

void vtkTextMapper::SetInput const char *    inputString
 

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

virtual char* vtkTextMapper::GetInput   [virtual]
 

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

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.

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.

void vtkTextMapper::SetBold int    val
 

Enable/disable text bolding.

virtual int vtkTextMapper::GetBold   [virtual]
 

Enable/disable text bolding.

virtual void vtkTextMapper::BoldOn   [virtual]
 

Enable/disable text bolding.

virtual void vtkTextMapper::BoldOff   [virtual]
 

Enable/disable text bolding.

void vtkTextMapper::SetItalic int    val
 

Enable/disable text italic.

virtual int vtkTextMapper::GetItalic   [virtual]
 

Enable/disable text italic.

virtual void vtkTextMapper::ItalicOn   [virtual]
 

Enable/disable text italic.

virtual void vtkTextMapper::ItalicOff   [virtual]
 

Enable/disable text italic.

void vtkTextMapper::SetShadow int    val
 

Enable/disable text shadows.

virtual int vtkTextMapper::GetShadow   [virtual]
 

Enable/disable text shadows.

virtual void vtkTextMapper::ShadowOn   [virtual]
 

Enable/disable text shadows.

virtual void vtkTextMapper::ShadowOff   [virtual]
 

Enable/disable text shadows.

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 int vtkTextMapper::GetFontFamily   [virtual]
 

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

void vtkTextMapper::SetFontFamilyToArial   [inline]
 

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

Definition at line 154 of file vtkTextMapper.h.

void vtkTextMapper::SetFontFamilyToCourier   [inline]
 

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

Definition at line 155 of file vtkTextMapper.h.

void vtkTextMapper::SetFontFamilyToTimes   [inline]
 

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

Definition at line 156 of file vtkTextMapper.h.

virtual void vtkTextMapper::SetJustification int    [virtual]
 

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

virtual int vtkTextMapper::GetJustification   [virtual]
 

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

void vtkTextMapper::SetJustificationToLeft   [inline]
 

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

Definition at line 164 of file vtkTextMapper.h.

void vtkTextMapper::SetJustificationToCentered   [inline]
 

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

Definition at line 165 of file vtkTextMapper.h.

void vtkTextMapper::SetJustificationToRight   [inline]
 

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

Definition at line 166 of file vtkTextMapper.h.

virtual void vtkTextMapper::SetVerticalJustification int    [virtual]
 

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

virtual int vtkTextMapper::GetVerticalJustification   [virtual]
 

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

void vtkTextMapper::SetVerticalJustificationToBottom   [inline]
 

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

Definition at line 174 of file vtkTextMapper.h.

void vtkTextMapper::SetVerticalJustificationToCentered   [inline]
 

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

Definition at line 176 of file vtkTextMapper.h.

void vtkTextMapper::SetVerticalJustificationToTop   [inline]
 

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

Definition at line 178 of file vtkTextMapper.h.

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.

virtual float vtkTextMapper::GetLineOffset   [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.

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

virtual float vtkTextMapper::GetLineSpacing   [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.

virtual int vtkTextMapper::GetNumberOfLines   [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::ShallowCopy vtkTextMapper *    tm
 

Shallow copy of an actor.

int vtkTextMapper::GetNumberOfLines const char *    input
 

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

char* vtkTextMapper::NextLine const char *    input,
int    lineNum
[protected]
 

void vtkTextMapper::GetMultiLineSize vtkViewport   viewport,
int    size[2]
[protected]
 

void vtkTextMapper::RenderOverlayMultipleLines vtkViewport   viewport,
vtkActor2D   actor
[protected]
 

void vtkTextMapper::RenderOpaqueGeometryMultipleLines vtkViewport   viewport,
vtkActor2D   actor
[protected]
 


Member Data Documentation

int vtkTextMapper::Italic [protected]
 

Definition at line 204 of file vtkTextMapper.h.

int vtkTextMapper::Bold [protected]
 

Definition at line 205 of file vtkTextMapper.h.

int vtkTextMapper::Shadow [protected]
 

Definition at line 206 of file vtkTextMapper.h.

int vtkTextMapper::FontSize [protected]
 

Definition at line 207 of file vtkTextMapper.h.

int vtkTextMapper::FontFamily [protected]
 

Definition at line 208 of file vtkTextMapper.h.

char* vtkTextMapper::Input [protected]
 

Definition at line 209 of file vtkTextMapper.h.

int vtkTextMapper::Justification [protected]
 

Definition at line 210 of file vtkTextMapper.h.

int vtkTextMapper::VerticalJustification [protected]
 

Definition at line 211 of file vtkTextMapper.h.

vtkTimeStamp vtkTextMapper::FontMTime [protected]
 

Definition at line 212 of file vtkTextMapper.h.

int vtkTextMapper::LineSize [protected]
 

Definition at line 214 of file vtkTextMapper.h.

float vtkTextMapper::LineOffset [protected]
 

Definition at line 215 of file vtkTextMapper.h.

float vtkTextMapper::LineSpacing [protected]
 

Definition at line 216 of file vtkTextMapper.h.

int vtkTextMapper::NumberOfLines [protected]
 

Definition at line 217 of file vtkTextMapper.h.

int vtkTextMapper::NumberOfLinesAllocated [protected]
 

Definition at line 218 of file vtkTextMapper.h.

vtkTextMapper** vtkTextMapper::TextLines [protected]
 

Definition at line 219 of file vtkTextMapper.h.


The documentation for this class was generated from the following file:
Generated on Thu Mar 28 14:43:41 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001