Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkTextMapper Class Reference

#include <vtkTextMapper.h>

Inheritance diagram for vtkTextMapper:

vtkMapper2D vtkAbstractMapper vtkProcessObject vtkObject vtkObjectBase vtkMesaFreeTypeTextMapper vtkOpenGLFreeTypeTextMapper List of all members.

Detailed Description

2D text annotation

Date
2002/11/11 21:41:40
Revision
1.48

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.

See also:
vtkMapper2D vtkActor2D vtkLegendBoxActor vtkCaptionActor2D vtkVectorText vtkTextProperty
Examples:
vtkTextMapper (Examples)
Tests:
vtkTextMapper (Tests)

Definition at line 47 of file vtkTextMapper.h.

Public Types

typedef vtkMapper2D Superclass

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual int GetNumberOfLines ()
void ShallowCopy (vtkTextMapper *tm)
int GetNumberOfLines (const char *input)
virtual void GetSize (vtkViewport *, int size[2])
virtual int GetWidth (vtkViewport *v)
virtual int GetHeight (vtkViewport *v)
virtual void SetInput (const char *inputString)
virtual char * GetInput ()
virtual void SetTextProperty (vtkTextProperty *p)
virtual vtkTextProperty * GetTextProperty ()
virtual void SetFontFamily (int val)
virtual int GetFontFamily ()
void SetFontFamilyToArial ()
void SetFontFamilyToCourier ()
void SetFontFamilyToTimes ()
virtual void SetFontSize (int size)
virtual int GetFontSize ()
virtual void SetBold (int val)
virtual int GetBold ()
virtual void BoldOn ()
virtual void BoldOff ()
virtual void SetItalic (int val)
virtual int GetItalic ()
virtual void ItalicOn ()
virtual void ItalicOff ()
virtual void SetShadow (int val)
virtual int GetShadow ()
virtual void ShadowOn ()
virtual void ShadowOff ()
virtual void SetJustification (int val)
virtual int GetJustification ()
void SetJustificationToLeft ()
void SetJustificationToCentered ()
void SetJustificationToRight ()
virtual void SetVerticalJustification (int val)
virtual int GetVerticalJustification ()
void SetVerticalJustificationToBottom ()
void SetVerticalJustificationToCentered ()
void SetVerticalJustificationToTop ()
virtual void SetLineOffset (float val)
virtual float GetLineOffset ()
virtual void SetLineSpacing (float val)
virtual float GetLineSpacing ()
virtual int SetConstrainedFontSize (vtkViewport *, int targetWidth, int targetHeight)
virtual int GetSystemFontSize (int size)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkTextMapper * SafeDownCast (vtkObject *o)
static vtkTextMapper * New ()
static int SetMultipleConstrainedFontSize (vtkViewport *, int targetWidth, int targetHeight, vtkTextMapper **mappers, int nbOfMappers, int *maxResultingSize)

Protected Member Functions

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

Protected Attributes

char * Input
vtkTextProperty * TextProperty
int LineSize
int NumberOfLines
int NumberOfLinesAllocated
vtkTextMapper ** TextLines


Member Typedef Documentation

typedef vtkMapper2D vtkTextMapper::Superclass
 

Reimplemented from vtkMapper2D.

Reimplemented in vtkMesaFreeTypeTextMapper, and vtkOpenGLFreeTypeTextMapper.

Definition at line 50 of file vtkTextMapper.h.


Constructor & Destructor Documentation

vtkTextMapper::vtkTextMapper (   )  [protected]
 

vtkTextMapper::~vtkTextMapper (   )  [protected]
 


Member Function Documentation

virtual const char* vtkTextMapper::GetClassName (   )  [virtual]
 

Reimplemented from vtkMapper2D.

Reimplemented in vtkMesaFreeTypeTextMapper, and vtkOpenGLFreeTypeTextMapper.

static 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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkMapper2D.

Reimplemented in vtkMesaFreeTypeTextMapper, and vtkOpenGLFreeTypeTextMapper.

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 vtkTypeRevisionMacro found in vtkSetGet.h.

