38 #ifndef __vtkTreeHeatmapItem_h
39 #define __vtkTreeHeatmapItem_h
41 #include "vtkViewsInfovisModule.h"
42 #include "vtkContextItem.h"
45 #include "vtkSmartPointer.h"
62 virtual void PrintSelf(ostream &os, vtkIndent indent);
69 virtual void SetTree(vtkTree *tree);
78 virtual void SetTable(vtkTable *table);
81 vtkTable * GetTable();
87 void CollapseToNumberOfLeafNodes(
unsigned int n);
90 vtkTree * GetPrunedTree();
95 void SetTreeColorArray(
const char *arrayName);
99 virtual bool Hit(
const vtkContextMouseEvent &mouse);
102 virtual bool MouseMoveEvent(
const vtkContextMouseEvent &event);
107 virtual bool MouseDoubleClickEvent(
const vtkContextMouseEvent &event);
117 virtual void RebuildBuffers();
121 virtual void PaintBuffers(vtkContext2D *painter);
125 virtual bool IsDirty();
130 void ComputeMultipliers();
133 void ComputeTreeBounds();
136 void InitializeLookupTables();
139 virtual bool Paint(vtkContext2D *painter);
144 void GenerateLookupTableForStringColumn(vtkIdType column);
147 void PaintHeatmapWithoutTree(vtkContext2D *painter);
153 bool SetupTextProperty(vtkContext2D *painter);
158 std::string GetTooltipText(
float x,
float y);
161 void CountLeafNodes();
164 int CountLeafNodes(vtkIdType vertex);
167 vtkIdType GetClosestVertex(
double x,
double y);
170 void CollapseSubTree(vtkIdType vertex);
173 void ExpandSubTree(vtkIdType vertex);
176 vtkIdType GetOriginalId(vtkIdType vertex);
180 vtkIdType GetPrunedIdForOriginalId(vtkIdType originalId);
185 vtkIdType GetClickedCollapsedSubTree(
double x,
double y);
191 void UpdateVisibleSceneExtent(vtkContext2D *painter);
196 bool LineIsVisible(
double x0,
double y0,
double x1,
double y1);
202 vtkSmartPointer<vtkTree> Tree;
203 vtkSmartPointer<vtkTable> Table;
204 vtkSmartPointer<vtkTree> PrunedTree;
205 vtkSmartPointer<vtkTree> LayoutTree;
206 unsigned long TreeHeatmapBuildTime;
207 vtkNew<vtkGraphLayout> Layout;
208 vtkNew<vtkTooltipItem> Tooltip;
209 vtkNew<vtkPruneTreeFilter> PruneFilter;
210 vtkNew<vtkLookupTable> TriangleLookupTable;
211 vtkNew<vtkLookupTable> TreeLookupTable;
212 vtkDoubleArray* TreeColorArray;
213 std::vector< vtkLookupTable * > LookupTables;
214 std::vector< vtkIdType > RowMap;
217 int NumberOfLeafNodes;
221 std::map< int, std::map< std::string, double> > StringToDoubleMaps;
231 double SceneBottomLeft[3];
232 double SceneTopRight[3];
233 bool JustCollapsedOrExpanded;
layout a graph in 2 or 3 dimensions
prune a subtree out of a vtkTree
A 2D graphics item for rendering a tree and an associated heatmap.