VTK  9.3.1
vtkLabeledTreeMapDataMapper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
28 #ifndef vtkLabeledTreeMapDataMapper_h
29 #define vtkLabeledTreeMapDataMapper_h
30 
31 #include "vtkLabeledDataMapper.h"
32 #include "vtkRenderingLabelModule.h" // For export macro
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkTree;
36 class vtkPoints;
37 class vtkCoordinate;
38 class vtkFloatArray;
39 class vtkStringArray;
40 class vtkIdList;
41 
42 class VTKRENDERINGLABEL_EXPORT vtkLabeledTreeMapDataMapper : public vtkLabeledDataMapper
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
53  void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor) override;
54  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
56 
60  virtual vtkTree* GetInputTree();
61 
65  virtual void SetRectanglesArrayName(const char* name);
66 
68 
73  vtkGetMacro(ClipTextMode, int);
74  vtkSetMacro(ClipTextMode, int);
76 
78 
81  vtkGetMacro(ChildMotion, int);
82  vtkSetMacro(ChildMotion, int);
84 
86 
89  vtkGetMacro(DynamicLevel, int);
90  vtkSetMacro(DynamicLevel, int);
92 
96  void ReleaseGraphicsResources(vtkWindow*) override;
97 
99 
102  void SetFontSizeRange(int maxSize, int minSize, int delta = 4);
103  void GetFontSizeRange(int range[3]);
105 
107 
112  void SetLevelRange(int startLevel, int endLevel);
113  void GetLevelRange(int range[2]);
115 
116 protected:
118  ~vtkLabeledTreeMapDataMapper() override;
119  void LabelTree(vtkTree* tree, vtkFloatArray* boxInfo, vtkDataArray* numericData,
120  vtkStringArray* stringData, int activeComp, int numComps);
121  void GetVertexLabel(vtkIdType vertex, vtkDataArray* numericData, vtkStringArray* stringData,
122  int activeComp, int numComps, char* string, size_t stringSize);
123  void UpdateFontSizes();
124  int UpdateWindowInfo(vtkViewport* viewport);
125  int GetStringSize(char* string, int level);
126  // Returns 1 if the transformed box is off screen
127  int ConvertToDC(float* origBoxInfo, float* newBoxInfo);
128  // Returns 1 if the label will not fit in box - 2 if the text could
129  // not be placed due to other labels
130  int AnalyseLabel(
131  char* string, int level, float* blimitsDC, float* textPosWC, vtkTextProperty** tprop);
132  int ApplyMasks(int level, float flimits[4], float blimits[4]);
135  int** FontWidths;
139  double BoxTrans[2][2];
140  double WindowLimits[2][2];
141 
142  float (*LabelMasks)[4];
143 
150  int EndLevel;
154 
155 private:
157  void operator=(const vtkLabeledTreeMapDataMapper&) = delete;
158 };
159 
160 VTK_ABI_NAMESPACE_END
161 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkLabeledDataMapper * New()
Instantiate object with %%-#6.3g label format.
abstract specification for Viewports
Definition: vtkViewport.h:44
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
draw text labels on a tree map
a actor that draws 2D data
Definition: vtkActor2D.h:34
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:30
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:315
draw text labels at dataset points
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:22
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
A rooted tree data structure.
Definition: vtkTree.h:45
void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
represent and manipulate 3D points
Definition: vtkPoints.h:28