VTK  9.7.20261013
vtkTextOverlayRepresentation.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
3
46
47#ifndef vtkTextOverlayRepresentation_h
48#define vtkTextOverlayRepresentation_h
49
50#include "vtkNew.h" // For ivar
52#include "vtkViewsScivisModule.h" // For export macro
53#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
54
55VTK_ABI_NAMESPACE_BEGIN
56class vtkTextActor;
57class vtkTextProperty;
58
61{
62public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
68
71 void SetVisibility(bool val) override;
72 bool GetVisibility() override;
74
76
79 void SetText(const char* text);
80 const char* GetText();
82
84
89 void SetPosition(int x, int y);
92
94
98 void SetFontSize(int size);
100 void SetColor(double r, double g, double b);
101 double* GetColor() VTK_SIZEHINT(3);
102 void SetBold(bool bold);
103 bool GetBold();
104 void SetItalic(bool italic);
105 bool GetItalic();
107
113
120
121protected:
124
125 bool AddToView(vtkScivisView* view) override;
126 bool RemoveFromView(vtkScivisView* view) override;
127
128private:
130 void operator=(const vtkTextOverlayRepresentation&) = delete;
131
132 vtkNew<vtkTextActor> TextActor;
133};
134
135VTK_ABI_NAMESPACE_END
136#endif
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:168
An actor that displays text.
void SetItalic(bool italic)
How the text is drawn.
void SetText(const char *text)
The string to draw.
void SetFontSize(int size)
How the text is drawn.
bool GetBold()
How the text is drawn.
void SetVisibility(bool val) override
Whether the text is drawn.
const char * GetText()
The string to draw.
vtkTextActor * GetTextActor()
The actor the text is drawn by, for what neither this representation nor the text property covers – a...
int GetFontSize()
How the text is drawn.
static vtkTextOverlayRepresentation * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool AddToView(vtkScivisView *view) override
Called when this representation is added to or removed from a view.
bool RemoveFromView(vtkScivisView *view) override
Called when this representation is added to or removed from a view.
bool GetVisibility() override
Whether the text is drawn.
double * GetPosition()
Where the text sits, in pixels from the lower left corner of the render window.
vtkTextProperty * GetTextProperty()
How the text is drawn: its font and size, color and opacity, bold and italic, and its justification a...
void SetPosition(int x, int y)
Where the text sits, in pixels from the lower left corner of the render window.
double * GetColor()
How the text is drawn.
bool GetItalic()
How the text is drawn.
void SetColor(double r, double g, double b)
How the text is drawn.
void SetBold(bool bold)
How the text is drawn.
represent text properties.
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO