VTK
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 "vtkStringToImage.h"
29 #include "vtkSmartPointer.h" // For SP ivars
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  const vtkUnicodeString& string, int dpi) override;
58  const vtkStdString& string, int dpi) override;
60 
62 
67  int RenderString(vtkTextProperty *property,
68  const vtkUnicodeString& string, int dpi,
70  int textDims[2] = nullptr) override;
71  int RenderString(vtkTextProperty *property,
72  const vtkStdString& string, int dpi,
74  int textDims[2] = nullptr) override;
76 
80  void DeepCopy(vtkQtStringToImage *utility);
81 
82 protected:
84  ~vtkQtStringToImage() override;
85 
86  class Internals;
87  Internals* Implementation;
88 
90 
91 private:
92  vtkQtStringToImage(const vtkQtStringToImage &) = delete;
93  void operator=(const vtkQtStringToImage &) = delete;
94 };
95 
96 #endif //vtkQtStringToImage_h
Create image data from a QImage.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
vtkSmartPointer< vtkQImageToImageSource > QImageToImage
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...
base class for classes that render supplied text to an image.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
uses Qt to render the supplied text to an image.
Internals * Implementation
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:405
represent text properties.
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].
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
String class that stores Unicode text.