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 
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);
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkLabeledTreeMapDataMapper::ChildMotion
int ChildMotion
Definition: vtkLabeledTreeMapDataMapper.h:146
vtkLabeledTreeMapDataMapper::GetVertexLabel
void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData, vtkStringArray *stringData, int activeComp, int numComps, char *string)
vtkRenderingLabelModule.h
vtkLabeledTreeMapDataMapper::MaxTreeLevels
int MaxTreeLevels
Definition: vtkLabeledTreeMapDataMapper.h:136
vtkLabeledTreeMapDataMapper::LabelTree
void LabelTree(vtkTree *tree, vtkFloatArray *boxInfo, vtkDataArray *numericData, vtkStringArray *stringData, int activeComp, int numComps)
vtkLabeledTreeMapDataMapper
draw text labels on a tree map
Definition: vtkLabeledTreeMapDataMapper.h:57
vtkLabeledTreeMapDataMapper::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:49
vtkLabeledTreeMapDataMapper::VertexList
vtkIdList * VertexList
Definition: vtkLabeledTreeMapDataMapper.h:142
vtkLabeledTreeMapDataMapper::HLabelProperties
vtkTextProperty ** HLabelProperties
Definition: vtkLabeledTreeMapDataMapper.h:151
vtkLabeledTreeMapDataMapper::GetLevelRange
void GetLevelRange(int range[2])
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
VTKRENDERINGLABEL_EXPORT
#define VTKRENDERINGLABEL_EXPORT
Definition: vtkRenderingLabelModule.h:15
vtkLabeledTreeMapDataMapper::New
static vtkLabeledTreeMapDataMapper * New()
vtkLabeledTreeMapDataMapper::SetLevelRange
void SetLevelRange(int startLevel, int endLevel)
vtkLabeledTreeMapDataMapper::FontHeights
int * FontHeights
Definition: vtkLabeledTreeMapDataMapper.h:132
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkgl::range
GLenum GLint * range
Definition: vtkgl.h:14180
vtkLabeledTreeMapDataMapper::~vtkLabeledTreeMapDataMapper
~vtkLabeledTreeMapDataMapper()
vtkLabeledTreeMapDataMapper::DynamicLevel
int DynamicLevel
Definition: vtkLabeledTreeMapDataMapper.h:149
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkLabeledTreeMapDataMapper::MaxFontLevel
int MaxFontLevel
Definition: vtkLabeledTreeMapDataMapper.h:134
vtkTree
A rooted tree data structure.
Definition: vtkTree.h:60
float
float
Definition: vtkVectorOperators.h:162
vtkLabeledTreeMapDataMapper::CurrentViewPort
vtkViewport * CurrentViewPort
Definition: vtkLabeledTreeMapDataMapper.h:131
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkLabeledTreeMapDataMapper::ApplyMasks
int ApplyMasks(int level, float flimits[4], float blimits[4])
vtkLabeledTreeMapDataMapper::VCoord
vtkCoordinate * VCoord
Definition: vtkLabeledTreeMapDataMapper.h:144
vtkLabeledTreeMapDataMapper::GetInputTree
virtual vtkTree * GetInputTree()
vtkLabeledTreeMapDataMapper::SetFontSizeRange
void SetFontSizeRange(int maxSize, int minSize, int delta=4)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkLabeledTreeMapDataMapper::EndLevel
int EndLevel
Definition: vtkLabeledTreeMapDataMapper.h:148
vtkLabeledTreeMapDataMapper::vtkLabeledTreeMapDataMapper
vtkLabeledTreeMapDataMapper()
vtkLabeledTreeMapDataMapper::VerticalLabelProperty
vtkTextProperty * VerticalLabelProperty
Definition: vtkLabeledTreeMapDataMapper.h:150
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:70
vtkLabeledTreeMapDataMapper::UpdateWindowInfo
int UpdateWindowInfo(vtkViewport *viewport)
vtkLabeledTreeMapDataMapper::TextPoints
vtkPoints * TextPoints
Definition: vtkLabeledTreeMapDataMapper.h:143
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkLabeledTreeMapDataMapper::FontWidths
int ** FontWidths
Definition: vtkLabeledTreeMapDataMapper.h:133
vtkgl::level
GLint level
Definition: vtkgl.h:11316
vtkLabeledTreeMapDataMapper::SetRectanglesArrayName
virtual void SetRectanglesArrayName(const char *name)
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkLabeledTreeMapDataMapper::RenderOpaqueGeometry
virtual void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor)
vtkLabeledTreeMapDataMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkLabeledDataMapper
draw text labels at dataset points
Definition: vtkLabeledDataMapper.h:74
vtkLabeledTreeMapDataMapper::ConvertToDC
int ConvertToDC(float *origBoxInfo, float *newBoxInfo)
vtkLabeledTreeMapDataMapper::ChildrenCount
int * ChildrenCount
Definition: vtkLabeledTreeMapDataMapper.h:135
vtkLabeledTreeMapDataMapper::AnalyseLabel
int AnalyseLabel(char *string, int level, float *blimitsDC, float *textPosWC, vtkTextProperty **tprop)
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:45
vtkLabeledTreeMapDataMapper::RenderOverlay
virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor)
vtkLabeledTreeMapDataMapper::ClipTextMode
int ClipTextMode
Definition: vtkLabeledTreeMapDataMapper.h:145
vtkLabeledTreeMapDataMapper::UpdateFontSizes
void UpdateFontSizes()
vtkLabeledTreeMapDataMapper::GetFontSizeRange
void GetFontSizeRange(int range[3])
vtkLabeledDataMapper.h
vtkLabeledTreeMapDataMapper::GetStringSize
int GetStringSize(char *string, int level)
vtkLabeledTreeMapDataMapper::StartLevel
int StartLevel
Definition: vtkLabeledTreeMapDataMapper.h:147