VTK
vtkTextMapper.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkTextMapper.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
35#ifndef vtkTextMapper_h
36#define vtkTextMapper_h
37
38#include "vtkRenderingCoreModule.h" // For export macro
39#include "vtkMapper2D.h"
40
41#include "vtkNew.h" // For vtkNew
42
43class vtkActor2D;
44class vtkImageData;
45class vtkPoints;
46class vtkPolyData;
48class vtkTextProperty;
49class vtkTexture;
50class vtkTimeStamp;
51class vtkViewport;
52
53class VTKRENDERINGCORE_EXPORT vtkTextMapper : public vtkMapper2D
54{
55public:
57 void PrintSelf(ostream& os, vtkIndent indent);
58
62 static vtkTextMapper *New();
63
65
69 virtual void GetSize(vtkViewport*, int size[2]);
70 virtual int GetWidth(vtkViewport*v);
71 virtual int GetHeight(vtkViewport*v);
73
75
78 vtkSetStringMacro(Input)
81
83
86 virtual void SetTextProperty(vtkTextProperty *p);
87 vtkGetObjectMacro(TextProperty,vtkTextProperty);
89
93 void ShallowCopy(vtkTextMapper *tm);
94
96
102 virtual int SetConstrainedFontSize(vtkViewport*, int targetWidth, int targetHeight);
103 static int SetConstrainedFontSize(vtkTextMapper*, vtkViewport*, int targetWidth, int targetHeight);
105
113 static int SetMultipleConstrainedFontSize(vtkViewport*,
114 int targetWidth, int targetHeight,
115 vtkTextMapper** mappers,
116 int nbOfMappers,
117 int* maxResultingSize);
118
120
124 static int SetRelativeFontSize(vtkTextMapper*, vtkViewport*, int *winSize,
125 int *stringSize, float sizeFactor=0.0);
126 static int SetMultipleRelativeFontSize(vtkViewport *viewport,
127 vtkTextMapper **textMappers,
128 int nbOfMappers, int *winSize,
129 int *stringSize, float sizeFactor);
131
132 void RenderOverlay(vtkViewport *, vtkActor2D *);
133 void ReleaseGraphicsResources(vtkWindow *);
134 vtkMTimeType GetMTime();
135
136protected:
139
140 char* Input;
141 vtkTextProperty *TextProperty;
142
143private:
144 vtkTextMapper(const vtkTextMapper&) VTK_DELETE_FUNCTION;
145 void operator=(const vtkTextMapper&) VTK_DELETE_FUNCTION;
146
147 void UpdateQuad(vtkActor2D *actor, int dpi);
148 void UpdateImage(int dpi);
149
150 int TextDims[2];
151
152 int RenderedDPI;
153 vtkTimeStamp CoordsTime;
154 vtkTimeStamp TCoordsTime;
155 vtkNew<vtkImageData> Image;
156 vtkNew<vtkPoints> Points;
157 vtkNew<vtkPolyData> PolyData;
159 vtkNew<vtkTexture> Texture;
160};
161
162#endif
a actor that draws 2D data
Definition: vtkActor2D.h:46
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract class specifies interface for objects which render 2D actors
Definition: vtkMapper2D.h:36
Allocate and hold a VTK object.
Definition: vtkNew.h:68
represent and manipulate 3D points
Definition: vtkPoints.h:40
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
2D text annotation
Definition: vtkTextMapper.h:54
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int GetHeight(vtkViewport *v)
virtual void GetSize(vtkViewport *, int size[2])
Return the size[2]/width/height of the rectangle required to draw this mapper (in pixels).
static vtkTextMapper * New()
Creates a new text mapper.
virtual int GetWidth(vtkViewport *v)
represent text properties.
handles properties associated with a texture map
Definition: vtkTexture.h:71
record modification and/or execution time
Definition: vtkTimeStamp.h:36
abstract specification for Viewports
Definition: vtkViewport.h:48
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ size
Definition: vtkX3D.h:253
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248