VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
vtkTreeHeatmapItem Class Reference

A 2D graphics item for rendering a tree and an associated heatmap. More...

#include <vtkTreeHeatmapItem.h>

Inheritance diagram for vtkTreeHeatmapItem:
Inheritance graph
[legend]
Collaboration diagram for vtkTreeHeatmapItem:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkContextItem Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkTreeHeatmapItemNewInstance () const
virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual void SetTree (vtkTree *tree)
vtkTreeGetTree ()
virtual void SetTable (vtkTable *table)
vtkTableGetTable ()
void CollapseToNumberOfLeafNodes (unsigned int n)
vtkTreeGetPrunedTree ()
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 vtkTreeHeatmapItemNew ()
static int IsTypeOf (const char *type)
static vtkTreeHeatmapItemSafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () 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)

Detailed Description

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

Tests:
vtkTreeHeatmapItem (Tests)

Definition at line 57 of file vtkTreeHeatmapItem.h.


Member Typedef Documentation

Reimplemented from vtkContextItem.

Definition at line 61 of file vtkTreeHeatmapItem.h.


Constructor & Destructor Documentation


Member Function Documentation

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.

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.

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.

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.

Compute the bounds of our tree in pixel coordinates.

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.

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.

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

Count the number of leaf nodes that descend from a given vertex.

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.

Look up the original ID of a vertex in the pruned tree.

Look up the ID of a vertex in the pruned tree from a vertex ID of the input tree.

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.

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.


The documentation for this class was generated from the following file: