VTK
vtkLabeledTreeMapDataMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLabeledTreeMapDataMapper.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 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
44 #ifndef vtkLabeledTreeMapDataMapper_h
45 #define vtkLabeledTreeMapDataMapper_h
46 
47 #include "vtkLabeledDataMapper.h"
48 #include "vtkRenderingLabelModule.h" // For export macro
49 
50 class vtkTree;
51 class vtkPoints;
52 class vtkCoordinate;
53 class vtkFloatArray;
54 class vtkStringArray;
55 class vtkIdList;
56 
57 class VTKRENDERINGLABEL_EXPORT vtkLabeledTreeMapDataMapper : public vtkLabeledDataMapper
58 {
59 public:
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
65 
68  void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor) override;
69  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor) override;
71 
75  virtual vtkTree* GetInputTree();
76 
80  virtual void SetRectanglesArrayName(const char* name);
81 
83 
88  vtkGetMacro(ClipTextMode, int);
89  vtkSetMacro(ClipTextMode, int);
91 
93 
96  vtkGetMacro(ChildMotion, int);
97  vtkSetMacro(ChildMotion, int);
99 
101 
104  vtkGetMacro(DynamicLevel, int);
105  vtkSetMacro(DynamicLevel, int);
107 
111  void ReleaseGraphicsResources(vtkWindow*) override;
112 
114 
117  void SetFontSizeRange(int maxSize, int minSize, int delta = 4);
118  void GetFontSizeRange(int range[3]);
120 
122 
127  void SetLevelRange(int startLevel, int endLevel);
128  void GetLevelRange(int range[2]);
130 
131 protected:
133  ~vtkLabeledTreeMapDataMapper() override;
134  void LabelTree(vtkTree* tree, vtkFloatArray* boxInfo, vtkDataArray* numericData,
135  vtkStringArray* stringData, int activeComp, int numComps);
136  void GetVertexLabel(vtkIdType vertex, vtkDataArray* numericData, vtkStringArray* stringData,
137  int activeComp, int numComps, char* string, size_t stringSize);
138  void UpdateFontSizes();
139  int UpdateWindowInfo(vtkViewport* viewport);
140  int GetStringSize(char* string, int level);
141  // Returns 1 if the transformed box is off screen
142  int ConvertToDC(float* origBoxInfo, float* newBoxInfo);
143  // Returns 1 if the label will not fit in box - 2 if the text could
144  // not be placed due to other labels
145  int AnalyseLabel(
146  char* string, int level, float* blimitsDC, float* textPosWC, vtkTextProperty** tprop);
147  int ApplyMasks(int level, float flimits[4], float blimits[4]);
150  int** FontWidths;
154  double BoxTrans[2][2];
155  double WindowLimits[2][2];
156 
157  float (*LabelMasks)[4];
158 
165  int EndLevel;
169 
170 private:
172  void operator=(const vtkLabeledTreeMapDataMapper&) = delete;
173 };
174 
175 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkLabeledTreeMapDataMapper::ChildMotion
int ChildMotion
Definition: vtkLabeledTreeMapDataMapper.h:163
vtkLabeledTreeMapDataMapper::MaxTreeLevels
int MaxTreeLevels
Definition: vtkLabeledTreeMapDataMapper.h:153
vtkLabeledTreeMapDataMapper
draw text labels on a tree map
Definition: vtkLabeledTreeMapDataMapper.h:57
vtkLabeledDataMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType
int vtkIdType
Definition: vtkType.h:343
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:35
vtkLabeledTreeMapDataMapper::VertexList
vtkIdList * VertexList
Definition: vtkLabeledTreeMapDataMapper.h:159
vtkLabeledTreeMapDataMapper::HLabelProperties
vtkTextProperty ** HLabelProperties
Definition: vtkLabeledTreeMapDataMapper.h:168
vtkX3D::range
Definition: vtkX3D.h:244
vtkLabeledTreeMapDataMapper::FontHeights
int * FontHeights
Definition: vtkLabeledTreeMapDataMapper.h:149
vtkLabeledDataMapper::RenderOpaqueGeometry
void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor) override
Draw the text to the screen at each input point.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkLabeledTreeMapDataMapper::DynamicLevel
int DynamicLevel
Definition: vtkLabeledTreeMapDataMapper.h:166
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkLabeledTreeMapDataMapper::MaxFontLevel
int MaxFontLevel
Definition: vtkLabeledTreeMapDataMapper.h:151
vtkTree
A rooted tree data structure.
Definition: vtkTree.h:54
vtkX3D::level
Definition: vtkX3D.h:401
vtkLabeledTreeMapDataMapper::CurrentViewPort
vtkViewport * CurrentViewPort
Definition: vtkLabeledTreeMapDataMapper.h:148
vtkLabeledDataMapper::RenderOverlay
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor) override
vtkLabeledTreeMapDataMapper::VCoord
vtkCoordinate * VCoord
Definition: vtkLabeledTreeMapDataMapper.h:161
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkLabeledTreeMapDataMapper::EndLevel
int EndLevel
Definition: vtkLabeledTreeMapDataMapper.h:165
vtkLabeledDataMapper::New
static vtkLabeledDataMapper * New()
Instantiate object with %%-#6.3g label format.
vtkLabeledTreeMapDataMapper::VerticalLabelProperty
vtkTextProperty * VerticalLabelProperty
Definition: vtkLabeledTreeMapDataMapper.h:167
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkLabeledTreeMapDataMapper::TextPoints
vtkPoints * TextPoints
Definition: vtkLabeledTreeMapDataMapper.h:160
vtkLabeledTreeMapDataMapper::FontWidths
int ** FontWidths
Definition: vtkLabeledTreeMapDataMapper.h:150
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkX3D::name
Definition: vtkX3D.h:225
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkLabeledDataMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkLabeledDataMapper
draw text labels at dataset points
Definition: vtkLabeledDataMapper.h:70
vtkLabeledTreeMapDataMapper::ChildrenCount
int * ChildrenCount
Definition: vtkLabeledTreeMapDataMapper.h:152
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:36
vtkLabeledTreeMapDataMapper::ClipTextMode
int ClipTextMode
Definition: vtkLabeledTreeMapDataMapper.h:162
vtkLabeledDataMapper.h
vtkLabeledTreeMapDataMapper::StartLevel
int StartLevel
Definition: vtkLabeledTreeMapDataMapper.h:164