VTK  9.0.1
vtkQtStringToImage.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtStringToImage.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 
24 #ifndef vtkQtStringToImage_h
25 #define vtkQtStringToImage_h
26 
27 #include "vtkRenderingQtModule.h" // For export macro
28 #include "vtkSmartPointer.h" // For SP ivars
29 #include "vtkStringToImage.h"
30 
32 
33 class VTKRENDERINGQT_EXPORT vtkQtStringToImage : public vtkStringToImage
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
39  static vtkQtStringToImage* New();
40 
42 
56  vtkTextProperty* property, const vtkUnicodeString& string, int dpi) override;
57  vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) override;
59 
61 
66  int RenderString(vtkTextProperty* property, const vtkUnicodeString& string, int dpi,
67  vtkImageData* data, int textDims[2] = nullptr) override;
68  int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
69  vtkImageData* data, int textDims[2] = nullptr) override;
71 
75  void DeepCopy(vtkQtStringToImage* utility);
76 
77 protected:
79  ~vtkQtStringToImage() override;
80 
81  class Internals;
82  Internals* Implementation;
83 
85 
86 private:
87  vtkQtStringToImage(const vtkQtStringToImage&) = delete;
88  void operator=(const vtkQtStringToImage&) = delete;
89 };
90 
91 #endif // vtkQtStringToImage_h
vtkQtStringToImage::Implementation
Internals * Implementation
Definition: vtkQtStringToImage.h:81
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkSmartPointer< vtkQImageToImageSource >
vtkStringToImage
base class for classes that render supplied text to an image.
Definition: vtkStringToImage.h:37
vtkStringToImage::RenderString
virtual int RenderString(vtkTextProperty *property, const vtkUnicodeString &string, int dpi, vtkImageData *data, int textDims[2]=nullptr)=0
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
vtkStringToImage::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkQImageToImageSource
Create image data from a QImage.
Definition: vtkQImageToImageSource.h:30
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:69
vtkQtStringToImage::QImageToImage
vtkSmartPointer< vtkQImageToImageSource > QImageToImage
Definition: vtkQtStringToImage.h:84
vtkSmartPointer.h
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkQtStringToImage
uses Qt to render the supplied text to an image.
Definition: vtkQtStringToImage.h:33
vtkStringToImage.h
vtkStringToImage::GetBounds
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].
vtkVector2i
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:419
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34