VTK  9.1.0
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 #include "vtkUnicodeString.h" // For unicode string support
31 
32 class vtkRenderer;
33 class vtkWindow;
34 class vtkTextProperty;
35 
36 class VTKRENDERINGLABEL_EXPORT vtkLabelRenderStrategy : public vtkObject
37 {
38 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
47  virtual bool SupportsRotation() { return true; }
48 
56  virtual bool SupportsBoundedSize() { return true; }
57 
59 
62  virtual void SetRenderer(vtkRenderer* ren);
63  vtkGetObjectMacro(Renderer, vtkRenderer);
65 
67 
71  vtkGetObjectMacro(DefaultTextProperty, vtkTextProperty);
73 
78  virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label, double bds[4]);
80  "Use void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label, double bds[4])")
81  virtual void ComputeLabelBounds(
82  vtkTextProperty* tprop, vtkUnicodeString label, double bds[4]) = 0;
83 
93  virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label);
94  virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label, int maxWidth);
96  "Use void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label)")
97  virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkUnicodeString label) = 0;
99  "Use void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label, int maxWidth)")
100  virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkUnicodeString label, int maxWidth);
101 
105  virtual void StartFrame() {}
106 
110  virtual void EndFrame() {}
111 
118 
119 protected:
122 
125 
126 private:
128  void operator=(const vtkLabelRenderStrategy&) = delete;
129 };
130 
131 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
Superclass for label rendering implementations.
virtual bool SupportsRotation()
Whether the text rendering strategy supports rotation.
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.
~vtkLabelRenderStrategy() override
vtkTextProperty * DefaultTextProperty
virtual void SetDefaultTextProperty(vtkTextProperty *tprop)
Set the default text property for the strategy.
virtual void ComputeLabelBounds(vtkTextProperty *tprop, vtkStdString label, double bds[4])
Compute the bounds of a label.
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:36
represent text properties.
String class that stores Unicode text.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
#define VTK_DEPRECATED_IN_9_1_0(reason)