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();
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:
195  ~vtkTreeHeatmapItem() override;
196 
200  bool Paint(vtkContext2D* painter) override;
201 
205  void CollapseHeatmapRows();
206 
210  void CollapseHeatmapColumns();
211 
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
void GetBounds(T a, double bds[6])
vtkSmartPointer< vtkDendrogramItem > Dendrogram
A 2D graphics item for rendering a tree as a dendrogram.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
base class for items that are part of a vtkContextScene.
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
A 2D graphics item for rendering a heatmap.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:58
vtkSmartPointer< vtkHeatmapItem > Heatmap
virtual bool Hit(const vtkContextMouseEvent &mouse)
Return true if the supplied x, y coordinate is inside the item.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkSmartPointer< vtkDendrogramItem > ColumnDendrogram
A rooted tree data structure.
Definition: vtkTree.h:45
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse)
Mouse button double click event.
A 2D graphics item for rendering a tree and an associated heatmap.