VTK
|
A 2D graphics item for rendering a tree and an associated heatmap. More...
#include <vtkTreeHeatmapItem.h>
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.
Reimplemented from vtkContextItem.
Definition at line 61 of file vtkTreeHeatmapItem.h.
vtkTreeHeatmapItem::vtkTreeHeatmapItem | ( | ) | [protected] |
vtkTreeHeatmapItem::~vtkTreeHeatmapItem | ( | ) | [protected] |
static vtkTreeHeatmapItem* vtkTreeHeatmapItem::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
static int vtkTreeHeatmapItem::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkContextItem.
virtual int vtkTreeHeatmapItem::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkContextItem.
static vtkTreeHeatmapItem* vtkTreeHeatmapItem::SafeDownCast | ( | vtkObjectBase * | o | ) | [static] |
Reimplemented from vtkContextItem.
virtual vtkObjectBase* vtkTreeHeatmapItem::NewInstanceInternal | ( | ) | const [protected, virtual] |
Reimplemented from vtkContextItem.
Reimplemented from vtkContextItem.
virtual void vtkTreeHeatmapItem::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkContextItem.
virtual void vtkTreeHeatmapItem::SetTree | ( | vtkTree * | tree | ) | [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.
Get the tree that this item draws.
virtual void vtkTreeHeatmapItem::SetTable | ( | vtkTable * | table | ) | [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.
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.
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 bool vtkTreeHeatmapItem::Hit | ( | const vtkContextMouseEvent & | mouse | ) | [virtual] |
Returns true if the transform is interactive, false otherwise.
Reimplemented from vtkAbstractContextItem.
virtual bool vtkTreeHeatmapItem::MouseMoveEvent | ( | const vtkContextMouseEvent & | event | ) | [virtual] |
Display a tooltip when the user mouses over a cell in the heatmap.
Reimplemented from vtkAbstractContextItem.
virtual bool vtkTreeHeatmapItem::MouseDoubleClickEvent | ( | const vtkContextMouseEvent & | event | ) | [virtual] |
Collapse or expand a subtree when the user double clicks on an internal node.
Reimplemented from vtkAbstractContextItem.
virtual void vtkTreeHeatmapItem::RebuildBuffers | ( | ) | [protected, virtual] |
Generate some data needed for painting. We cache this information as it only needs to be generated when the input data changes.
virtual void vtkTreeHeatmapItem::PaintBuffers | ( | vtkContext2D * | painter | ) | [protected, virtual] |
This function does the bulk of the actual work in rendering our tree & heatmap data.
virtual bool vtkTreeHeatmapItem::IsDirty | ( | ) | [protected, virtual] |
This function returns a bool indicating whether or not we need to rebuild our cached data before painting.
void vtkTreeHeatmapItem::ComputeMultipliers | ( | ) | [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.
void vtkTreeHeatmapItem::ComputeTreeBounds | ( | ) | [protected] |
Compute the bounds of our tree in pixel coordinates.
void vtkTreeHeatmapItem::InitializeLookupTables | ( | ) | [protected] |
Generate a separate vtkLookupTable for each column in the table.
virtual bool vtkTreeHeatmapItem::Paint | ( | vtkContext2D * | painter | ) | [protected, virtual] |
Paints the tree & associated table as a heatmap.
Reimplemented from vtkAbstractContextItem.
void vtkTreeHeatmapItem::GenerateLookupTableForStringColumn | ( | vtkIdType | column | ) | [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.
void vtkTreeHeatmapItem::PaintHeatmapWithoutTree | ( | vtkContext2D * | painter | ) | [protected] |
Draw the heatmap when no corresponding tree is present.
bool vtkTreeHeatmapItem::SetupTextProperty | ( | vtkContext2D * | painter | ) | [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.
std::string vtkTreeHeatmapItem::GetTooltipText | ( | float | x, |
float | y | ||
) | [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.
void vtkTreeHeatmapItem::CountLeafNodes | ( | ) | [protected] |
Count the number of leaf nodes in the tree
int vtkTreeHeatmapItem::CountLeafNodes | ( | vtkIdType | vertex | ) | [protected] |
Count the number of leaf nodes that descend from a given vertex.
vtkIdType vtkTreeHeatmapItem::GetClosestVertex | ( | double | x, |
double | y | ||
) | [protected] |
Get the tree vertex closest to the specified coordinates.
void vtkTreeHeatmapItem::CollapseSubTree | ( | vtkIdType | vertex | ) | [protected] |
Collapse the subtree rooted at vertex.
void vtkTreeHeatmapItem::ExpandSubTree | ( | vtkIdType | vertex | ) | [protected] |
Expand the previously collapsed subtree rooted at vertex.
vtkIdType vtkTreeHeatmapItem::GetOriginalId | ( | vtkIdType | vertex | ) | [protected] |
Look up the original ID of a vertex in the pruned tree.
vtkIdType vtkTreeHeatmapItem::GetPrunedIdForOriginalId | ( | vtkIdType | originalId | ) | [protected] |
Look up the ID of a vertex in the pruned tree from a vertex ID of the input tree.
vtkIdType vtkTreeHeatmapItem::GetClickedCollapsedSubTree | ( | double | x, |
double | y | ||
) | [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.
void vtkTreeHeatmapItem::UpdateVisibleSceneExtent | ( | vtkContext2D * | painter | ) | [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.
bool vtkTreeHeatmapItem::LineIsVisible | ( | double | x0, |
double | y0, | ||
double | x1, | ||
double | y1 | ||
) | [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.