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 -------------------------------------------------------------------------*/
43 #ifndef vtkLabeledTreeMapDataMapper_h
44 #define vtkLabeledTreeMapDataMapper_h
45 
46 #include "vtkRenderingLabelModule.h" // For export macro
47 #include "vtkLabeledDataMapper.h"
48 
49 class vtkTree;
50 class vtkPoints;
51 class vtkCoordinate;
52 class vtkFloatArray;
53 class vtkStringArray;
54 class vtkIdList;
55 
57 {
58 public:
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
64 
65  virtual void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
66  virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
68 
70  virtual vtkTree *GetInputTree();
71 
73  virtual void SetRectanglesArrayName(const char* name);
74 
76 
79  vtkGetMacro(ClipTextMode, int);
80  vtkSetMacro(ClipTextMode, int);
82 
84 
85  vtkGetMacro(ChildMotion, int);
86  vtkSetMacro(ChildMotion, int);
88 
90 
91  vtkGetMacro(DynamicLevel, int);
92  vtkSetMacro(DynamicLevel, int);
94 
96  virtual void ReleaseGraphicsResources(vtkWindow *);
97 
99 
100  void SetFontSizeRange(int maxSize, int minSize, int delta=4);
101  void GetFontSizeRange(int range[3]);
103 
105 
107  void SetLevelRange(int startLevel, int endLevel);
108  void GetLevelRange(int range[2]);
110 
111 protected:
114  void LabelTree(vtkTree *tree, vtkFloatArray *boxInfo,
115  vtkDataArray *numericData, vtkStringArray *stringData,
116  int activeComp, int numComps);
117  void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
118  vtkStringArray *stringData, int activeComp, int numComps,
119  char *string);
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(char * string, int level, float *blimitsDC,
128  float *textPosWC,
129  vtkTextProperty **tprop);
130  int ApplyMasks(int level, float flimits[4], float blimits[4]);
133  int **FontWidths;
137  double BoxTrans[2][2];
138  double WindowLimits[2][2];
139  //BTX
140  float (*LabelMasks)[4];
141  //ETX
148  int EndLevel;
152 
153 private:
154  vtkLabeledTreeMapDataMapper(const vtkLabeledTreeMapDataMapper&); // Not implemented.
155  void operator=(const vtkLabeledTreeMapDataMapper&); // Not implemented.
156 };
157 
158 
159 #endif
static vtkLabeledDataMapper * New()
abstract specification for Viewports
Definition: vtkViewport.h:46
draw text labels on a tree map
a actor that draws 2D data
Definition: vtkActor2D.h:44
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:275
draw text labels at dataset points
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKRENDERINGLABEL_EXPORT
list of point or cell ids
Definition: vtkIdList.h:35
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual void ReleaseGraphicsResources(vtkWindow *)
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
void PrintSelf(ostream &os, vtkIndent indent)
A rooted tree data structure.
Definition: vtkTree.h:59
void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor)
represent and manipulate 3D points
Definition: vtkPoints.h:38