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 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)

Definition at line 87 of file vtkTextMapper.h.


Constructor & Destructor Documentation

vtkTextMapper::vtkTextMapper   [protected]
 

vtkTextMapper::~vtkTextMapper   [protected]
 

vtkTextMapper::vtkTextMapper const vtkTextMapper &    [inline, protected]
 

Definition at line 179 of file vtkTextMapper.h.


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, 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 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 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 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 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 vtkWin32TextMapper, and vtkXTextMapper.

Definition at line 99 of file vtkTextMapper.h.

int vtkTextMapper::GetWidth vtkViewport  
 

int vtkTextMapper::GetHeight vtkViewport  
 

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]
 

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]
 

virtual void vtkTextMapper::BoldOn   [virtual]
 

virtual void vtkTextMapper::BoldOff   [virtual]
 

void vtkTextMapper::SetItalic int    val
 

Enable/disable text italic.

virtual int vtkTextMapper::GetItalic   [virtual]
 

virtual void vtkTextMapper::ItalicOn   [virtual]
 

virtual void vtkTextMapper::ItalicOff   [virtual]
 

void vtkTextMapper::SetShadow int    val
 

Enable/disable text shadows.

virtual int vtkTextMapper::GetShadow   [virtual]
 

virtual void vtkTextMapper::ShadowOn   [virtual]
 

virtual void vtkTextMapper::ShadowOff   [virtual]
 

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]
 

void vtkTextMapper::SetFontFamilyToArial   [inline]
 

Definition at line 137 of file vtkTextMapper.h.

void vtkTextMapper::SetFontFamilyToCourier   [inline]
 

Definition at line 138 of file vtkTextMapper.h.

void vtkTextMapper::SetFontFamilyToTimes   [inline]
 

Definition at line 139 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]
 

void vtkTextMapper::SetJustificationToLeft   [inline]
 

Definition at line 145 of file vtkTextMapper.h.

void vtkTextMapper::SetJustificationToCentered   [inline]
 

Definition at line 146 of file vtkTextMapper.h.

void vtkTextMapper::SetJustificationToRight   [inline]
 

Definition at line 147 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]
 

void vtkTextMapper::SetVerticalJustificationToBottom   [inline]
 

Definition at line 153 of file vtkTextMapper.h.

void vtkTextMapper::SetVerticalJustificationToCentered   [inline]
 

Definition at line 155 of file vtkTextMapper.h.

void vtkTextMapper::SetVerticalJustificationToTop   [inline]
 

Definition at line 157 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]
 

virtual void vtkTextMapper::SetLineSpacing float    [virtual]
 

virtual float vtkTextMapper::GetLineSpacing   [virtual]
 

virtual int vtkTextMapper::GetNumberOfLines   [virtual]
 

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 "
").

void vtkTextMapper::operator= const vtkTextMapper &    [inline, protected]
 

Definition at line 180 of file vtkTextMapper.h.

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 182 of file vtkTextMapper.h.

int vtkTextMapper::Bold [protected]
 

Definition at line 183 of file vtkTextMapper.h.

int vtkTextMapper::Shadow [protected]
 

Definition at line 184 of file vtkTextMapper.h.

int vtkTextMapper::FontSize [protected]
 

Definition at line 185 of file vtkTextMapper.h.

int vtkTextMapper::FontFamily [protected]
 

Definition at line 186 of file vtkTextMapper.h.

char* vtkTextMapper::Input [protected]
 

Definition at line 187 of file vtkTextMapper.h.

int vtkTextMapper::Justification [protected]
 

Definition at line 188 of file vtkTextMapper.h.

int vtkTextMapper::VerticalJustification [protected]
 

Definition at line 189 of file vtkTextMapper.h.

vtkTimeStamp vtkTextMapper::FontMTime [protected]
 

Definition at line 190 of file vtkTextMapper.h.

int vtkTextMapper::LineSize [protected]
 

Definition at line 192 of file vtkTextMapper.h.

float vtkTextMapper::LineOffset [protected]
 

Definition at line 193 of file vtkTextMapper.h.

float vtkTextMapper::LineSpacing [protected]
 

Definition at line 194 of file vtkTextMapper.h.

int vtkTextMapper::NumberOfLines [protected]
 

Definition at line 195 of file vtkTextMapper.h.

int vtkTextMapper::NumberOfLinesAllocated [protected]
 

Definition at line 196 of file vtkTextMapper.h.

vtkTextMapper** vtkTextMapper::TextLines [protected]
 

Definition at line 197 of file vtkTextMapper.h.


The documentation for this class was generated from the following file:
Generated on Wed Nov 21 13:00:47 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001