Reimplemented from vtkMapper2D.

Reimplemented in vtkMesaFreeTypeTextMapper, and vtkOpenGLFreeTypeTextMapper.

static vtkTextMapper* vtkTextMapper::SafeDownCast (  vtkObject *  o  )  [static]
 

Reimplemented from vtkMapper2D.

Reimplemented in vtkMesaFreeTypeTextMapper, and vtkOpenGLFreeTypeTextMapper.

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.

Reimplemented in vtkMesaFreeTypeTextMapper, and vtkOpenGLFreeTypeTextMapper.

static vtkTextMapper* vtkTextMapper::New (   )  [static]
 

Creates a new text mapper.

Reimplemented from vtkObject.

Reimplemented in vtkMesaFreeTypeTextMapper, and vtkOpenGLFreeTypeTextMapper.

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 vtkMesaFreeTypeTextMapper, and vtkOpenGLFreeTypeTextMapper.

Definition at line 59 of file vtkTextMapper.h.

virtual int vtkTextMapper::GetWidth (  vtkViewport *  v  )  [virtual]
 

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

virtual int vtkTextMapper::GetHeight (  vtkViewport *  v  )  [virtual]
 

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

virtual void vtkTextMapper::SetInput (  const char *  inputString  )  [virtual]
 

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

virtual char* vtkTextMapper::GetInput (   )  [virtual]
 

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

virtual void vtkTextMapper::SetTextProperty (  vtkTextProperty *  p  )  [virtual]
 

Set/Get the text property.

virtual vtkTextProperty* vtkTextMapper::GetTextProperty (   )  [virtual]
 

Set/Get the text property.

virtual void vtkTextMapper::SetFontFamily (  int  val  )  [virtual]
 

Set/Get the font family. Three font types are allowed: Arial (VTK_ARIAL), Courier (VTK_COURIER), and Times (VTK_TIMES). Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

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). Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

void vtkTextMapper::SetFontFamilyToArial (   )  [inline]
 

Set/Get the font family. Three font types are allowed: Arial (VTK_ARIAL), Courier (VTK_COURIER), and Times (VTK_TIMES). Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 85 of file vtkTextMapper.h.

References VTK_ARIAL.

void vtkTextMapper::SetFontFamilyToCourier (   )  [inline]
 

Set/Get the font family. Three font types are allowed: Arial (VTK_ARIAL), Courier (VTK_COURIER), and Times (VTK_TIMES). Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 86 of file vtkTextMapper.h.

References VTK_COURIER.

void vtkTextMapper::SetFontFamilyToTimes (   )  [inline]
 

Set/Get the font family. Three font types are allowed: Arial (VTK_ARIAL), Courier (VTK_COURIER), and Times (VTK_TIMES). Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 87 of file vtkTextMapper.h.

References VTK_TIMES.

virtual void vtkTextMapper::SetFontSize (  int  size  )  [virtual]
 

Set/Get the font size. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual int vtkTextMapper::GetFontSize (   )  [virtual]
 

Set/Get the font size. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::SetBold (  int  val  )  [virtual]
 

Enable/disable text bolding. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual int vtkTextMapper::GetBold (   )  [virtual]
 

Enable/disable text bolding. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::BoldOn (   )  [virtual]
 

Enable/disable text bolding. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::BoldOff (   )  [virtual]
 

Enable/disable text bolding. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::SetItalic (  int  val  )  [virtual]
 

Enable/disable text italic. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual int vtkTextMapper::GetItalic (   )  [virtual]
 

Enable/disable text italic. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::ItalicOn (   )  [virtual]
 

Enable/disable text italic. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::ItalicOff (   )  [virtual]
 

Enable/disable text italic. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::SetShadow (  int  val  )  [virtual]
 

Enable/disable text shadows. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual int vtkTextMapper::GetShadow (   )  [virtual]
 

Enable/disable text shadows. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::ShadowOn (   )  [virtual]
 

