VTK  9.1.0
vtkStringToImage.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStringToImage.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 =========================================================================*/
15 
25 #ifndef vtkStringToImage_h
26 #define vtkStringToImage_h
27 
28 #include "vtkDeprecation.h" // for deprecation macros
29 #include "vtkObject.h"
30 #include "vtkRenderingCoreModule.h" // For export macro
31 
32 class vtkStdString;
33 class vtkUnicodeString;
34 class vtkTextProperty;
35 class vtkImageData;
36 class vtkVector2i;
37 
38 class VTKRENDERINGCORE_EXPORT vtkStringToImage : public vtkObject
39 {
40 public:
41  vtkTypeMacro(vtkStringToImage, vtkObject);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
59  "Use vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi)")
61  vtkTextProperty* property, const vtkUnicodeString& string, int dpi) = 0;
62  virtual vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) = 0;
64 
66 
73  VTK_DEPRECATED_IN_9_1_0("Use int RenderString(vtkTextProperty* property, const vtkStdString& "
74  "string, int dpi, vtkImageData* data, int text_dims[2] = nullptr)")
75  virtual int RenderString(vtkTextProperty* property, const vtkUnicodeString& string, int dpi,
76  vtkImageData* data, int textDims[2] = nullptr) = 0;
77  virtual int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
78  vtkImageData* data, int text_dims[2] = nullptr) = 0;
80 
85  virtual void SetScaleToPowerOfTwo(bool scale);
86  vtkGetMacro(ScaleToPowerOfTwo, bool);
87 
88 protected:
90  ~vtkStringToImage() override;
91 
92  bool Antialias;
93  bool ScaleToPowerOfTwo;
94 
95 private:
96  vtkStringToImage(const vtkStringToImage&) = delete;
97  void operator=(const vtkStringToImage&) = delete;
98 };
99 
100 #endif // vtkStringToImage_h
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
VTK_DEPRECATED_IN_9_1_0
#define VTK_DEPRECATED_IN_9_1_0(reason)
Definition: vtkDeprecation.h:117
vtkStringToImage
base class for classes that render supplied text to an image.
Definition: vtkStringToImage.h:39
vtkStringToImage::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBlockSortHelper::GetBounds
void GetBounds(T a, double bds[6])
Definition: vtkBlockSortHelper.h:37
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:80
vtkObject.h
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:143
vtkDeprecation.h
vtkVector2i
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:478
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105