VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Rendering
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
=========================================================================*/
34
#ifndef __vtkTextMapper_h
35
#define __vtkTextMapper_h
36
37
#include "
vtkMapper2D.h
"
38
39
class
vtkActor2D
;
40
class
vtkTextProperty
;
41
class
vtkViewport
;
42
43
class
VTK_RENDERING_EXPORT
vtkTextMapper
:
public
vtkMapper2D
44
{
45
public
:
46
vtkTypeMacro(
vtkTextMapper
,
vtkMapper2D
);
47
void
PrintSelf
(ostream& os,
vtkIndent
indent);
48
50
static
vtkTextMapper
*
New
();
51
53
55
virtual
void
GetSize
(
vtkViewport
*,
int
size
[2]) {size[0]=size[0];}
56
virtual
int
GetWidth(
vtkViewport
*v);
57
virtual
int
GetHeight(
vtkViewport
*v);
59
61
63
virtual
void
SetInput(
const
char
*inputString);
64
vtkGetStringMacro(Input);
66
68
69
virtual
void
SetTextProperty(
vtkTextProperty
*p);
70
vtkGetObjectMacro(TextProperty,
vtkTextProperty
);
72
74
void
ShallowCopy
(
vtkTextMapper
*tm);
75
78
int
GetNumberOfLines(
const
char
*input);
79
81
84
vtkGetMacro(NumberOfLines,
int
);
86
88
92
virtual
int
SetConstrainedFontSize(
vtkViewport
*,
int
targetWidth,
int
targetHeight);
93
static
int
SetConstrainedFontSize(
vtkTextMapper
*,
vtkViewport
*,
int
targetWidth,
int
targetHeight);
95
97
101
static
int
SetMultipleConstrainedFontSize(
vtkViewport
*,
102
int
targetWidth,
int
targetHeight,
103
vtkTextMapper
** mappers,
104
int
nbOfMappers,
105
int
* maxResultingSize);
107
109
112
static
int
SetRelativeFontSize(
vtkTextMapper
*,
vtkViewport
*,
int
*winSize,
113
int
*stringSize,
float
sizeFactor=0.0);
114
static
int
SetMultipleRelativeFontSize(
vtkViewport
*viewport,
115
vtkTextMapper
**textMappers,
116
int
nbOfMappers,
int
*winSize,
117
int
*stringSize,
float
sizeFactor);
119
121
122
virtual
int
GetSystemFontSize
(
int
size
)
123
{
return
size
; }
125
126
protected
:
127
vtkTextMapper
();
128
~
vtkTextMapper
();
129
130
char
*
Input
;
131
vtkTextProperty
*
TextProperty
;
132
133
int
LineSize
;
134
int
NumberOfLines
;
135
int
NumberOfLinesAllocated
;
136
137
vtkTextMapper
**
TextLines
;
138
139
// These functions are used to parse, process, and render multiple lines
140
char
*NextLine(
const
char
*input,
int
lineNum);
141
void
GetMultiLineSize(
vtkViewport
* viewport,
int
size
[2]);
142
void
RenderOverlayMultipleLines(
vtkViewport
*viewport,
vtkActor2D
*actor);
143
144
private
:
145
vtkTextMapper
(
const
vtkTextMapper
&);
// Not implemented.
146
void
operator=(
const
vtkTextMapper
&);
// Not implemented.
147
};
148
149
#endif
150
vtkTextMapper::GetSize
virtual void GetSize(vtkViewport *, int size[2])
Definition:
vtkTextMapper.h:55
vtkTextMapper::TextProperty
vtkTextProperty * TextProperty
Definition:
vtkTextMapper.h:131
vtkViewport
abstract specification for Viewports
Definition:
vtkViewport.h:45
vtkActor2D
a actor that draws 2D data
Definition:
vtkActor2D.h:43
vtkTextMapper
2D text annotation
Definition:
vtkTextMapper.h:43
vtkTextMapper::TextLines
vtkTextMapper ** TextLines
Definition:
vtkTextMapper.h:137
vtkTextMapper::LineSize
int LineSize
Definition:
vtkTextMapper.h:133
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:37
vtkTextMapper::NumberOfLines
int NumberOfLines
Definition:
vtkTextMapper.h:134
vtkX3D::size
Definition:
vtkX3D.h:253
vtkMapper2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTextProperty
represent text properties.
Definition:
vtkTextProperty.h:37
vtkTextMapper::Input
char * Input
Definition:
vtkTextMapper.h:130
VTK_RENDERING_EXPORT
#define VTK_RENDERING_EXPORT
Definition:
vtkWin32Header.h:278
vtkMapper2D.h
vtkTextMapper::NumberOfLinesAllocated
int NumberOfLinesAllocated
Definition:
vtkTextMapper.h:135
vtkAbstractMapper::ShallowCopy
void ShallowCopy(vtkAbstractMapper *m)
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkMapper2D
abstract class specifies interface for objects which render 2D actors
Definition:
vtkMapper2D.h:33
vtkTextMapper::GetSystemFontSize
virtual int GetSystemFontSize(int size)
Definition:
vtkTextMapper.h:122
Generated on Tue Oct 28 2014 11:40:04 for VTK by
1.8.8