VTK
vtkTreeHeatmapItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTreeHeatmapItem.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 =========================================================================*/
39 #ifndef vtkTreeHeatmapItem_h
40 #define vtkTreeHeatmapItem_h
41 
42 #include "vtkViewsInfovisModule.h" // For export macro
43 #include "vtkContextItem.h"
44 
45 #include "vtkNew.h" // For vtkNew ivars
46 #include "vtkSmartPointer.h" // For vtkSmartPointer ivars
47 #include <vector> // For lookup tables
48 #include <map> // For string lookup tables
49 
50 class vtkDendrogramItem;
51 class vtkHeatmapItem;
52 class vtkTable;
53 class vtkTree;
54 
55 class VTKVIEWSINFOVIS_EXPORT vtkTreeHeatmapItem : public vtkContextItem
56 {
57 public:
60  virtual void PrintSelf(ostream &os, vtkIndent indent);
61 
69  virtual void SetTree(vtkTree *tree);
70 
75 
81  virtual void SetColumnTree(vtkTree *tree);
82 
88 
94  virtual void SetTable(vtkTable *table);
95 
100 
102 
106  void SetDendrogram(vtkDendrogramItem *dendrogram);
108 
110 
114  void SetHeatmap(vtkHeatmapItem *heatmap);
116 
121  void ReorderTable();
122 
129 
136 
142 
147 
151  void GetBounds(double bounds[4]);
152 
156  void GetCenter(double center[2]);
157 
161  void GetSize(double size[2]);
162 
172  void CollapseToNumberOfLeafNodes(unsigned int n);
173 
175 
179  void SetTreeLineWidth(float width);
181 
186 
191  void SetTreeColorArray(const char *arrayName);
192 
196  virtual bool Hit(const vtkContextMouseEvent &mouse);
197 
202  virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &event);
203 
204 protected:
207 
211  virtual bool Paint(vtkContext2D *painter);
212 
217 
222 
227 
228 private:
229  vtkTreeHeatmapItem(const vtkTreeHeatmapItem&) VTK_DELETE_FUNCTION;
230  void operator=(const vtkTreeHeatmapItem&) VTK_DELETE_FUNCTION;
231 
232  vtkMTimeType TreeHeatmapBuildTime;
233 };
234 
235 #endif
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
base class for items that are part of a vtkContextScene.
data structure to represent mouse events.
A 2D graphics item for rendering a tree as a dendrogram.
A 2D graphics item for rendering a heatmap.
a simple class to control print indentation
Definition: vtkIndent.h:40
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
A 2D graphics item for rendering a tree and an associated heatmap.
vtkSmartPointer< vtkDendrogramItem > Dendrogram
vtkTable * GetTable()
Get the table that this item draws.
void ReverseTableColumns()
Reverse the order of the rows in our input table.
virtual bool Paint(vtkContext2D *painter)
Paints the tree & associated table as a heatmap.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkDendrogramItem > ColumnDendrogram
void GetBounds(double bounds[4])
Get the bounds of this item (xMin, xMax, yMin, Max) in pixel coordinates.
void SetTreeColorArray(const char *arrayName)
Deprecated.
vtkSmartPointer< vtkHeatmapItem > Heatmap
void SetHeatmap(vtkHeatmapItem *heatmap)
vtkDendrogramItem * GetDendrogram()
Get/Set the dendrogram contained by this item.
void SetOrientation(int orientation)
Set which way the tree / heatmap should face within the visualization.
void ReverseTableRows()
Reverse the order of the rows in our input table.
virtual void SetTree(vtkTree *tree)
Set the tree that this item draws.
void CollapseHeatmapRows()
Mark heatmap rows as hidden when a subtree is collapsed.
static vtkTreeHeatmapItem * New()
void SetDendrogram(vtkDendrogramItem *dendrogram)
void SetTreeLineWidth(float width)
void CollapseToNumberOfLeafNodes(unsigned int n)
Collapse subtrees until there are only n leaf nodes left in the tree.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Returns true if the transform is interactive, false otherwise.
int GetOrientation()
Get the current orientation.
virtual void SetColumnTree(vtkTree *tree)
Set a tree to be drawn for the columns of the heatmap.
void GetSize(double size[2])
Get the size of this item in pixel coordinates.
void ReorderTable()
Reorder the rows in the table so they match the order of the leaf nodes in our tree.
virtual void SetTable(vtkTable *table)
Set the table that this item draws.
vtkTree * GetPrunedTree()
Deprecated.
vtkTree * GetTree()
Get the tree that this item draws.
void GetCenter(double center[2])
Get the center point of this item in pixel coordinates.
vtkHeatmapItem * GetHeatmap()
Get/Set the heatmap contained by this item.
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &event)
Propagate any double click onto the dendrogram to check if any subtrees should be collapsed or expand...
float GetTreeLineWidth()
Get/Set how wide the edges of the trees should be.
vtkTree * GetColumnTree()
Get the tree that represents the columns of the heatmap (if one has been set).
void CollapseHeatmapColumns()
Mark heatmap columns as hidden when a subtree is collapsed.
A rooted tree data structure.
Definition: vtkTree.h:61
@ orientation
Definition: vtkX3D.h:262
@ center
Definition: vtkX3D.h:230
@ size
Definition: vtkX3D.h:253
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248