VTK  9.3.20240417
vtkQtStringToImage.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
15 #ifndef vtkQtStringToImage_h
16 #define vtkQtStringToImage_h
17 
18 #include "vtkRenderingQtModule.h" // For export macro
19 #include "vtkSmartPointer.h" // For SP ivars
20 #include "vtkStringToImage.h"
21 
22 VTK_ABI_NAMESPACE_BEGIN
24 
25 class VTKRENDERINGQT_EXPORT vtkQtStringToImage : public vtkStringToImage
26 {
27 public:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
32 
34 
47  vtkVector2i GetBounds(vtkTextProperty* property, const vtkStdString& string, int dpi) override;
49 
51 
56  int RenderString(vtkTextProperty* property, const vtkStdString& string, int dpi,
57  vtkImageData* data, int textDims[2] = nullptr) override;
59 
63  void DeepCopy(vtkQtStringToImage* utility);
64 
65 protected:
67  ~vtkQtStringToImage() override;
68 
69  class Internals;
70  Internals* Implementation;
71 
73 
74 private:
75  vtkQtStringToImage(const vtkQtStringToImage&) = delete;
76  void operator=(const vtkQtStringToImage&) = delete;
77 };
78 
79 VTK_ABI_NAMESPACE_END
80 #endif // vtkQtStringToImage_h
topologically and geometrically regular array of data
Definition: vtkImageData.h:156
a simple class to control print indentation
Definition: vtkIndent.h:108
Create image data from a QImage.
uses Qt to render the supplied text to an image.
vtkSmartPointer< vtkQImageToImageSource > QImageToImage
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void DeepCopy(vtkQtStringToImage *utility)
Make a deep copy of the supplied utility class.
Internals * Implementation
vtkVector2i GetBounds(vtkTextProperty *property, const vtkStdString &string, int dpi) override
Given a text property and a string, get the bounding box [xmin, xmax] x [ymin, ymax].
static vtkQtStringToImage * New()
~vtkQtStringToImage() override
int RenderString(vtkTextProperty *property, const vtkStdString &string, int dpi, vtkImageData *data, int textDims[2]=nullptr) override
Given a text property and a string, this function initializes the vtkImageData *data and renders it i...
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:78
base class for classes that render supplied text to an image.
represent text properties.
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:470
@ data
Definition: vtkX3D.h:315