VTK  9.0.20200712
vtkFreeTypeLabelRenderStrategy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFreeTypeLabelRenderStrategy.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 =========================================================================*/
24 #ifndef vtkFreeTypeLabelRenderStrategy_h
25 #define vtkFreeTypeLabelRenderStrategy_h
26 
27 #include "vtkLabelRenderStrategy.h"
28 #include "vtkRenderingLabelModule.h" // For export macro
29 
30 class vtkActor2D;
31 class vtkTextRenderer;
32 class vtkTextMapper;
33 
34 class VTKRENDERINGLABEL_EXPORT vtkFreeTypeLabelRenderStrategy : public vtkLabelRenderStrategy
35 {
36 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  bool SupportsRotation() override { return false; }
45 
49  bool SupportsBoundedSize() override { return false; }
50 
54  void ComputeLabelBounds(vtkTextProperty* tprop, vtkStdString label, double bds[4]) override
55  {
56  this->Superclass::ComputeLabelBounds(tprop, label, bds);
57  }
58  void ComputeLabelBounds(vtkTextProperty* tprop, vtkUnicodeString label, double bds[4]) override;
59 
64  void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label) override
65  {
66  this->Superclass::RenderLabel(x, tprop, label);
67  }
68  void RenderLabel(int x[2], vtkTextProperty* tprop, vtkStdString label, int width) override
69  {
70  this->Superclass::RenderLabel(x, tprop, label, width);
71  }
72  void RenderLabel(int x[2], vtkTextProperty* tprop, vtkUnicodeString label) override;
73  void RenderLabel(int x[2], vtkTextProperty* tprop, vtkUnicodeString label, int width) override
74  {
75  this->Superclass::RenderLabel(x, tprop, label, width);
76  }
77 
83  void ReleaseGraphicsResources(vtkWindow* window) override;
84 
85 protected:
88 
92 
93 private:
95  void operator=(const vtkFreeTypeLabelRenderStrategy&) = delete;
96 };
97 
98 #endif
vtkFreeTypeLabelRenderStrategy::RenderLabel
void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label, int width) override
Definition: vtkFreeTypeLabelRenderStrategy.h:68
vtkFreeTypeLabelRenderStrategy::RenderLabel
void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label) override
Render a label at a location in world coordinates.
Definition: vtkFreeTypeLabelRenderStrategy.h:64
vtkFreeTypeLabelRenderStrategy::SupportsRotation
bool SupportsRotation() override
The free type render strategy currently does not support rotation.
Definition: vtkFreeTypeLabelRenderStrategy.h:44
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkLabelRenderStrategy::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkFreeTypeLabelRenderStrategy::RenderLabel
void RenderLabel(int x[2], vtkTextProperty *tprop, vtkUnicodeString label, int width) override
Definition: vtkFreeTypeLabelRenderStrategy.h:73
vtkLabelRenderStrategy::RenderLabel
virtual void RenderLabel(int x[2], vtkTextProperty *tprop, vtkStdString label)
Render a label at a location in display coordinates.
Definition: vtkLabelRenderStrategy.h:94
vtkFreeTypeLabelRenderStrategy
Renders labels with freetype.
Definition: vtkFreeTypeLabelRenderStrategy.h:34
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:47
vtkLabelRenderStrategy.h
vtkFreeTypeLabelRenderStrategy::TextRenderer
vtkTextRenderer * TextRenderer
Definition: vtkFreeTypeLabelRenderStrategy.h:89
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:69
vtkFreeTypeLabelRenderStrategy::Actor
vtkActor2D * Actor
Definition: vtkFreeTypeLabelRenderStrategy.h:91
vtkFreeTypeLabelRenderStrategy::Mapper
vtkTextMapper * Mapper
Definition: vtkFreeTypeLabelRenderStrategy.h:90
vtkFreeTypeLabelRenderStrategy::ComputeLabelBounds
void ComputeLabelBounds(vtkTextProperty *tprop, vtkStdString label, double bds[4]) override
Compute the bounds of a label.
Definition: vtkFreeTypeLabelRenderStrategy.h:54
vtkLabelRenderStrategy
Superclass for label rendering implementations.
Definition: vtkLabelRenderStrategy.h:36
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkTextRenderer
Interface for generating images and path data from string data, using multiple backends.
Definition: vtkTextRenderer.h:73
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkLabelRenderStrategy::ComputeLabelBounds
virtual void ComputeLabelBounds(vtkTextProperty *tprop, vtkStdString label, double bds[4])
Compute the bounds of a label.
Definition: vtkLabelRenderStrategy.h:78
vtkFreeTypeLabelRenderStrategy::SupportsBoundedSize
bool SupportsBoundedSize() override
The free type render strategy currently does not support bounded size labels.
Definition: vtkFreeTypeLabelRenderStrategy.h:49
vtkLabelRenderStrategy::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this strategy.
Definition: vtkLabelRenderStrategy.h:124