VTK  9.5.20251124
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
26
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 "vtkWrappingHints.h" // For VTK_MARSHALAUTO
36#include <map> // For string lookup tables
37#include <vector> // For lookup tables
38
39VTK_ABI_NAMESPACE_BEGIN
41class vtkHeatmapItem;
42class vtkTable;
43class vtkTree;
44
45class VTKVIEWSINFOVIS_EXPORT VTK_MARSHALAUTO vtkTreeHeatmapItem : public vtkContextItem
46{
47public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
60 virtual void SetTree(vtkTree* tree);
61
67
74 virtual void SetColumnTree(vtkTree* tree);
75
82
89 virtual void SetTable(vtkTable* table);
90
96
98
104
106
112
114
120
126
133
140
145 void SetOrientation(int orientation);
146
151
155 void GetBounds(double bounds[4]);
156
160 void GetCenter(double center[2]);
161
165 void GetSize(double size[2]);
166
176 void CollapseToNumberOfLeafNodes(unsigned int n);
177
179
183 void SetTreeLineWidth(float width);
185
190
195 void SetTreeColorArray(const char* arrayName);
196
200 bool Hit(const vtkContextMouseEvent& mouse) override;
201
206 bool MouseDoubleClickEvent(const vtkContextMouseEvent& event) override;
207
208protected:
211
215 bool Paint(vtkContext2D* painter) override;
216
221
226
231
232private:
233 vtkTreeHeatmapItem(const vtkTreeHeatmapItem&) = delete;
234 void operator=(const vtkTreeHeatmapItem&) = delete;
235
236 vtkMTimeType TreeHeatmapBuildTime;
237};
238
239VTK_ABI_NAMESPACE_END
240#endif
Class for drawing 2D primitives to a graphical context.
vtkContextItem()=default
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:108
Hold a reference to a vtkObjectBase instance.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:169
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.
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.
vtkDendrogramItem * GetColumnDendrogram()
Get/Set the column dendrogram contained by this item.
float GetTreeLineWidth()
Get/Set how wide the edges of the trees should be.
void SetColumnDendrogram(vtkDendrogramItem *dendrogram)
Get/Set the column dendrogram contained by this item.
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:156
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:322
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)