VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
34 
35 VTK_ABI_NAMESPACE_BEGIN
36 class vtkTree;
37 class vtkPoints;
38 class vtkCoordinate;
39 class vtkFloatArray;
40 class vtkStringArray;
41 class vtkIdList;
42 
43 class VTKRENDERINGLABEL_EXPORT VTK_MARSHALAUTO vtkLabeledTreeMapDataMapper
44  : public vtkLabeledDataMapper
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
55  void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor) override;
56  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
58 
62  virtual vtkTree* GetInputTree();
63 
67  virtual void SetRectanglesArrayName(const char* name);
68 
70 
75  vtkGetMacro(ClipTextMode, int);
76  vtkSetMacro(ClipTextMode, int);
78 
80 
83  vtkGetMacro(ChildMotion, int);
84  vtkSetMacro(ChildMotion, int);
86 
88 
91  vtkGetMacro(DynamicLevel, int);
92  vtkSetMacro(DynamicLevel, int);
94 
96 
99  void SetFontSizeRange(int maxSize, int minSize, int delta = 4);
100  void GetFontSizeRange(int range[3]);
102 
104 
109  void SetLevelRange(int startLevel, int endLevel);
110  void GetLevelRange(int range[2]);
112 
113 protected:
115  ~vtkLabeledTreeMapDataMapper() override;
116  void LabelTree(vtkTree* tree, vtkFloatArray* boxInfo, vtkDataArray* numericData,
117  vtkStringArray* stringData, int activeComp, int numComps);
118  void GetVertexLabel(vtkIdType vertex, vtkDataArray* numericData, vtkStringArray* stringData,
119  int activeComp, int numComps, char* string, size_t stringSize);
120  void UpdateFontSizes();
121  int UpdateWindowInfo(vtkViewport* viewport);
122  int GetStringSize(char* string, int level);
123  // Returns 1 if the transformed box is off screen
124  int ConvertToDC(float* origBoxInfo, float* newBoxInfo);
125  // Returns 1 if the label will not fit in box - 2 if the text could
126  // not be placed due to other labels
127  int AnalyseLabel(
128  char* string, int level, float* blimitsDC, float* textPosWC, vtkTextProperty** tprop);
129  int ApplyMasks(int level, float flimits[4], float blimits[4]);
132  int** FontWidths;
136  double BoxTrans[2][2];
137  double WindowLimits[2][2];
138 
139  float (*LabelMasks)[4];
140 
147  int EndLevel;
151 
152 private:
154  void operator=(const vtkLabeledTreeMapDataMapper&) = delete;
155 };
156 
157 VTK_ABI_NAMESPACE_END
158 #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:46
draw text labels on a tree map
a actor that draws 2D data
Definition: vtkActor2D.h:35
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:31
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:363
draw text labels at dataset points
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
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:69
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
#define VTK_MARSHALAUTO
A rooted tree data structure.
Definition: vtkTree.h:46
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:30