VTK  9.1.0
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=========================================================================*/
36#ifndef vtkTreeHeatmapItem_h
37#define vtkTreeHeatmapItem_h
38
39#include "vtkContextItem.h"
40#include "vtkViewsInfovisModule.h" // For export macro
41
42#include "vtkNew.h" // For vtkNew ivars
43#include "vtkSmartPointer.h" // For vtkSmartPointer ivars
44#include <map> // For string lookup tables
45#include <vector> // For lookup tables
46
48class vtkHeatmapItem;
49class vtkTable;
50class vtkTree;
51
52class VTKVIEWSINFOVIS_EXPORT vtkTreeHeatmapItem : public vtkContextItem
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
66 virtual void SetTree(vtkTree* tree);
67
72
78 virtual void SetColumnTree(vtkTree* tree);
79
85
91 virtual void SetTable(vtkTable* table);
92
97
99
105
107
113
119
126
133
138 void SetOrientation(int orientation);
139
144
148 void GetBounds(double bounds[4]);
149
153 void GetCenter(double center[2]);
154
158 void GetSize(double size[2]);
159
169 void CollapseToNumberOfLeafNodes(unsigned int n);
170
172
176 void SetTreeLineWidth(float width);
178
183
188 void SetTreeColorArray(const char* arrayName);
189
193 bool Hit(const vtkContextMouseEvent& mouse) override;
194
199 bool MouseDoubleClickEvent(const vtkContextMouseEvent& event) override;
200
201protected:
204
208 bool Paint(vtkContext2D* painter) override;
209
214
219
224
225private:
226 vtkTreeHeatmapItem(const vtkTreeHeatmapItem&) = delete;
227 void operator=(const vtkTreeHeatmapItem&) = delete;
228
229 vtkMTimeType TreeHeatmapBuildTime;
230};
231
232#endif
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
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:113
Hold a reference to a vtkObjectBase instance.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
A 2D graphics item for rendering a tree and an associated heatmap.
vtkSmartPointer< vtkDendrogramItem > Dendrogram
vtkTree * GetPrunedTree()
Deprecated.
void ReverseTableColumns()
Reverse the order of the rows in our input table.
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.
bool MouseDoubleClickEvent(const vtkContextMouseEvent &event) override
Propagate any double click onto the dendrogram to check if any subtrees should be collapsed or expand...
vtkSmartPointer< vtkHeatmapItem > Heatmap
void SetHeatmap(vtkHeatmapItem *heatmap)
Get/Set the heatmap contained by this item.
~vtkTreeHeatmapItem() override
vtkTree * GetColumnTree()
Get the tree that represents the columns of the heatmap (if one has been set).
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.
vtkDendrogramItem * GetDendrogram()
Get/Set the dendrogram contained by this item.
void SetDendrogram(vtkDendrogramItem *dendrogram)
Get/Set the dendrogram contained by this item.
void SetTreeLineWidth(float width)
Get/Set how wide the edges of the trees should be.
void CollapseToNumberOfLeafNodes(unsigned int n)
Collapse subtrees until there are only n leaf nodes left in the tree.
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.
static vtkTreeHeatmapItem * New()
void ReorderTable()
Reorder the rows in the table so they match the order of the leaf nodes in our tree.
bool Hit(const vtkContextMouseEvent &mouse) override
Returns true if the transform is interactive, false otherwise.
virtual void SetTable(vtkTable *table)
Set the table that this item draws.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void GetCenter(double center[2])
Get the center point of this item in pixel coordinates.
vtkTable * GetTable()
Get the table that this item draws.
bool Paint(vtkContext2D *painter) override
Paints the tree & associated table as a heatmap.
float GetTreeLineWidth()
Get/Set how wide the edges of the trees should be.
vtkHeatmapItem * GetHeatmap()
Get/Set the heatmap contained by this item.
vtkTree * GetTree()
Get the tree that this item draws.
void CollapseHeatmapColumns()
Mark heatmap columns as hidden when a subtree is collapsed.
A rooted tree data structure.
Definition: vtkTree.h:164
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287