Enable/disable text shadows. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::ShadowOff (   )  [virtual]
 

Enable/disable text shadows. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::SetJustification (  int  val  )  [virtual]
 

Set/Get the horizontal justification to left (default), centered, or right. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual int vtkTextMapper::GetJustification (   )  [virtual]
 

Set/Get the horizontal justification to left (default), centered, or right. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

void vtkTextMapper::SetJustificationToLeft (   )  [inline]
 

Set/Get the horizontal justification to left (default), centered, or right. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 142 of file vtkTextMapper.h.

References VTK_TEXT_LEFT.

void vtkTextMapper::SetJustificationToCentered (   )  [inline]
 

Set/Get the horizontal justification to left (default), centered, or right. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 144 of file vtkTextMapper.h.

References VTK_TEXT_CENTERED.

void vtkTextMapper::SetJustificationToRight (   )  [inline]
 

Set/Get the horizontal justification to left (default), centered, or right. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 146 of file vtkTextMapper.h.

References VTK_TEXT_RIGHT.

virtual void vtkTextMapper::SetVerticalJustification (  int  val  )  [virtual]
 

Set/Get the vertical justification to bottom (default), middle, or top. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual int vtkTextMapper::GetVerticalJustification (   )  [virtual]
 

Set/Get the vertical justification to bottom (default), middle, or top. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

void vtkTextMapper::SetVerticalJustificationToBottom (   )  [inline]
 

Set/Get the vertical justification to bottom (default), middle, or top. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 159 of file vtkTextMapper.h.

References VTK_TEXT_BOTTOM.

void vtkTextMapper::SetVerticalJustificationToCentered (   )  [inline]
 

Set/Get the vertical justification to bottom (default), middle, or top. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 161 of file vtkTextMapper.h.

References VTK_TEXT_CENTERED.

void vtkTextMapper::SetVerticalJustificationToTop (   )  [inline]
 

Set/Get the vertical justification to bottom (default), middle, or top. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

Definition at line 163 of file vtkTextMapper.h.

References VTK_TEXT_TOP.

virtual void vtkTextMapper::SetLineOffset (  float  val  )  [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. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

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. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

virtual void vtkTextMapper::SetLineSpacing (  float  val  )  [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. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

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. Warning: these functions remain for backward compatibility. Please access the vtkTextProperty associated to the actor that use the text mapper.

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

virtual int vtkTextMapper::SetConstrainedFontSize (  vtkViewport *  ,
int  targetWidth,
int  targetHeight
)  [virtual]
 

Set and return the font size required to make this mapper fit in a given target rectangle (width * height, in pixels).

static int vtkTextMapper::SetMultipleConstrainedFontSize (  vtkViewport *  ,
int  targetWidth,
int  targetHeight,
vtkTextMapper **  mappers,
int  nbOfMappers,
int *  maxResultingSize
)  [static]
 

Set and return the font size required to make each element of an array of mappers fit in a given rectangle (width * height, in pixels). This font size is the smallest size that was required to fit the largest mapper in this constraint. The resulting maximum area of the mappers is also returned.

virtual int vtkTextMapper::GetSystemFontSize (  int  size  )  [inline, virtual]
 

Get the available system font size matching a font size.

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


Member Data Documentation

char* vtkTextMapper::Input [protected]
 

Definition at line 222 of file vtkTextMapper.h.

vtkTextProperty* vtkTextMapper::TextProperty [protected]
 

Definition at line 223 of file vtkTextMapper.h.

int vtkTextMapper::LineSize [protected]
 

Definition at line 225 of file vtkTextMapper.h.

int vtkTextMapper::NumberOfLines [protected]
 

Definition at line 226 of file vtkTextMapper.h.

int vtkTextMapper::NumberOfLinesAllocated [protected]
 

Definition at line 227 of file vtkTextMapper.h.

vtkTextMapper** vtkTextMapper::TextLines [protected]
 

Definition at line 229 of file vtkTextMapper.h.


The documentation for this class was generated from the following file: