VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkTanglegramItem Class Reference

Display two related trees. More...

#include <vtkTanglegramItem.h>

Inheritance diagram for vtkTanglegramItem:
[legend]
Collaboration diagram for vtkTanglegramItem:
[legend]

Public Types

typedef vtkContextItem Superclass
 
- Public Types inherited from vtkContextItem
typedef vtkAbstractContextItem Superclass
 
- Public Types inherited from vtkAbstractContextItem
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkTanglegramItemNewInstance () const
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void SetTree1 (vtkTree *tree)
 
virtual void SetTree2 (vtkTree *tree)
 
void SetOrientation (int orientation)
 
int GetOrientation ()
 
virtual bool Hit (const vtkContextMouseEvent &mouse)
 
virtual bool MouseDoubleClickEvent (const vtkContextMouseEvent &event)
 
vtkTableGetTable ()
 
void SetTable (vtkTable *table)
 
virtual char * GetTree1Label ()
 
virtual void SetTree1Label (const char *)
 
virtual char * GetTree2Label ()
 
virtual void SetTree2Label (const char *)
 
virtual int GetMinimumVisibleFontSize ()
 
virtual void SetMinimumVisibleFontSize (int)
 
virtual int GetLabelSizeDifference ()
 
virtual void SetLabelSizeDifference (int)
 
virtual float GetCorrespondenceLineWidth ()
 
virtual void SetCorrespondenceLineWidth (float)
 
float GetTreeLineWidth ()
 
void SetTreeLineWidth (float width)
 
- Public Member Functions inherited from vtkContextItem
vtkContextItemNewInstance () const
 
virtual double GetOpacity ()
 
virtual void SetOpacity (double)
 
- Public Member Functions inherited from vtkAbstractContextItem
vtkAbstractContextItemNewInstance () const
 
virtual void Update ()
 
virtual bool PaintChildren (vtkContext2D *painter)
 
virtual void ReleaseGraphicsResources ()
 
unsigned int AddItem (vtkAbstractContextItem *item)
 
bool RemoveItem (vtkAbstractContextItem *item)
 
bool RemoveItem (unsigned int index)
 
vtkAbstractContextItemGetItem (unsigned int index)
 
unsigned int GetItemIndex (vtkAbstractContextItem *item)
 
unsigned int GetNumberOfItems ()
 
void ClearItems ()
 
unsigned int Raise (unsigned int index)
 
unsigned int Lower (unsigned int index)
 
virtual vtkAbstractContextItemGetPickedItem (const vtkContextMouseEvent &mouse)
 
virtual bool MouseEnterEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseMoveEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseLeaveEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseButtonPressEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseButtonReleaseEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseWheelEvent (const vtkContextMouseEvent &mouse, int delta)
 
virtual bool KeyPressEvent (const vtkContextKeyEvent &key)
 
virtual void SetScene (vtkContextScene *scene)
 
virtual void SetParent (vtkAbstractContextItem *parent)
 
virtual vtkVector2f MapToParent (const vtkVector2f &point)
 
virtual vtkVector2f MapFromParent (const vtkVector2f &point)
 
virtual vtkVector2f MapToScene (const vtkVector2f &point)
 
virtual vtkVector2f MapFromScene (const vtkVector2f &point)
 
virtual unsigned int StackAbove (unsigned int index, unsigned int under)
 
virtual unsigned int StackUnder (unsigned int child, unsigned int above)
 
virtual bool KeyReleaseEvent (const vtkContextKeyEvent &key)
 
vtkContextSceneGetScene ()
 
vtkAbstractContextItemGetParent ()
 
virtual bool GetVisible ()
 
virtual void SetVisible (bool)
 
virtual bool GetInteractive ()
 
virtual void SetInteractive (bool)
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkTanglegramItemNew ()
 
static int IsTypeOf (const char *type)
 
static vtkTanglegramItemSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkContextItem
static int IsTypeOf (const char *type)
 
static vtkContextItemSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkAbstractContextItem
static int IsTypeOf (const char *type)
 
static vtkAbstractContextItemSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkTanglegramItem ()
 
 ~vtkTanglegramItem ()
 
void RefreshBuffers (vtkContext2D *painter)
 
void PositionTree2 ()
 
void PaintCorrespondenceLines (vtkContext2D *painter)
 
void PaintTreeLabels (vtkContext2D *painter)
 
void ReorderTree ()
 
void ReorderTreeAtVertex (vtkIdType parent, vtkTree *tree)
 
double GetPositionScoreForVertex (vtkIdType vertex, vtkTree *tree)
 
void GenerateLookupTable ()
 
virtual bool Paint (vtkContext2D *painter)
 
- Protected Member Functions inherited from vtkContextItem
 vtkContextItem ()
 
 ~vtkContextItem ()
 
- Protected Member Functions inherited from vtkAbstractContextItem
 vtkAbstractContextItem ()
 
 ~vtkAbstractContextItem ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Protected Attributes inherited from vtkContextItem
double Opacity
 
- Protected Attributes inherited from vtkAbstractContextItem
vtkContextSceneScene
 
vtkAbstractContextItemParent
 
vtkContextScenePrivateChildren
 
bool Visible
 
bool Interactive
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Display two related trees.

This item draws two trees with connections between their leaf nodes. Use SetTable() to specify what leaf nodes correspond to one another between the two trees. See the documentation for this function for more details on how this table should be formatted.

.SEE ALSO vtkTree vtkTable vtkDendrogramItem vtkNewickTreeReader

Tests:
vtkTanglegramItem (Tests)

Definition at line 45 of file vtkTanglegramItem.h.

Member Typedef Documentation

Definition at line 49 of file vtkTanglegramItem.h.

Constructor & Destructor Documentation

vtkTanglegramItem::vtkTanglegramItem ( )
protected
vtkTanglegramItem::~vtkTanglegramItem ( )
protected

Member Function Documentation

static vtkTanglegramItem* vtkTanglegramItem::New ( )
static
static int vtkTanglegramItem::IsTypeOf ( const char *  type)
static
virtual int vtkTanglegramItem::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 vtkTanglegramItem* vtkTanglegramItem::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkTanglegramItem::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkContextItem.

vtkTanglegramItem* vtkTanglegramItem::NewInstance ( ) const
virtual void vtkTanglegramItem::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 vtkTanglegramItem::SetTree1 ( vtkTree tree)
virtual

Set the first tree

virtual void vtkTanglegramItem::SetTree2 ( vtkTree tree)
virtual

Set the second tree

vtkTable* vtkTanglegramItem::GetTable ( )

Get/Set the table that describes the correspondences between the two trees. The first column should contain the names of the leaf nodes from tree #1. The columns of this table should be named after the leaf nodes of tree #2. A non-zero cell should be used to create a connection between the two trees. Different numbers in the table will result in connections being drawn in different colors.

void vtkTanglegramItem::SetTable ( vtkTable table)

Get/Set the table that describes the correspondences between the two trees. The first column should contain the names of the leaf nodes from tree #1. The columns of this table should be named after the leaf nodes of tree #2. A non-zero cell should be used to create a connection between the two trees. Different numbers in the table will result in connections being drawn in different colors.

virtual char* vtkTanglegramItem::GetTree1Label ( )
virtual

Get/Set the label for tree #1.

virtual void vtkTanglegramItem::SetTree1Label ( const char *  )
virtual

Get/Set the label for tree #1.

virtual char* vtkTanglegramItem::GetTree2Label ( )
virtual

Get/Set the label for tree #2.

virtual void vtkTanglegramItem::SetTree2Label ( const char *  )
virtual

Get/Set the label for tree #2.

void vtkTanglegramItem::SetOrientation ( int  orientation)

Set which way the tanglegram should face within the visualization. The default is for tree #1 to be drawn left to right.

int vtkTanglegramItem::GetOrientation ( )

Get the current orientation.

virtual int vtkTanglegramItem::GetMinimumVisibleFontSize ( )
virtual

Get/Set the smallest font size that is still considered legible. If the current zoom level requires our vertex labels to be smaller than this size the labels will not be drawn at all. Default value is 8 pt.

virtual void vtkTanglegramItem::SetMinimumVisibleFontSize ( int  )
virtual

Get/Set the smallest font size that is still considered legible. If the current zoom level requires our vertex labels to be smaller than this size the labels will not be drawn at all. Default value is 8 pt.

virtual int vtkTanglegramItem::GetLabelSizeDifference ( )
virtual

Get/Set how much larger the dendrogram labels should be compared to the vertex labels. Because the vertex labels automatically resize based on zoom levels, this is a relative (not absolute) size. Default value is 4 pts larger than the vertex labels.

virtual void vtkTanglegramItem::SetLabelSizeDifference ( int  )
virtual

Get/Set how much larger the dendrogram labels should be compared to the vertex labels. Because the vertex labels automatically resize based on zoom levels, this is a relative (not absolute) size. Default value is 4 pts larger than the vertex labels.

virtual float vtkTanglegramItem::GetCorrespondenceLineWidth ( )
virtual

Get/Set how wide the correspondence lines should be. Default is two pixels.

virtual void vtkTanglegramItem::SetCorrespondenceLineWidth ( float  )
virtual

Get/Set how wide the correspondence lines should be. Default is two pixels.

float vtkTanglegramItem::GetTreeLineWidth ( )

Get/Set how wide the edges of the trees should be. Default is one pixel.

void vtkTanglegramItem::SetTreeLineWidth ( float  width)

Get/Set how wide the edges of the trees should be. Default is one pixel.

virtual bool vtkTanglegramItem::Hit ( const vtkContextMouseEvent mouse)
virtual

Returns true if the transform is interactive, false otherwise.

Reimplemented from vtkAbstractContextItem.

virtual bool vtkTanglegramItem::MouseDoubleClickEvent ( const vtkContextMouseEvent event)
virtual

Propagate any double click onto the dendrograms to check if any subtrees should be collapsed or expanded.

Reimplemented from vtkAbstractContextItem.

void vtkTanglegramItem::RefreshBuffers ( vtkContext2D painter)
protected

Update the bounds of our two dendrograms.

void vtkTanglegramItem::PositionTree2 ( )
protected

Calculate and set an appropriate position for our second dendrogram.

void vtkTanglegramItem::PaintCorrespondenceLines ( vtkContext2D painter)
protected

Draw the lines between the corresponding vertices of our two dendrograms.

void vtkTanglegramItem::PaintTreeLabels ( vtkContext2D painter)
protected

Draw the labels of our two dendrograms.

void vtkTanglegramItem::ReorderTree ( )
protected

Reorder the children of tree #2 to minimize the amount of crossings in our tanglegram.

void vtkTanglegramItem::ReorderTreeAtVertex ( vtkIdType  parent,
vtkTree tree 
)
protected

Helper function used by ReorderTree. Rearrange the children of the specified parent vertex in order to minimize tanglegram crossings.

double vtkTanglegramItem::GetPositionScoreForVertex ( vtkIdType  vertex,
vtkTree tree 
)
protected

Helper function used by ReorderTreeAtVertex. Get the average height of the vertices that correspond to the vertex parameter. This information is used to determine what order sibling vertices should have within the tree.

void vtkTanglegramItem::GenerateLookupTable ( )
protected

Initialize the lookup table used to color the lines between the two dendrograms.

virtual bool vtkTanglegramItem::Paint ( vtkContext2D painter)
protectedvirtual

Paints the tree & associated table as a heatmap.

Reimplemented from vtkAbstractContextItem.


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