VTK: Rendering/Label/vtkLabelRenderStrategy.h Source File

| VTK 9.3.1

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
17 #include "vtkStdString.h" // For string support
18
19 VTK_ABI_NAMESPACE_BEGIN
20 class vtkRenderer;
21 class vtkWindow;
22 class vtkTextProperty;
23
24 class VTKRENDERINGLABEL_EXPORT vtkLabelRenderStrategy : public vtkObject
25 {
26 public:
27 void PrintSelf(ostream& os, vtkIndent indent) override;
28 vtkTypeMacro(vtkLabelRenderStrategy, vtkObject);
29
35 virtual bool SupportsRotation() { return true; }
36
44 virtual bool SupportsBoundedSize() { return true; }
45
47
50 virtual void SetRenderer(vtkRenderer* ren);
51 vtkGetObjectMacro(Renderer, vtkRenderer);
53
55
58 virtual void SetDefaultTextProperty(vtkTextProperty* tprop);
59 vtkGetObjectMacro(DefaultTextProperty, vtkTextProperty);
61
65 virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label, double bds[4]) = 0;
66
75 virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label) = 0;
76 virtual void RenderLabel(
77 int x[2], vtkTextProperty* tprop, vtkStdString label, int vtkNotUsed(maxWidth))
78 {
79 this->RenderLabel(x, tprop, label);
80 }
81
85 virtual void StartFrame() {}
86
90 virtual void EndFrame() {}
91
97 virtual void ReleaseGraphicsResources(vtkWindow*) {}
98
99 protected:
100 vtkLabelRenderStrategy();
101 ~vtkLabelRenderStrategy() override;
102
103 vtkRenderer* Renderer;
104 vtkTextProperty* DefaultTextProperty;
105
106 private:
107 vtkLabelRenderStrategy(const vtkLabelRenderStrategy&) = delete;
108 void operator=(const vtkLabelRenderStrategy&) = delete;
109 };
110
111 VTK_ABI_NAMESPACE_END
112 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkLabelRenderStrategy
Superclass for label rendering implementations.
Definition: vtkLabelRenderStrategy.h:25
vtkLabelRenderStrategy::SupportsRotation
virtual bool SupportsRotation()
Whether the text rendering strategy supports rotation.
Definition: vtkLabelRenderStrategy.h:35
vtkLabelRenderStrategy::ComputeLabelBounds
virtual void ComputeLabelBounds(vtkTextProperty *tprop, vtkStdString label, double bds[4])=0
Compute the bounds of a label.
vtkLabelRenderStrategy::EndFrame
virtual void EndFrame()
End a rendering frame.
Definition: vtkLabelRenderStrategy.h:90
vtkLabelRenderStrategy::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkLabelRenderStrategy::SupportsBoundedSize
virtual bool SupportsBoundedSize()
Whether the text rendering strategy supports bounded size.
Definition: vtkLabelRenderStrategy.h:44
vtkLabelRenderStrategy::SetRenderer
virtual void SetRenderer(vtkRenderer *ren)
Set the renderer associated with this strategy.
vtkLabelRenderStrategy::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this strategy.
Definition: vtkLabelRenderStrategy.h:97
vtkLabelRenderStrategy::RenderLabel
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label, int vtkNotUsed(maxWidth))
Definition: vtkLabelRenderStrategy.h:76
vtkLabelRenderStrategy::StartFrame
virtual void StartFrame()
Start a rendering frame.
Definition: vtkLabelRenderStrategy.h:85
vtkLabelRenderStrategy::~vtkLabelRenderStrategy
~vtkLabelRenderStrategy() override
vtkLabelRenderStrategy::vtkLabelRenderStrategy
vtkLabelRenderStrategy()
vtkLabelRenderStrategy::DefaultTextProperty
vtkTextProperty * DefaultTextProperty
Definition: vtkLabelRenderStrategy.h:104
vtkLabelRenderStrategy::SetDefaultTextProperty
virtual void SetDefaultTextProperty(vtkTextProperty *tprop)
Set the default text property for the strategy.
vtkLabelRenderStrategy::RenderLabel
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label)=0
Render a label at a location in display coordinates.
vtkLabelRenderStrategy::Renderer
vtkRenderer * Renderer
Definition: vtkLabelRenderStrategy.h:103
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:35
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkObject.h
vtkStdString.h