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 "vtkRenderingLabelModule.h" // For export macro
26 #include "vtkObject.h"
27 
28 #include "vtkStdString.h" // For string support
29 #include "vtkUnicodeString.h" // For unicode string support
30 
31 class vtkRenderer;
32 class vtkWindow;
33 class vtkTextProperty;
34 
36 {
37  public:
38  void PrintSelf(ostream& os, vtkIndent indent);
40 
42 
45  virtual bool SupportsRotation()
46  { return true; }
48 
50 
55  virtual bool SupportsBoundedSize()
56  { return true; }
58 
60 
61  virtual void SetRenderer(vtkRenderer* ren);
64 
66 
68  vtkGetObjectMacro(DefaultTextProperty, vtkTextProperty);
70 
72 
75  virtual void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label,
76  double bds[4])
77  { this->ComputeLabelBounds(tprop, vtkUnicodeString::from_utf8(label.c_str()),
78  bds); }
80  double bds[4]) = 0;
82 
84 
91  virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label)
92  { this->RenderLabel(x, tprop, vtkUnicodeString::from_utf8(label)); }
93  virtual void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label,
94  int maxWidth)
95  { this->RenderLabel(x, tprop, vtkUnicodeString::from_utf8(label), maxWidth); }
96  virtual void RenderLabel(int x[2], vtkTextProperty* tprop,
97  vtkUnicodeString label) = 0;
98  virtual void RenderLabel(int x[2], vtkTextProperty* tprop,
99  vtkUnicodeString label, int vtkNotUsed(maxWidth))
100  { this->RenderLabel(x, tprop, label); }
102 
104  virtual void StartFrame() { }
105 
107  virtual void EndFrame() { }
108 
113 
114 protected:
117 
120 
121 private:
122  vtkLabelRenderStrategy(const vtkLabelRenderStrategy&); // Not implemented.
123  void operator=(const vtkLabelRenderStrategy&); // Not implemented.
124 };
125 
126 #endif
127 
vtkLabelRenderStrategy::DefaultTextProperty
vtkTextProperty * DefaultTextProperty
Definition: vtkLabelRenderStrategy.h:119
vtkStdString.h
vtkLabelRenderStrategy::RenderLabel
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkUnicodeString label)=0
vtkRenderingLabelModule.h
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkLabelRenderStrategy::EndFrame
virtual void EndFrame()
Definition: vtkLabelRenderStrategy.h:107
vtkUnicodeString.h
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
VTKRENDERINGLABEL_EXPORT
#define VTKRENDERINGLABEL_EXPORT
Definition: vtkRenderingLabelModule.h:15
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkLabelRenderStrategy::RenderLabel
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label, int maxWidth)
Definition: vtkLabelRenderStrategy.h:93
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkLabelRenderStrategy::ComputeLabelBounds
virtual void ComputeLabelBounds(vtkTextProperty *tprop, vtkUnicodeString label, double bds[4])=0
vtkUnicodeString::from_utf8
static vtkUnicodeString from_utf8(const char *)
vtkLabelRenderStrategy::RenderLabel
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label)
Definition: vtkLabelRenderStrategy.h:91
vtkLabelRenderStrategy::SupportsBoundedSize
virtual bool SupportsBoundedSize()
Definition: vtkLabelRenderStrategy.h:55
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkLabelRenderStrategy::StartFrame
virtual void StartFrame()
Definition: vtkLabelRenderStrategy.h:104
vtkLabelRenderStrategy::vtkLabelRenderStrategy
vtkLabelRenderStrategy()
vtkNotUsed
#define vtkNotUsed(x)
Definition: vtkSetGet.h:557
vtkLabelRenderStrategy::~vtkLabelRenderStrategy
~vtkLabelRenderStrategy()
vtkLabelRenderStrategy::SetDefaultTextProperty
virtual void SetDefaultTextProperty(vtkTextProperty *tprop)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:72
vtkLabelRenderStrategy::RenderLabel
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkUnicodeString label, int vtkNotUsed(maxWidth))
Definition: vtkLabelRenderStrategy.h:98
vtkLabelRenderStrategy
Superclass for label rendering implementations.
Definition: vtkLabelRenderStrategy.h:36
vtkObject.h
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkLabelRenderStrategy::SetRenderer
virtual void SetRenderer(vtkRenderer *ren)
vtkLabelRenderStrategy::SupportsRotation
virtual bool SupportsRotation()
Definition: vtkLabelRenderStrategy.h:45
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:48
vtkLabelRenderStrategy::Renderer
vtkRenderer * Renderer
Definition: vtkLabelRenderStrategy.h:118
vtkLabelRenderStrategy::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkLabelRenderStrategy::ComputeLabelBounds
virtual void ComputeLabelBounds(vtkTextProperty *tprop, vtkStdString label, double bds[4])
Definition: vtkLabelRenderStrategy.h:75
vtkLabelRenderStrategy::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkLabelRenderStrategy.h:112