VTK  9.3.1
vtkLabelSizeCalculator.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 
28 #ifndef vtkLabelSizeCalculator_h
29 #define vtkLabelSizeCalculator_h
30 
32 #include "vtkRenderingLabelModule.h" // For export macro
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkIntArray;
36 class vtkTextRenderer;
37 class vtkStringArray;
38 class vtkTextProperty;
39 
40 class VTKRENDERINGLABEL_EXPORT vtkLabelSizeCalculator : public vtkPassInputTypeAlgorithm
41 {
42 public:
43  static vtkLabelSizeCalculator* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
54  virtual void SetFontProperty(vtkTextProperty* fontProp, int type = 0);
55  virtual vtkTextProperty* GetFontProperty(int type = 0);
57 
59 
63  vtkSetStringMacro(LabelSizeArrayName);
64  vtkGetStringMacro(LabelSizeArrayName);
66 
68 
72  vtkSetMacro(DPI, int);
73  vtkGetMacro(DPI, int);
75 
76 protected:
78  ~vtkLabelSizeCalculator() override;
79 
81  int RequestData(
82  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
83 
84  virtual vtkIntArray* LabelSizesForArray(vtkAbstractArray* labels, vtkIntArray* types);
85 
86  virtual void SetFontUtil(vtkTextRenderer* fontProp);
87  vtkGetObjectMacro(FontUtil, vtkTextRenderer);
88 
91 
92  int DPI;
93 
94  class Internals;
95  Internals* Implementation;
96 
97 private:
99  void operator=(const vtkLabelSizeCalculator&) = delete;
100 };
101 
102 VTK_ABI_NAMESPACE_END
103 #endif // vtkLabelSizeCalculator_h
Superclass for algorithms that produce output of the same type as input.
Store vtkAlgorithm input/output information.
Abstract superclass for all arrays.
a vtkAbstractArray subclass for strings
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:34
a simple class to control print indentation
Definition: vtkIndent.h:28
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
represent text properties.
Interface for generating images and path data from string data, using multiple backends.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store zero or more vtkInformation instances.
This filter takes an input dataset, an array to process (which must be a string array), and a text property.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
static vtkPassInputTypeAlgorithm * New()