VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
17 
18 #include "vtkStdString.h" // For string support
19 
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkRenderer;
22 class vtkWindow;
23 class vtkTextProperty;
24 
25 class VTKRENDERINGLABEL_EXPORT VTK_MARSHALAUTO vtkLabelRenderStrategy : public vtkObject
26 {
27 public:
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 
59  virtual void SetDefaultTextProperty(vtkTextProperty* tprop);
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 
100 protected:
102  ~vtkLabelRenderStrategy() override;
103 
106 
107 private:
109  void operator=(const vtkLabelRenderStrategy&) = delete;
110 };
111 
112 VTK_ABI_NAMESPACE_END
113 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
Superclass for label rendering implementations.
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract specification for renderers
Definition: vtkRenderer.h:63
virtual bool SupportsRotation()
Whether the text rendering strategy supports rotation.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this strategy.
vtkTextProperty * DefaultTextProperty
virtual void EndFrame()
End a rendering frame.
represent text properties.
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label, int maxWidth)
virtual bool SupportsBoundedSize()
Whether the text rendering strategy supports bounded size.
#define VTK_MARSHALAUTO
virtual void StartFrame()
Start a rendering frame.