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 "vtkLabeledDataMapper.h"
47 
48 class vtkTree;
49 class vtkPoints;
50 class vtkCoordinate;
51 class vtkFloatArray;
52 class vtkStringArray;
53 class vtkIdList;
54 
56 {
57 public:
60  void PrintSelf(ostream& os, vtkIndent indent);
61 
63 
64  virtual void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
65  virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
67 
69  virtual vtkTree *GetInputTree();
70 
72  virtual void SetRectanglesArrayName(const char* name);
73 
75 
78  vtkGetMacro(ClipTextMode, int);
79  vtkSetMacro(ClipTextMode, int);
81 
83 
84  vtkGetMacro(ChildMotion, int);
85  vtkSetMacro(ChildMotion, int);
87 
89 
90  vtkGetMacro(DynamicLevel, int);
91  vtkSetMacro(DynamicLevel, int);
93 
95  virtual void ReleaseGraphicsResources(vtkWindow *);
96 
98 
99  void SetFontSizeRange(int maxSize, int minSize, int delta=4);
100  void GetFontSizeRange(int range[3]);
102 
104 
106  void SetLevelRange(int startLevel, int endLevel);
107  void GetLevelRange(int range[2]);
109 
110 protected:
113  void LabelTree(vtkTree *tree, vtkFloatArray *boxInfo,
114  vtkDataArray *numericData, vtkStringArray *stringData,
115  int activeComp, int numComps);
116  void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
117  vtkStringArray *stringData, int activeComp, int numComps,
118  char *string);
119  void UpdateFontSizes();
120  int UpdateWindowInfo(vtkViewport *viewport);
121  int GetStringSize(char *string, int level);
122  // Returns 1 if the transformed box is off screen
123  int ConvertToDC(float *origBoxInfo, float *newBoxInfo);
124  // Returns 1 if the label will not fit in box - 2 if the text could
125  // not be placed due to other labels
126  int AnalyseLabel(char * string, int level, float *blimitsDC,
127  float *textPosWC,
128  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  //BTX
139  float (*LabelMasks)[4];
140  //ETX
147  int EndLevel;
151 
152 private:
153  vtkLabeledTreeMapDataMapper(const vtkLabeledTreeMapDataMapper&); // Not implemented.
154  void operator=(const vtkLabeledTreeMapDataMapper&); // Not implemented.
155 };
156 
157 
158 #endif
static vtkLabeledDataMapper * New()
abstract specification for Viewports
Definition: vtkViewport.h:45
draw text labels on a tree map
a actor that draws 2D data
Definition: vtkActor2D.h:43
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:255
draw text labels at dataset points
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
a simple class to control print indentation
Definition: vtkIndent.h:37
list of point or cell ids
Definition: vtkIdList.h:34
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
virtual void ReleaseGraphicsResources(vtkWindow *)
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
#define VTK_RENDERING_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
A rooted tree data structure.
Definition: vtkTree.h:58
void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor)
represent and manipulate 3D points
Definition: vtkPoints.h:38