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 "vtkRenderingLabelModule.h" // For export macro
48 #include "vtkLabeledDataMapper.h"
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);
63 
65 
68  virtual void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
69  virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
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 
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:
134  void LabelTree(vtkTree *tree, vtkFloatArray *boxInfo,
135  vtkDataArray *numericData, vtkStringArray *stringData,
136  int activeComp, int numComps);
137  void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
138  vtkStringArray *stringData, int activeComp, int numComps,
139  char *string);
142  int GetStringSize(char *string, int level);
143  // Returns 1 if the transformed box is off screen
144  int ConvertToDC(float *origBoxInfo, float *newBoxInfo);
145  // Returns 1 if the label will not fit in box - 2 if the text could
146  // not be placed due to other labels
147  int AnalyseLabel(char * string, int level, float *blimitsDC,
148  float *textPosWC,
149  vtkTextProperty **tprop);
150  int ApplyMasks(int level, float flimits[4], float blimits[4]);
153  int **FontWidths;
157  double BoxTrans[2][2];
158  double WindowLimits[2][2];
159 
160  float (*LabelMasks)[4];
161 
168  int EndLevel;
172 
173 private:
174  vtkLabeledTreeMapDataMapper(const vtkLabeledTreeMapDataMapper&) VTK_DELETE_FUNCTION;
175  void operator=(const vtkLabeledTreeMapDataMapper&) VTK_DELETE_FUNCTION;
176 };
177 
178 
179 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkLabeledTreeMapDataMapper::ChildMotion
int ChildMotion
Definition: vtkLabeledTreeMapDataMapper.h:166
vtkLabeledTreeMapDataMapper::GetVertexLabel
void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData, vtkStringArray *stringData, int activeComp, int numComps, char *string)
vtkLabeledTreeMapDataMapper::MaxTreeLevels
int MaxTreeLevels
Definition: vtkLabeledTreeMapDataMapper.h:156
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:58
vtkLabeledTreeMapDataMapper::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this actor.
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:42
vtkLabeledTreeMapDataMapper::VertexList
vtkIdList * VertexList
Definition: vtkLabeledTreeMapDataMapper.h:162
vtkLabeledTreeMapDataMapper::HLabelProperties
vtkTextProperty ** HLabelProperties
Definition: vtkLabeledTreeMapDataMapper.h:171
vtkLabeledTreeMapDataMapper::GetLevelRange
void GetLevelRange(int range[2])
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkLabeledTreeMapDataMapper::New
static vtkLabeledTreeMapDataMapper * New()
vtkLabeledTreeMapDataMapper::SetLevelRange
void SetLevelRange(int startLevel, int endLevel)
The range of levels to attempt to label.
vtkLabeledTreeMapDataMapper::FontHeights
int * FontHeights
Definition: vtkLabeledTreeMapDataMapper.h:152
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkLabeledTreeMapDataMapper::~vtkLabeledTreeMapDataMapper
~vtkLabeledTreeMapDataMapper()
vtkLabeledTreeMapDataMapper::DynamicLevel
int DynamicLevel
Definition: vtkLabeledTreeMapDataMapper.h:169
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkLabeledTreeMapDataMapper::MaxFontLevel
int MaxFontLevel
Definition: vtkLabeledTreeMapDataMapper.h:154
vtkTree
A rooted tree data structure.
Definition: vtkTree.h:61
float
float
Definition: vtkVectorOperators.h:162
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkLabeledTreeMapDataMapper::CurrentViewPort
vtkViewport * CurrentViewPort
Definition: vtkLabeledTreeMapDataMapper.h:151
vtkLabeledTreeMapDataMapper::ApplyMasks
int ApplyMasks(int level, float flimits[4], float blimits[4])
vtkLabeledTreeMapDataMapper::VCoord
vtkCoordinate * VCoord
Definition: vtkLabeledTreeMapDataMapper.h:164
vtkLabeledTreeMapDataMapper::GetInputTree
virtual vtkTree * GetInputTree()
The input to this filter.
vtkLabeledTreeMapDataMapper::SetFontSizeRange
void SetFontSizeRange(int maxSize, int minSize, int delta=4)
The range of font sizes to use when rendering the labels.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkLabeledTreeMapDataMapper::EndLevel
int EndLevel
Definition: vtkLabeledTreeMapDataMapper.h:168
vtkLabeledTreeMapDataMapper::vtkLabeledTreeMapDataMapper
vtkLabeledTreeMapDataMapper()
vtkLabeledTreeMapDataMapper::VerticalLabelProperty
vtkTextProperty * VerticalLabelProperty
Definition: vtkLabeledTreeMapDataMapper.h:170
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:37
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:71
vtkLabeledTreeMapDataMapper::UpdateWindowInfo
int UpdateWindowInfo(vtkViewport *viewport)
vtkLabeledTreeMapDataMapper::TextPoints
vtkPoints * TextPoints
Definition: vtkLabeledTreeMapDataMapper.h:163
vtkLabeledTreeMapDataMapper::FontWidths
int ** FontWidths
Definition: vtkLabeledTreeMapDataMapper.h:153
vtkLabeledTreeMapDataMapper::SetRectanglesArrayName
virtual void SetRectanglesArrayName(const char *name)
The name of the 4-tuple array used for.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkLabeledTreeMapDataMapper::RenderOpaqueGeometry
virtual void RenderOpaqueGeometry(vtkViewport *viewport, vtkActor2D *actor)
Draw the text to the screen at each input point.
vtkLabeledTreeMapDataMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:40
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:46
vtkLabeledDataMapper
draw text labels at dataset points
Definition: vtkLabeledDataMapper.h:75
vtkLabeledTreeMapDataMapper::ConvertToDC
int ConvertToDC(float *origBoxInfo, float *newBoxInfo)
vtkLabeledTreeMapDataMapper::ChildrenCount
int * ChildrenCount
Definition: vtkLabeledTreeMapDataMapper.h:155
vtkLabeledTreeMapDataMapper::AnalyseLabel
int AnalyseLabel(char *string, int level, float *blimitsDC, float *textPosWC, vtkTextProperty **tprop)
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:43
vtkLabeledTreeMapDataMapper::RenderOverlay
virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor)
vtkLabeledTreeMapDataMapper::ClipTextMode
int ClipTextMode
Definition: vtkLabeledTreeMapDataMapper.h:165
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:167