VTK  9.3.20240328
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;
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 
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 
98 
99 protected:
102 
105 
106 private:
108  void operator=(const vtkLabelRenderStrategy&) = delete;
109 };
110 
111 VTK_ABI_NAMESPACE_END
112 #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:161
abstract specification for renderers
Definition: vtkRenderer.h:171
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:78
represent text properties.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47