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 
31 class vtkRenderer;
32 class vtkWindow;
33 class vtkTextProperty;
34 
35 class VTKRENDERINGLABEL_EXPORT vtkLabelRenderStrategy : public vtkObject
36 {
37 public:
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 
69  virtual void SetDefaultTextProperty(vtkTextProperty* tprop);
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 
110 protected:
112  ~vtkLabelRenderStrategy() override;
113 
116 
117 private:
119  void operator=(const vtkLabelRenderStrategy&) = delete;
120 };
121 
122 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label, int vtkNotUsed(maxWidth))
Superclass for label rendering implementations.
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:72
virtual bool SupportsRotation()
Whether the text rendering strategy supports rotation.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
a simple class to control print indentation
Definition: vtkIndent.h:39
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 bool SupportsBoundedSize()
Whether the text rendering strategy supports bounded size.
virtual void StartFrame()
Start a rendering frame.