VTK
9.6.2
Main Page
Related Pages
Topics
Namespaces
Classes
Files
File List
File Members
Rendering
Core
vtkTextActor.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2
// SPDX-License-Identifier: BSD-3-Clause
28
29
#ifndef vtkTextActor_h
30
#define vtkTextActor_h
31
32
#include "vtkRenderingCoreModule.h"
// For export macro
33
#include "
vtkTexturedActor2D.h
"
34
#include "
vtkWrappingHints.h
"
// For VTK_MARSHALAUTO
35
36
#include "
vtkDeprecation.h
"
// For deprecation macro
37
38
VTK_ABI_NAMESPACE_BEGIN
39
class
vtkImageData
;
40
class
vtkPoints
;
41
class
vtkPolyData
;
42
class
vtkPolyDataMapper2D
;
43
class
vtkProperty2D
;
44
class
vtkTextProperty
;
45
class
vtkTextRenderer
;
46
class
vtkTransform
;
47
48
class
VTKRENDERINGCORE_EXPORT
VTK_MARSHALAUTO
vtkTextActor
:
public
vtkTexturedActor2D
49
{
50
public
:
51
vtkTypeMacro(
vtkTextActor
,
vtkTexturedActor2D
);
52
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
53
58
static
vtkTextActor
*
New
();
59
64
void
ShallowCopy
(
vtkProp
* prop)
override
;
65
67
73
void
SetInput
(
const
char
* inputString);
74
char
*
GetInput
();
76
78
83
vtkSetVector2Macro(
MinimumSize
,
int
);
84
vtkGetVector2Macro(
MinimumSize
,
int
);
86
88
94
vtkSetMacro(
MaximumLineHeight
,
float
);
95
vtkGetMacro(
MaximumLineHeight
,
float
);
97
99
108
vtkSetClampMacro(
TextScaleMode
,
int
,
TEXT_SCALE_MODE_NONE
,
TEXT_SCALE_MODE_VIEWPORT
);
109
vtkGetMacro(
TextScaleMode
,
int
);
110
void
SetTextScaleModeToNone
() { this->
SetTextScaleMode
(
TEXT_SCALE_MODE_NONE
); }
111
void
SetTextScaleModeToProp
() { this->
SetTextScaleMode
(
TEXT_SCALE_MODE_PROP
); }
112
void
SetTextScaleModeToViewport
() { this->
SetTextScaleMode
(
TEXT_SCALE_MODE_VIEWPORT
); }
114
115
enum
116
{
117
TEXT_SCALE_MODE_NONE
= 0,
118
TEXT_SCALE_MODE_PROP
,
119
TEXT_SCALE_MODE_VIEWPORT
120
};
121
123
128
vtkSetMacro(
UseBorderAlign
,
vtkTypeBool
);
129
vtkGetMacro(
UseBorderAlign
,
vtkTypeBool
);
130
vtkBooleanMacro(
UseBorderAlign
,
vtkTypeBool
);
132
134
149
VTK_MARSHALEXCLUDE
(
VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
)
150
VTK_DEPRECATED_IN_9_6_0
(
"Please use vtkTextProperty Justification instead."
)
151
void
SetAlignmentPoint
(
int
point);
152
VTK_MARSHALEXCLUDE
(
VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
)
153
VTK_DEPRECATED_IN_9_6_0
(
"Please use vtkTextProperty Justification instead."
)
154
int
GetAlignmentPoint
();
156
158
165
void
SetOrientation
(
float
orientation);
166
vtkGetMacro(
Orientation
,
float
);
168
170
173
virtual
void
SetTextProperty
(
vtkTextProperty
* p);
174
vtkGetObjectMacro(
TextProperty
,
vtkTextProperty
);
176
182
virtual
void
GetBoundingBox
(
vtkViewport
* vport,
double
bbox[4]);
183
187
virtual
void
GetSize
(
vtkViewport
* vport,
double
size[2]);
188
190
195
virtual
int
SetConstrainedFontSize
(
vtkViewport
*,
int
targetWidth,
int
targetHeight);
196
static
int
SetConstrainedFontSize
(
vtkTextActor
*,
vtkViewport
*,
int
targetWidth,
int
targetHeight);
198
205
static
int
SetMultipleConstrainedFontSize
(
vtkViewport
*,
int
targetWidth,
int
targetHeight,
206
vtkTextActor
** actors,
int
nbOfActors,
int
* maxResultingSize);
207
217
virtual
void
SetNonLinearFontScale
(
double
exponent,
int
target
);
218
220
223
vtkGetMacro(
FontScaleExponent
,
double
);
224
vtkSetMacro(
FontScaleExponent
,
double
);
226
231
void
SpecifiedToDisplay
(
double
* pos,
vtkViewport
* vport,
int
specified);
232
237
void
DisplayToSpecified
(
double
* pos,
vtkViewport
* vport,
int
specified);
238
243
virtual
void
ComputeScaledFont
(
vtkViewport
* viewport);
244
246
250
vtkGetObjectMacro(
ScaledTextProperty
,
vtkTextProperty
);
252
260
static
float
GetFontScale
(
vtkViewport
* viewport);
261
269
void
ReleaseGraphicsResources
(
vtkWindow
*) override;
270
272
277
int
RenderOpaqueGeometry
(
vtkViewport
* viewport) override;
278
int
RenderTranslucentPolygonalGeometry
(
vtkViewport
*)
override
{
return
0; }
279
int
RenderOverlay
(
vtkViewport
* viewport)
override
;
281
285
vtkTypeBool
HasTranslucentPolygonalGeometry
()
override
;
286
287
protected
:
291
virtual
bool
RenderImage
(
vtkTextProperty
* tprop,
vtkViewport
* viewport);
292
296
virtual
bool
GetImageBoundingBox
(
vtkTextProperty
* tprop,
vtkViewport
* viewport,
int
bbox[4]);
297
298
vtkTextActor
();
299
~vtkTextActor
()
override
;
300
301
int
MinimumSize
[2];
302
float
MaximumLineHeight
;
303
double
FontScaleExponent
;
304
int
TextScaleMode
;
305
float
Orientation
;
306
vtkTypeBool
UseBorderAlign
;
307
308
vtkTextProperty
*
TextProperty
;
309
vtkImageData
*
ImageData
;
310
vtkTextRenderer
*
TextRenderer
;
311
vtkTimeStamp
BuildTime
;
312
vtkTransform
*
Transform
;
313
int
LastSize
[2];
314
int