VTK  9.2.6
vtkLabelRenderStrategy.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkLabelRenderStrategy.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=========================================================================*/
23#ifndef vtkLabelRenderStrategy_h
24#define vtkLabelRenderStrategy_h
25
26#include "vtkObject.h"
27#include "vtkRenderingLabelModule.h" // For export macro
28
29#include "vtkStdString.h" // For string support
30
31class vtkRenderer;
32class vtkWindow;
33class vtkTextProperty;
34
35class VTKRENDERINGLABEL_EXPORT vtkLabelRenderStrategy : public vtkObject
36{
37public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
40
46 virtual bool SupportsRotation() { return true; }
47
55 virtual bool SupportsBoundedSize() { return true; }
56
58
61 virtual void SetRenderer(vtkRenderer* ren);
62 vtkGetObjectMacro(Renderer, vtkRenderer);
64
66
70 vtkGetObjectMacro(DefaultTextProperty, vtkTextProperty);
72
76 virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label, double bds[4]) = 0;
77
86 virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label) = 0;
87 virtual void RenderLabel(
88 int x[2], vtkTextProperty* tprop, vtkStdString label, int vtkNotUsed(maxWidth))
89 {
90 this->RenderLabel(x, tprop, label);
91 }
92
96 virtual void StartFrame() {}
97
101 virtual void EndFrame() {}
102
109
110protected:
113
116
117private:
119 void operator=(const vtkLabelRenderStrategy&) = delete;
120};
121
122#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
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:63
abstract specification for renderers
Definition: vtkRenderer.h:73
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:39
represent text properties.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39