/usr/include/vtk-5.10/vtkLabeledTreeMapDataMapper.h is in libvtk5-dev 5.10.1+dfsg-2.1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkLabeledTreeMapDataMapper.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
// .NAME vtkLabeledTreeMapDataMapper - draw text labels on a tree map
//
// .SECTION Description
// vtkLabeledTreeMapDataMapper is a mapper that renders text on a tree map.
// A tree map is a vtkTree with an associated 4-tuple array
// used for storing the boundary rectangle for each vertex in the tree.
// The user must specify the array name used for storing the rectangles.
//
// The mapper iterates through the tree and attempts and renders a label
// inside the vertex's rectangle as long as the following conditions hold:
// 1. The vertex level is within the range of levels specified for labeling.
// 2. The label can fully fit inside its box.
// 3. The label does not overlap an ancestor's label.
//
// .SECTION See Also
// vtkLabeledDataMapper
//
// .SECTION Thanks
// Thanks to Patricia Crossno, Ken Moreland, Andrew Wilson and Brian Wylie from
// Sandia National Laboratories for their help in developing this class.
#ifndef __vtkLabeledTreeMapDataMapper_h
#define __vtkLabeledTreeMapDataMapper_h
#include "vtkLabeledDataMapper.h"
class vtkTree;
class vtkPoints;
class vtkCoordinate;
class vtkFloatArray;
class vtkStringArray;
class vtkIdList;
class VTK_RENDERING_EXPORT vtkLabeledTreeMapDataMapper : public vtkLabeledDataMapper
{
public:
static vtkLabeledTreeMapDataMapper *New();
vtkTypeMacro(vtkLabeledTreeMapDataMapper,vtkLabeledDataMapper);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Draw the text to the screen at each input point.
virtual void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
virtual void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
// Description:
// The input to this filter.
virtual vtkTree *GetInputTree();
// Description:
// The name of the 4-tuple array used for
virtual void SetRectanglesArrayName(const char* name);
// Description:
// Indicates if the label can be displayed clipped by the Window
// mode = 0 - ok to clip labels
// 1 - auto center labels w/r to the area of the vertex's clipped region
vtkGetMacro(ClipTextMode, int);
vtkSetMacro(ClipTextMode, int);
// Description:
// Indicates if the label can be moved by its ancestors
vtkGetMacro(ChildMotion, int);
vtkSetMacro(ChildMotion, int);
// Description:
// Indicates at which level labeling should be dynamic
vtkGetMacro(DynamicLevel, int);
vtkSetMacro(DynamicLevel, int);
// Description:
// Release any graphics resources that are being consumed by this actor.
virtual void ReleaseGraphicsResources(vtkWindow *);
// Description:
// The range of font sizes to use when rendering the labels.
void SetFontSizeRange(int maxSize, int minSize, int delta=4);
void GetFontSizeRange(int range[3]);
// Description:
// The range of levels to attempt to label.
// The level of a vertex is the length of the path to the root
// (the root has level 0).
void SetLevelRange(int startLevel, int endLevel);
void GetLevelRange(int range[2]);
protected:
vtkLabeledTreeMapDataMapper();
~vtkLabeledTreeMapDataMapper();
void LabelTree(vtkTree *tree, vtkFloatArray *boxInfo,
vtkDataArray *numericData, vtkStringArray *stringData,
int activeComp, int numComps);
void GetVertexLabel(vtkIdType vertex, vtkDataArray *numericData,
vtkStringArray *stringData, int activeComp, int numComps,
char *string);
void UpdateFontSizes();
int UpdateWindowInfo(vtkViewport *viewport);
int GetStringSize(char *string, int level);
// Returns 1 if the transformed box is off screen
int ConvertToDC(float *origBoxInfo, float *newBoxInfo);
// Returns 1 if the label will not fit in box - 2 if the text could
// not be placed due to other labels
int AnalyseLabel(char * string, int level, float *blimitsDC,
float *textPosWC,
vtkTextProperty **tprop);
int ApplyMasks(int level, float flimits[4], float blimits[4]);
vtkViewport *CurrentViewPort;
int *FontHeights;
int **FontWidths;
int MaxFontLevel;
int *ChildrenCount;
int MaxTreeLevels;
double BoxTrans[2][2];
double WindowLimits[2][2];
//BTX
float (*LabelMasks)[4];
//ETX
vtkIdList *VertexList;
vtkPoints *TextPoints;
vtkCoordinate *VCoord;
int ClipTextMode;
int ChildMotion;
int StartLevel;
int EndLevel;
int DynamicLevel;
vtkTextProperty *VerticalLabelProperty;
vtkTextProperty **HLabelProperties;
private:
vtkLabeledTreeMapDataMapper(const vtkLabeledTreeMapDataMapper&); // Not implemented.
void operator=(const vtkLabeledTreeMapDataMapper&); // Not implemented.
};
#endif
|