VTK
9.0.1
Rendering
FreeType
vtkMathTextUtilities.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkMathTextUtilities.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
=========================================================================*/
24
#ifndef vtkMathTextUtilities_h
25
#define vtkMathTextUtilities_h
26
27
#include "
vtkObject.h
"
28
#include "vtkRenderingFreeTypeModule.h"
// For export macro
29
#include "
vtkTextRenderer.h
"
// for metrics
30
31
class
vtkImageData
;
32
class
vtkPath
;
33
class
vtkTextProperty
;
34
class
vtkTextActor
;
35
class
vtkViewport
;
36
37
//----------------------------------------------------------------------------
38
// Singleton cleanup
39
40
class
VTKRENDERINGFREETYPE_EXPORT
vtkMathTextUtilitiesCleanup
41
{
42
public
:
43
vtkMathTextUtilitiesCleanup
();
44
~
vtkMathTextUtilitiesCleanup
();
45
46
private
:
47
vtkMathTextUtilitiesCleanup
(
const
vtkMathTextUtilitiesCleanup
& other) =
delete
;
48
vtkMathTextUtilitiesCleanup
& operator=(
const
vtkMathTextUtilitiesCleanup
& rhs) =
delete
;
49
};
50
51
class
VTKRENDERINGFREETYPE_EXPORT
vtkMathTextUtilities
:
public
vtkObject
52
{
53
public
:
54
vtkTypeMacro(
vtkMathTextUtilities
,
vtkObject
);
55
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
56
60
virtual
bool
IsAvailable
() {
return
false
; }
// Override in subclasses.
61
70
static
vtkMathTextUtilities
*
New
();
71
75
static
vtkMathTextUtilities
* GetInstance();
76
81
static
void
SetInstance(
vtkMathTextUtilities
* instance);
82
87
virtual
bool
GetBoundingBox(
vtkTextProperty
* tprop,
const
char
* str,
int
dpi,
int
bbox[4]) = 0;
88
92
virtual
bool
GetMetrics(
93
vtkTextProperty
* tprop,
const
char
* str,
int
dpi,
vtkTextRenderer::Metrics
& metrics) = 0;
94
102
virtual
bool
RenderString(
const
char
* str,
vtkImageData
*
data
,
vtkTextProperty
* tprop,
int
dpi,
103
int
textDims[2] =
nullptr
) = 0;
104
109
virtual
bool
StringToPath(
const
char
* str,
vtkPath
* path,
vtkTextProperty
* tprop,
int
dpi) = 0;
110
117
virtual
int
GetConstrainedFontSize(
118
const
char
* str,
vtkTextProperty
* tprop,
int
targetWidth,
int
targetHeight,
int
dpi);
119
121
126
virtual
bool
GetScaleToPowerOfTwo() = 0;
127
virtual
void
SetScaleToPowerOfTwo(
bool
scale
) = 0;
129
130
protected
:
131
vtkMathTextUtilities
();
132
~
vtkMathTextUtilities
()
override
;
133
134
private
:
135
vtkMathTextUtilities
(
const
vtkMathTextUtilities
&) =
delete
;
136
void
operator=(
const
vtkMathTextUtilities
&) =
delete
;
137
139
142
static
vtkMathTextUtilities
* Instance;
143
static
vtkMathTextUtilitiesCleanup
Cleanup;
145
};
146
147
#endif
vtkX3D::data
Definition:
vtkX3D.h:321
vtkObject
abstract base class for most VTK objects
Definition:
vtkObject.h:62
vtkMathTextUtilities::IsAvailable
virtual bool IsAvailable()
Returns true if mathtext rendering is available.
Definition:
vtkMathTextUtilities.h:60
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPath
concrete dataset representing a path defined by Bezier curves.
Definition:
vtkPath.h:32
vtkViewport
abstract specification for Viewports
Definition:
vtkViewport.h:44
vtkTextRenderer.h
vtkTextActor
An actor that displays text.
Definition:
vtkTextActor.h:50
vtkMathTextUtilitiesCleanup
Definition:
vtkMathTextUtilities.h:40
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:33
vtkImageData
topologically and geometrically regular array of data
Definition:
vtkImageData.h:41
vtkTextProperty
represent text properties.
Definition:
vtkTextProperty.h:33
vtkTextRenderer::Metrics
Definition:
vtkTextRenderer.h:76
vtkMathTextUtilities
Abstract interface to equation rendering.
Definition:
vtkMathTextUtilities.h:51
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkObject.h
vtkX3D::scale
Definition:
vtkX3D.h:235
Generated on Fri Jan 7 2022 00:38:59 for VTK by
1.8.14