A 2D graphics item for rendering a tree and an associated heatmap. More...
#include <vtkTreeHeatmapItem.h>
Inherits vtkContextItem.
Public Types | |
typedef vtkContextItem | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkTreeHeatmapItem * | NewInstance () const |
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
virtual void | SetTree (vtkTree *tree) |
vtkTree * | GetTree () |
virtual void | SetTable (vtkTable *table) |
vtkTable * | GetTable () |
void | CollapseToNumberOfLeafNodes (unsigned int n) |
vtkTree * | GetPrunedTree () |
void | SetTreeColorArray (const char *arrayName) |
virtual bool | Hit (const vtkContextMouseEvent &mouse) |
virtual bool | MouseMoveEvent (const vtkContextMouseEvent &event) |
virtual bool | MouseDoubleClickEvent (const vtkContextMouseEvent &event) |
Static Public Member Functions | |
static vtkTreeHeatmapItem * | New () |
static int | IsTypeOf (const char *type) |
static vtkTreeHeatmapItem * | SafeDownCast (vtkObjectBase *o) |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
vtkTreeHeatmapItem () | |
~vtkTreeHeatmapItem () | |
virtual void | RebuildBuffers () |
virtual void | PaintBuffers (vtkContext2D *painter) |
virtual bool | IsDirty () |
void | ComputeMultipliers () |
void | ComputeTreeBounds () |
void | InitializeLookupTables () |
virtual bool | Paint (vtkContext2D *painter) |
void | GenerateLookupTableForStringColumn (vtkIdType column) |
void | PaintHeatmapWithoutTree (vtkContext2D *painter) |
bool | SetupTextProperty (vtkContext2D *painter) |
std::string | GetTooltipText (float x, float y) |
void | CountLeafNodes () |
int | CountLeafNodes (vtkIdType vertex) |
vtkIdType | GetClosestVertex (double x, double y) |
void | CollapseSubTree (vtkIdType vertex) |
void | ExpandSubTree (vtkIdType vertex) |
vtkIdType | GetOriginalId (vtkIdType vertex) |
vtkIdType | GetPrunedIdForOriginalId (vtkIdType originalId) |
vtkIdType | GetClickedCollapsedSubTree (double x, double y) |
void | UpdateVisibleSceneExtent (vtkContext2D *painter) |
bool | LineIsVisible (double x0, double y0, double x1, double y1) |
A 2D graphics item for rendering a tree and an associated heatmap.
This item draws a tree and a heatmap as a part of a vtkContextScene. The input tree's vertex data must contain at least two arrays. The first required array is a vtkStringArray called "node name". This array corresponds to the first column of the input table. The second required array is a scalar array called "node weight". This array is used by vtkTreeLayoutStrategy to set any particular node's distance from the root of the tree.
The vtkNewickTreeReader automatically initializes both of these required arrays in its output tree.
.SEE ALSO vtkTree vtkTable vtkNewickTreeReader
Definition at line 57 of file vtkTreeHeatmapItem.h.
typedef vtkContextItem vtkTreeHeatmapItem::Superclass |
Definition at line 61 of file vtkTreeHeatmapItem.h.
|
protected |
|
protected |
|
static |
|
static |
|
virtual |
|
static |
|
protectedvirtual |
vtkTreeHeatmapItem* vtkTreeHeatmapItem::NewInstance | ( | ) | const |
|
virtual |
|
virtual |
Set the tree that this item draws. Note that this tree's vertex data must contain a vtkStringArray called "node name". Additionally, this array must contain the same values as the first column of the input table. See SetTable for more information. The vtkNewickTreeReader automatically creates this required array for you.
vtkTree* vtkTreeHeatmapItem::GetTree | ( | ) |
Get the tree that this item draws.
|
virtual |
Set the table that this item draws. The first column of the table must contain the names of the rows. These names, in turn, must correspond with the nodes names in the input tree. See SetTree for more information.
vtkTable* vtkTreeHeatmapItem::GetTable | ( | ) |
Get the table that this item draws.
void vtkTreeHeatmapItem::CollapseToNumberOfLeafNodes | ( | unsigned int | n | ) |
Collapse subtrees until there are only n leaf nodes left in the tree. The leaf nodes that remain are those that are closest to the root. Any subtrees that were collapsed prior to this function being called may be re-expanded.
vtkTree* vtkTreeHeatmapItem::GetPrunedTree | ( | ) |
void vtkTreeHeatmapItem::SetTreeColorArray | ( | const char * | arrayName | ) |
Indicate which array within the Tree's VertexData should be used to color the tree. The specified array must be a vtkDoubleArray. By default, the tree will be drawn in black.
|
virtual |
Returns true if the transform is interactive, false otherwise.
|
virtual |
Display a tooltip when the user mouses over a cell in the heatmap.
|
virtual |
Collapse or expand a subtree when the user double clicks on an internal node.
|
protectedvirtual |
Generate some data needed for painting. We cache this information as it only needs to be generated when the input data changes.
|
protectedvirtual |
This function does the bulk of the actual work in rendering our tree & heatmap data.
|
protectedvirtual |
This function returns a bool indicating whether or not we need to rebuild our cached data before painting.
|
protected |
Compute how to scale our data so that text labels will fit within the bounds determined by the table's cells or the spacing between the leaf nodes of the tree.
|
protected |
Compute the bounds of our tree in pixel coordinates.
|
protected |
Generate a separate vtkLookupTable for each column in the table.
|
protectedvirtual |
Paints the tree & associated table as a heatmap.
|
protected |
Helper function. Generates a vtkLookupTable for a Table column that contains only strings. Each string will be assigned a separate color. This is useful for visualizing categorical data.
|
protected |
Draw the heatmap when no corresponding tree is present.
|
protected |
Initialize a vtkTextProperty for drawing labels. This involves calculating an appropriate font size so that labels will fit within the specified cell size. Returns FALSE if the text would be too small to easily read; TRUE otherwise.
|
protected |
Get the value for the cell of the heatmap located at scene position (x, y) This function assumes the caller has already determined that (x, y) falls within the heatmap.
|
protected |
Count the number of leaf nodes in the tree
|
protected |
Count the number of leaf nodes that descend from a given vertex.
|
protected |
Get the tree vertex closest to the specified coordinates.
|
protected |
Collapse the subtree rooted at vertex.
|
protected |
Expand the previously collapsed subtree rooted at vertex.
|
protected |
Look up the original ID of a vertex in the pruned tree.
|
protected |
Look up the ID of a vertex in the pruned tree from a vertex ID of the input tree.
|
protected |
Check if the click at (x, y) should be considered as a click on a collapsed subtree. Returns the vtkIdType of the pruned subtree if so, -1 otherwise.
|
protected |
Calculate the extent of the data that is visible within the window. This information is used to ensure that we only draw details that will be seen by the user. This improves rendering speed, particularly for larger data.
|
protected |
Returns true if any part of the line segment defined by endpoints (x0, y0), (x1, y1) falls within the extent of the currently visible scene. Returns false otherwise.