forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkTreeMapLayout.h
100 lines (79 loc) · 3.47 KB
/
vtkTreeMapLayout.h
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
/*=========================================================================
Program: Visualization Toolkit
Module: vtkTreeMapLayout.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 vtkTreeMapLayout - layout a vtkTree into a tree map
//
// .SECTION Description
// vtkTreeMapLayout assigns rectangular regions to each vertex in the tree,
// creating a tree map. The data is added as a data array with four
// components per tuple representing the location and size of the
// rectangle using the format (Xmin, Xmax, Ymin, Ymax).
//
// This algorithm relies on a helper class to perform the actual layout.
// This helper class is a subclass of vtkTreeMapLayoutStrategy.
//
// .SECTION Thanks
// Thanks to Brian Wylie and Ken Moreland from Sandia National Laboratories
// for help developing this class.
//
// Tree map concept comes from:
// Shneiderman, B. 1992. Tree visualization with tree-maps: 2-d space-filling approach.
// ACM Trans. Graph. 11, 1 (Jan. 1992), 92-99.
#ifndef vtkTreeMapLayout_h
#define vtkTreeMapLayout_h
#include "vtkInfovisLayoutModule.h" // For export macro
#include "vtkTreeAlgorithm.h"
class vtkTreeMapLayoutStrategy;
class VTKINFOVISLAYOUT_EXPORT vtkTreeMapLayout : public vtkTreeAlgorithm
{
public:
static vtkTreeMapLayout *New();
vtkTypeMacro(vtkTreeMapLayout,vtkTreeAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// The field name to use for storing the rectangles for each vertex.
// The rectangles are stored in a quadruple float array
// (minX, maxX, minY, maxY).
vtkGetStringMacro(RectanglesFieldName);
vtkSetStringMacro(RectanglesFieldName);
// Description:
// The array to use for the size of each vertex.
virtual void SetSizeArrayName(const char* name)
{ this->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_VERTICES, name); }
// Description:
// The strategy to use when laying out the tree map.
vtkGetObjectMacro(LayoutStrategy, vtkTreeMapLayoutStrategy);
void SetLayoutStrategy(vtkTreeMapLayoutStrategy * strategy);
// Description:
// Returns the vertex id that contains pnt (or -1 if no one contains it)
vtkIdType FindVertex(float pnt[2], float *binfo=0);
// Description:
// Return the min and max 2D points of the
// vertex's bounding box
void GetBoundingBox(vtkIdType id, float *binfo);
// Description:
// Get the modification time of the layout algorithm.
virtual unsigned long GetMTime();
protected:
vtkTreeMapLayout();
~vtkTreeMapLayout();
char * RectanglesFieldName;
vtkTreeMapLayoutStrategy* LayoutStrategy;
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
private:
vtkTreeMapLayout(const vtkTreeMapLayout&); // Not implemented.
void operator=(const vtkTreeMapLayout&); // Not implemented.
};
#endif