VTK
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 =========================================================================*/
22 #ifndef __vtkLabelRenderStrategy_h
23 #define __vtkLabelRenderStrategy_h
24 
25 #include "vtkObject.h"
26 
27 #include "vtkStdString.h" // For string support
28 #include "vtkUnicodeString.h" // For unicode string support
29 
30 class vtkRenderer;
31 class vtkWindow;
32 class vtkTextProperty;
33 
35 {
36  public:
37  void PrintSelf(ostream& os, vtkIndent indent);
39 
41 
44  virtual bool SupportsRotation()
45  { return true; }
47 
49 
54  virtual bool SupportsBoundedSize()
55  { return true; }
57 
59 
60  virtual void SetRenderer(vtkRenderer* ren);
61  vtkGetObjectMacro(Renderer, vtkRenderer);
63 
65 
66  virtual void SetDefaultTextProperty(vtkTextProperty* tprop);
67  vtkGetObjectMacro(DefaultTextProperty, vtkTextProperty);
69 
71 
74  virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label,
75  double bds[4])
76  { this->ComputeLabelBounds(tprop, vtkUnicodeString::from_utf8(label.c_str()),
77  bds); }
78  virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkUnicodeString label,
79  double bds[4]) = 0;
81 
83 
90  virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label)
91  { this->RenderLabel(x, tprop, vtkUnicodeString::from_utf8(label)); }
92  virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label,
93  int maxWidth)
94  { this->RenderLabel(x, tprop, vtkUnicodeString::from_utf8(label), maxWidth); }
95  virtual void RenderLabel(int x[2], vtkTextProperty* tprop,
96  vtkUnicodeString label) = 0;
97  virtual void RenderLabel(int x[2], vtkTextProperty* tprop,
98  vtkUnicodeString label, int vtkNotUsed(maxWidth))
99  { this->RenderLabel(x, tprop, label); }
101 
103  virtual void StartFrame() { }
104 
106  virtual void EndFrame() { }
107 
112 
113 protected:
116 
119 
120 private:
121  vtkLabelRenderStrategy(const vtkLabelRenderStrategy&); // Not implemented.
122  void operator=(const vtkLabelRenderStrategy&); // Not implemented.
123 };
124 
125 #endif
126 
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
Superclass for label rendering implementations.
abstract base class for most VTK objects
Definition: vtkObject.h:60
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkUnicodeString label, int vtkNotUsed(maxWidth))
abstract specification for renderers
Definition: vtkRenderer.h:69
virtual void ComputeLabelBounds(vtkTextProperty *tprop, vtkStdString label, double bds[4])
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
virtual void PrintSelf(ostream &os, vtkIndent indent)
static vtkUnicodeString from_utf8(const char *)
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkTextProperty * DefaultTextProperty
represent text properties.
#define VTK_RENDERING_EXPORT
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label, int maxWidth)
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label)
String class that stores Unicode text.