1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkTextMapper.h,v $
6 Date: $Date: 2002/02/01 06:33:24 $
7 Version: $Revision: 1.1.1.1 $
8 Thanks: Thanks to Matt Turek who developed this class.
10 Copyright (c) 1993-1995 Ken Martin, Will Schroeder, Bill Lorensen.
12 This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
13 The following terms apply to all files associated with the software unless
14 explicitly disclaimed in individual files. This copyright specifically does
15 not apply to the related textbook "The Visualization Toolkit" ISBN
16 013199837-4 published by Prentice Hall which is covered by its own copyright.
18 The authors hereby grant permission to use, copy, and distribute this
19 software and its documentation for any purpose, provided that existing
20 copyright notices are retained in all copies and that this notice is included
21 verbatim in any distributions. Additionally, the authors grant permission to
22 modify this software and its documentation for any purpose, provided that
23 such modifications are not distributed without the explicit consent of the
24 authors and that existing copyright notices are retained in all copies. Some
25 of the algorithms implemented by this software are patented, observe all
26 applicable patent law.
28 IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
29 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
30 OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
31 EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
34 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
35 PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN
36 "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
37 MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
40 =========================================================================*/
41 // .NAME vtkTextMapper - 2D Text annotation
42 // .SECTION Description
43 // vtkTextMapper provides 2D text annotation support for vtk.
44 // It is a Mapper2D that can be accosciated with a Actor2D
45 // and placed withint a RenderWindow or ImageWindow.
48 // vtkMapper2D vtkActor2D
50 #ifndef __vtkTextMapper_h
51 #define __vtkTextMapper_h
54 #include "vtkMapper2D.h"
55 #include "vtkWindow.h"
56 #include "vtkViewport.h"
57 #include "vtkActor2D.h"
58 #include "vtkProperty2D.h"
64 class VTK_EXPORT vtkTextMapper : public vtkMapper2D
68 virtual ~vtkTextMapper();
69 const char *GetClassName() {return "vtkTextMapper";};
70 static vtkTextMapper *New();
71 void PrintSelf(ostream& os, vtkIndent indent);
74 // Draw the text to the screen. This function is implemented in
76 virtual void Render(vtkViewport*, vtkActor2D*) {};
79 // Set the input to the mapper. The mapper doesn't parse the string
80 // for carriage returns or line feeds.
81 vtkSetStringMacro(Input);
84 // Set the font size used by the mapper. The subclasses can override
85 // this function since all font sizes may not be available (especially
87 virtual void SetFontSize(int size)
88 {this->FontSize = size; this->FontChanged = 1; this->Modified();};
91 // Return the font size actually in use by the mapper. This value may
92 // not match the value specified in the last SetFontSize if the last size
94 vtkGetMacro(FontSize, int);
97 // Set/Get the bold property.
98 // vtkSetMacro(Bold, int);
100 {if (val == this->Bold) return;
101 this->Bold = val; this->FontChanged = 1; this->Modified();};
102 vtkGetMacro(Bold, int);
103 vtkBooleanMacro(Bold, int);
106 // Set/Get the italic property.
107 // vtkSetMacro(Italic, int);
108 void SetItalic(int val)
109 {if (val == this->Italic) return;
110 this->Italic = val; this->FontChanged = 1; this->Modified();};
111 vtkGetMacro(Italic, int);
112 vtkBooleanMacro(Italic, int);
115 // Set/Get the shadow property.
116 // vtkSetMacro(Shadow, int);
117 void SetShadow(int val)
118 {this->Shadow = val; this->FontChanged = 1; this->Modified();};
119 vtkGetMacro(Shadow, int);
120 vtkBooleanMacro(Shadow, int);
123 // Set/Get the font family. Three font types are allowed: Arial (VTK_ARIAL),
124 // Courier (VTK_COURIER), and Times (VTK_TIMES).
125 // vtkSetMacro(FontFamily, int);
126 void SetFontFamily(int val)
127 {if (val == this->FontFamily) return;
128 this->FontFamily = val; this->FontChanged = 1; this->Modified();};
129 vtkGetMacro(FontFamily, int);
130 void SetFontFamilyToArial() {SetFontFamily(VTK_ARIAL);};
131 void SetFontFamilyToCourier() {SetFontFamily(VTK_COURIER);};
132 void SetFontFamilyToTimes() {SetFontFamily(VTK_TIMES);};