VTK: Views/Infovis/vtkTreeHeatmapItem.h Source File

| VTK 9.3.1

vtkTreeHeatmapItem.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
27 #ifndef vtkTreeHeatmapItem_h
28 #define vtkTreeHeatmapItem_h
29
30 #include "vtkContextItem.h"
31 #include "vtkViewsInfovisModule.h" // For export macro
32
33 #include "vtkNew.h" // For vtkNew ivars
34 #include "vtkSmartPointer.h" // For vtkSmartPointer ivars
35 #include <map> // For string lookup tables
36 #include <vector> // For lookup tables
37
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkDendrogramItem;
40 class vtkHeatmapItem;
41 class vtkTable;
42 class vtkTree;
43
44 class VTKVIEWSINFOVIS_EXPORT vtkTreeHeatmapItem : public vtkContextItem
45 {
46 public:
47 static vtkTreeHeatmapItem* New();
48 vtkTypeMacro(vtkTreeHeatmapItem, vtkContextItem);
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
58 virtual void SetTree(vtkTree* tree);
59
63 vtkTree* GetTree();
64
70 virtual void SetColumnTree(vtkTree* tree);
71
76 vtkTree* GetColumnTree();
77
83 virtual void SetTable(vtkTable* table);
84
88 vtkTable* GetTable();
89
91
94 vtkDendrogramItem* GetDendrogram();
95 void SetDendrogram(vtkDendrogramItem* dendrogram);
97
99
102 vtkHeatmapItem* GetHeatmap();
103 void SetHeatmap(vtkHeatmapItem* heatmap);
105
110 void ReorderTable();
111
117 void ReverseTableRows();
118
124 void ReverseTableColumns();
125
130 void SetOrientation(int orientation);
131
135 int GetOrientation();
136
140 void GetBounds(double bounds[4]);
141
145 void GetCenter(double center[2]);
146
150 void GetSize(double size[2]);
151
161 void CollapseToNumberOfLeafNodes(unsigned int n);
162
164
167 float GetTreeLineWidth();
168 void SetTreeLineWidth(float width);
170
174 vtkTree* GetPrunedTree();
175
180 void SetTreeColorArray(const char* arrayName);
181
185 bool Hit(const vtkContextMouseEvent& mouse) override;
186
191 bool MouseDoubleClickEvent(const vtkContextMouseEvent& event) override;
192
193 protected:
194 vtkTreeHeatmapItem();
195 ~vtkTreeHeatmapItem() override;
196
200 bool Paint(vtkContext2D* painter) override;
201
205 void CollapseHeatmapRows();
206
210 void CollapseHeatmapColumns();
211
212 vtkSmartPointer<vtkDendrogramItem> Dendrogram;
213 vtkSmartPointer<vtkDendrogramItem> ColumnDendrogram;
214 vtkSmartPointer<vtkHeatmapItem> Heatmap;
215 int Orientation;
216
217 private:
218 vtkTreeHeatmapItem(const vtkTreeHeatmapItem&) = delete;
219 void operator=(const vtkTreeHeatmapItem&) = delete;
220
221 vtkMTimeType TreeHeatmapBuildTime;
222 };
223
224 VTK_ABI_NAMESPACE_END
225 #endif
vtkContext2D
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:59
vtkContextItem
base class for items that are part of a vtkContextScene.
Definition: vtkContextItem.h:35
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:39
vtkDendrogramItem
A 2D graphics item for rendering a tree as a dendrogram.
Definition: vtkDendrogramItem.h:47
vtkHeatmapItem
A 2D graphics item for rendering a heatmap.
Definition: vtkHeatmapItem.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkSmartPointer< vtkDendrogramItem >
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
vtkTreeHeatmapItem
A 2D graphics item for rendering a tree and an associated heatmap.
Definition: vtkTreeHeatmapItem.h:45
vtkTreeHeatmapItem::Dendrogram
vtkSmartPointer< vtkDendrogramItem > Dendrogram
Definition: vtkTreeHeatmapItem.h:212
vtkTreeHeatmapItem::GetTable
vtkTable * GetTable()
Get the table that this item draws.
vtkTreeHeatmapItem::ReverseTableColumns
void ReverseTableColumns()
Reverse the order of the rows in our input table.
vtkTreeHeatmapItem::ColumnDendrogram
vtkSmartPointer< vtkDendrogramItem > ColumnDendrogram
Definition: vtkTreeHeatmapItem.h:213
vtkTreeHeatmapItem::GetBounds
void GetBounds(double bounds[4])
Get the bounds of this item (xMin, xMax, yMin, Max) in pixel coordinates.
vtkTreeHeatmapItem::SetTreeColorArray
void SetTreeColorArray(const char *arrayName)
Deprecated.
vtkTreeHeatmapItem::MouseDoubleClickEvent
bool MouseDoubleClickEvent(const vtkContextMouseEvent &event) override
Propagate any double click onto the dendrogram to check if any subtrees should be collapsed or expand...
vtkTreeHeatmapItem::Heatmap
vtkSmartPointer< vtkHeatmapItem > Heatmap
Definition: vtkTreeHeatmapItem.h:214
vtkTreeHeatmapItem::SetHeatmap
void SetHeatmap(vtkHeatmapItem *heatmap)
Get/Set the heatmap contained by this item.
vtkTreeHeatmapItem::~vtkTreeHeatmapItem
~vtkTreeHeatmapItem() override
vtkTreeHeatmapItem::GetDendrogram
vtkDendrogramItem * GetDendrogram()
Get/Set the dendrogram contained by this item.
vtkTreeHeatmapItem::SetOrientation
void SetOrientation(int orientation)
Set which way the tree / heatmap should face within the visualization.
vtkTreeHeatmapItem::ReverseTableRows
void ReverseTableRows()
Reverse the order of the rows in our input table.
vtkTreeHeatmapItem::SetTree
virtual void SetTree(vtkTree *tree)
Set the tree that this item draws.
vtkTreeHeatmapItem::CollapseHeatmapRows
void CollapseHeatmapRows()
Mark heatmap rows as hidden when a subtree is collapsed.
vtkTreeHeatmapItem::New
static vtkTreeHeatmapItem * New()
vtkTreeHeatmapItem::SetDendrogram
void SetDendrogram(vtkDendrogramItem *dendrogram)
Get/Set the dendrogram contained by this item.
vtkTreeHeatmapItem::SetTreeLineWidth
void SetTreeLineWidth(float width)
Get/Set how wide the edges of the trees should be.
vtkTreeHeatmapItem::CollapseToNumberOfLeafNodes
void CollapseToNumberOfLeafNodes(unsigned int n)
Collapse subtrees until there are only n leaf nodes left in the tree.
vtkTreeHeatmapItem::GetOrientation
int GetOrientation()
Get the current orientation.
vtkTreeHeatmapItem::SetColumnTree
virtual void SetColumnTree(vtkTree *tree)
Set a tree to be drawn for the columns of the heatmap.
vtkTreeHeatmapItem::GetSize
void GetSize(double size[2])
Get the size of this item in pixel coordinates.
vtkTreeHeatmapItem::ReorderTable
void ReorderTable()
Reorder the rows in the table so they match the order of the leaf nodes in our tree.
vtkTreeHeatmapItem::Hit
bool Hit(const vtkContextMouseEvent &mouse) override
Returns true if the transform is interactive, false otherwise.
vtkTreeHeatmapItem::SetTable
virtual void SetTable(vtkTable *table)
Set the table that this item draws.
vtkTreeHeatmapItem::GetPrunedTree
vtkTree * GetPrunedTree()
Deprecated.
vtkTreeHeatmapItem::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTreeHeatmapItem::GetTree
vtkTree * GetTree()
Get the tree that this item draws.
vtkTreeHeatmapItem::Orientation
int Orientation
Definition: vtkTreeHeatmapItem.h:215
vtkTreeHeatmapItem::GetCenter
void GetCenter(double center[2])
Get the center point of this item in pixel coordinates.
vtkTreeHeatmapItem::Paint
bool Paint(vtkContext2D *painter) override
Paints the tree & associated table as a heatmap.
vtkTreeHeatmapItem::GetHeatmap
vtkHeatmapItem * GetHeatmap()
Get/Set the heatmap contained by this item.
vtkTreeHeatmapItem::GetTreeLineWidth
float GetTreeLineWidth()
Get/Set how wide the edges of the trees should be.
vtkTreeHeatmapItem::GetColumnTree
vtkTree * GetColumnTree()
Get the tree that represents the columns of the heatmap (if one has been set).
vtkTreeHeatmapItem::vtkTreeHeatmapItem
vtkTreeHeatmapItem()
vtkTreeHeatmapItem::CollapseHeatmapColumns
void CollapseHeatmapColumns()
Mark heatmap columns as hidden when a subtree is collapsed.
vtkTree
A rooted tree data structure.
Definition: vtkTree.h:55
vtkX3D::orientation
@ orientation
Definition: vtkX3D.h:262
vtkX3D::center
@ center
Definition: vtkX3D.h:230
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkContextItem.h
vtkNew.h
vtkSmartPointer.h
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270