VTK  9.4.20250203
vtkLabelRenderStrategy.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
11#ifndef vtkLabelRenderStrategy_h
12#define vtkLabelRenderStrategy_h
13
14#include "vtkObject.h"
15#include "vtkRenderingLabelModule.h" // For export macro
16#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
17
18#include "vtkStdString.h" // For string support
19
20VTK_ABI_NAMESPACE_BEGIN
21class vtkRenderer;
22class vtkWindow;
23class vtkTextProperty;
24
25class VTKRENDERINGLABEL_EXPORT VTK_MARSHALAUTO vtkLabelRenderStrategy : public vtkObject
26{
27public:
28 void PrintSelf(ostream& os, vtkIndent indent) override;
30
36 virtual bool SupportsRotation() { return true; }
37
45 virtual bool SupportsBoundedSize() { return true; }
46
48
51 virtual void SetRenderer(vtkRenderer* ren);
52 vtkGetObjectMacro(Renderer, vtkRenderer);
54
56
60 vtkGetObjectMacro(DefaultTextProperty, vtkTextProperty);
62
66 virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label, double bds[4]) = 0;
67
76 virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label) = 0;
77 virtual void RenderLabel(
78 int x[2], vtkTextProperty* tprop, vtkStdString label, int vtkNotUsed(maxWidth))
79 {
80 this->RenderLabel(x, tprop, label);
81 }
82
86 virtual void StartFrame() {}
87
91 virtual void EndFrame() {}
92
99
100protected:
103
106
107private:
109 void operator=(const vtkLabelRenderStrategy&) = delete;
110};
111
112VTK_ABI_NAMESPACE_END
113#endif
a simple class to control print indentation
Definition vtkIndent.h:108
Superclass for label rendering implementations.
virtual bool SupportsRotation()
Whether the text rendering strategy supports rotation.
virtual void ComputeLabelBounds(vtkTextProperty *tprop, vtkStdString label, double bds[4])=0
Compute the bounds of a label.
virtual void EndFrame()
End a rendering frame.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool SupportsBoundedSize()
Whether the text rendering strategy supports bounded size.
virtual void SetRenderer(vtkRenderer *ren)
Set the renderer associated with this strategy.
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this strategy.
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label, int vtkNotUsed(maxWidth))
virtual void StartFrame()
Start a rendering frame.
~vtkLabelRenderStrategy() override
vtkTextProperty * DefaultTextProperty
virtual void SetDefaultTextProperty(vtkTextProperty *tprop)
Set the default text property for the strategy.
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label)=0
Render a label at a location in display coordinates.
abstract base class for most VTK objects
Definition vtkObject.h:162
abstract specification for renderers
Wrapper around std::string to keep symbols short.
represent text properties.
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
#define VTK_MARSHALAUTO