VTK
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 "vtkRenderingCoreModule.h" // For export macro
29#include "vtkObject.h"
30
31class vtkStdString;
33class vtkTextProperty;
34class vtkImageData;
35class vtkVector2i;
36
37class VTKRENDERINGCORE_EXPORT vtkStringToImage : public vtkObject
38{
39public:
41 virtual void PrintSelf(ostream &os, vtkIndent indent);
42
44
58 const vtkUnicodeString& string, int dpi) = 0;
60 const vtkStdString& string, int dpi) = 0;
62
64
71 virtual int RenderString(vtkTextProperty *property,
72 const vtkUnicodeString& string, int dpi,
74 int textDims[2] = NULL) = 0;
75 virtual int RenderString(vtkTextProperty *property,
76 const vtkStdString& string, int dpi,
78 int text_dims[2] = NULL) = 0;
80
85 virtual void SetScaleToPowerOfTwo(bool scale);
86 vtkGetMacro(ScaleToPowerOfTwo, bool)
87
88protected:
91
94
95private:
96 vtkStringToImage(const vtkStringToImage &) VTK_DELETE_FUNCTION;
97 void operator=(const vtkStringToImage &) VTK_DELETE_FUNCTION;
98};
99
100#endif //vtkStringToImage_h
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
base class for classes that render supplied text to an image.
virtual void SetScaleToPowerOfTwo(bool scale)
Should we produce images at powers of 2, makes rendering on old OpenGL hardware easier.
virtual int RenderString(vtkTextProperty *property, const vtkUnicodeString &string, int dpi, vtkImageData *data, int textDims[2]=NULL)=0
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
virtual vtkVector2i GetBounds(vtkTextProperty *property, const vtkUnicodeString &string, int dpi)=0
Given a text property and a string, get the bounding box [xmin, xmax] x [ymin, ymax].
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int RenderString(vtkTextProperty *property, const vtkStdString &string, int dpi, vtkImageData *data, int text_dims[2]=NULL)=0
virtual vtkVector2i GetBounds(vtkTextProperty *property, const vtkStdString &string, int dpi)=0
represent text properties.
String class that stores Unicode text.
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:328
@ scale
Definition: vtkX3D.h:229
@ data
Definition: vtkX3D.h:315