vtkCosmicTreeLayoutStrategy Class Reference

#include <vtkCosmicTreeLayoutStrategy.h>

Inheritance diagram for vtkCosmicTreeLayoutStrategy:

Inheritance graph
[legend]
Collaboration diagram for vtkCosmicTreeLayoutStrategy:

Collaboration graph
[legend]

List of all members.


Detailed Description

tree layout strategy reminiscent of astronomical systems

This layout strategy takes an input tree and places all the children of a node into a containing circle. The placement is such that each child placed can be represented with a circle tangent to the containing circle and (usually) 2 other children. The interior of the circle is left empty so that graph edges drawn on top of the tree will not obfuscate the tree. However, when one child is much larger than all the others, it may encroach on the center of the containing circle; that's OK, because it's large enough not to be obscured by edges drawn atop it.

Thanks:
Thanks to the galaxy and David Thompson hierarchically nested inside it for inspiring this layout strategy.
Tests:
vtkCosmicTreeLayoutStrategy (Tests)

Definition at line 42 of file vtkCosmicTreeLayoutStrategy.h.


Public Types

typedef vtkGraphLayoutStrategy Superclass

Public Member Functions

virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual const char * GetClassName ()
virtual int IsA (const char *type)
virtual void Layout ()
virtual void SetSizeLeafNodesOnly (int)
virtual int GetSizeLeafNodesOnly ()
virtual void SizeLeafNodesOnlyOn ()
virtual void SizeLeafNodesOnlyOff ()
virtual void SetLayoutDepth (int)
virtual int GetLayoutDepth ()
virtual void SetLayoutRoot (vtkIdType)
virtual vtkIdType GetLayoutRoot ()
virtual void SetNodeSizeArrayName (const char *)
virtual char * GetNodeSizeArrayName ()

Static Public Member Functions

static
vtkCosmicTreeLayoutStrategy
New ()
static int IsTypeOf (const char *type)
static
vtkCosmicTreeLayoutStrategy
SafeDownCast (vtkObject *o)

Protected Types

enum  RadiusMode { NONE, LEAVES, ALL }
 How are node sizes specified? More...

Protected Member Functions

 vtkCosmicTreeLayoutStrategy ()
virtual ~vtkCosmicTreeLayoutStrategy ()
vtkDoubleArrayCreateRadii (vtkIdType numVertices, double initialValue, vtkDataArray *inputRadii)
vtkDoubleArrayCreateScaleFactors (vtkIdType numVertices)
void LayoutChildren (vtkTree *tree, vtkPoints *newPoints, vtkDoubleArray *radii, vtkDoubleArray *scale, vtkIdType root, int depth, RadiusMode mode)
void OffsetChildren (vtkTree *tree, vtkPoints *pts, vtkDoubleArray *radii, vtkDoubleArray *scale, double parent[4], vtkIdType root, int depth, RadiusMode mode)

Protected Attributes

int SizeLeafNodesOnly
int LayoutDepth
vtkIdType LayoutRoot
char * NodeSizeArrayName

Member Typedef Documentation

Reimplemented from vtkGraphLayoutStrategy.

Definition at line 47 of file vtkCosmicTreeLayoutStrategy.h.


Member Enumeration Documentation

How are node sizes specified?

Enumerator:
NONE  No node sizes specified... unit radius is assumed.
LEAVES  Only leaf node sizes specified... parents are calculated during layout.
ALL  All node sizes specified (overconstrained, so a scale factor for each parent is calculated during layout).

Definition at line 96 of file vtkCosmicTreeLayoutStrategy.h.


Constructor & Destructor Documentation

vtkCosmicTreeLayoutStrategy::vtkCosmicTreeLayoutStrategy (  )  [protected]

virtual vtkCosmicTreeLayoutStrategy::~vtkCosmicTreeLayoutStrategy (  )  [protected, virtual]


Member Function Documentation

static vtkCosmicTreeLayoutStrategy* vtkCosmicTreeLayoutStrategy::New (  )  [static]

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

virtual void vtkCosmicTreeLayoutStrategy::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 vtkGraphLayoutStrategy.

virtual const char* vtkCosmicTreeLayoutStrategy::GetClassName (  )  [virtual]

Reimplemented from vtkGraphLayoutStrategy.

static int vtkCosmicTreeLayoutStrategy::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 vtkGraphLayoutStrategy.

virtual int vtkCosmicTreeLayoutStrategy::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 vtkGraphLayoutStrategy.

static vtkCosmicTreeLayoutStrategy* vtkCosmicTreeLayoutStrategy::SafeDownCast ( vtkObject o  )  [static]

Reimplemented from vtkGraphLayoutStrategy.

virtual void vtkCosmicTreeLayoutStrategy::Layout (  )  [virtual]

Perform the layout.

Implements vtkGraphLayoutStrategy.

virtual void vtkCosmicTreeLayoutStrategy::SetSizeLeafNodesOnly ( int   )  [virtual]

Should node size specifications be obeyed at leaf nodes only or (with scaling as required to meet constraints) at every node in the tree? This defaults to true, so that leaf nodes are scaled according to the size specification provided, and the parent node sizes are calculated by the algorithm.

virtual int vtkCosmicTreeLayoutStrategy::GetSizeLeafNodesOnly (  )  [virtual]

Should node size specifications be obeyed at leaf nodes only or (with scaling as required to meet constraints) at every node in the tree? This defaults to true, so that leaf nodes are scaled according to the size specification provided, and the parent node sizes are calculated by the algorithm.

virtual void vtkCosmicTreeLayoutStrategy::SizeLeafNodesOnlyOn (  )  [virtual]

Should node size specifications be obeyed at leaf nodes only or (with scaling as required to meet constraints) at every node in the tree? This defaults to true, so that leaf nodes are scaled according to the size specification provided, and the parent node sizes are calculated by the algorithm.

virtual void vtkCosmicTreeLayoutStrategy::SizeLeafNodesOnlyOff (  )  [virtual]

Should node size specifications be obeyed at leaf nodes only or (with scaling as required to meet constraints) at every node in the tree? This defaults to true, so that leaf nodes are scaled according to the size specification provided, and the parent node sizes are calculated by the algorithm.

virtual void vtkCosmicTreeLayoutStrategy::SetLayoutDepth ( int   )  [virtual]

How many levels of the tree should be laid out? For large trees, you may wish to set the root and maximum depth in order to retrieve the layout for the visible portion of the tree. When this value is zero or negative, all nodes below and including the LayoutRoot will be presented. This defaults to 0.

virtual int vtkCosmicTreeLayoutStrategy::GetLayoutDepth (  )  [virtual]

How many levels of the tree should be laid out? For large trees, you may wish to set the root and maximum depth in order to retrieve the layout for the visible portion of the tree. When this value is zero or negative, all nodes below and including the LayoutRoot will be presented. This defaults to 0.

virtual void vtkCosmicTreeLayoutStrategy::SetLayoutRoot ( vtkIdType   )  [virtual]

What is the top-most tree node to lay out? This node will become the largest containing circle in the layout. Use this in combination with SetLayoutDepth to retrieve the layout of a subtree of interest for rendering. Setting LayoutRoot to a negative number signals that the root node of the tree should be used as the root node of the layout. This defaults to -1.

virtual vtkIdType vtkCosmicTreeLayoutStrategy::GetLayoutRoot (  )  [virtual]

What is the top-most tree node to lay out? This node will become the largest containing circle in the layout. Use this in combination with SetLayoutDepth to retrieve the layout of a subtree of interest for rendering. Setting LayoutRoot to a negative number signals that the root node of the tree should be used as the root node of the layout. This defaults to -1.

virtual void vtkCosmicTreeLayoutStrategy::SetNodeSizeArrayName ( const char *   )  [virtual]

Set the array to be used for sizing nodes. If this is set to an empty string or NULL (the default), then all leaf nodes (or all nodes, when SizeLeafNodesOnly is false) will be assigned a unit size.

virtual char* vtkCosmicTreeLayoutStrategy::GetNodeSizeArrayName (  )  [virtual]

Set the array to be used for sizing nodes. If this is set to an empty string or NULL (the default), then all leaf nodes (or all nodes, when SizeLeafNodesOnly is false) will be assigned a unit size.

void vtkCosmicTreeLayoutStrategy::LayoutChildren ( vtkTree tree,
vtkPoints newPoints,
vtkDoubleArray radii,
vtkDoubleArray scale,
vtkIdType  root,
int  depth,
RadiusMode  mode 
) [protected]

Recursive routine used to lay out tree nodes. Called from Layout().

void vtkCosmicTreeLayoutStrategy::OffsetChildren ( vtkTree tree,
vtkPoints pts,
vtkDoubleArray radii,
vtkDoubleArray scale,
double  parent[4],
vtkIdType  root,
int  depth,
RadiusMode  mode 
) [protected]

Recursive routine that adds each parent node's (x,y) position to its children. This must be done only after all the children have been laid out at the origin since we will not know the parent's position until after the child radii have been determined.

vtkDoubleArray* vtkCosmicTreeLayoutStrategy::CreateRadii ( vtkIdType  numVertices,
double  initialValue,
vtkDataArray inputRadii 
) [protected]

Create an array to hold radii, named appropriately (depends on NodeSizeArrayName) and initialized to either (a) -1.0 for each node or (b) a deep copy of an existing array.

Parameters:
numVertices The number of vertices on the tree.
initialValue The starting value of each node's radius. Only used when inputRadii is NULL.
inputRadii Either NULL or the address of another array to be copied into the output array
Return values:
The array of node radii to be set on the output

vtkDoubleArray* vtkCosmicTreeLayoutStrategy::CreateScaleFactors ( vtkIdType  numVertices  )  [protected]

Create an array to hold scale factors, named appropriately (depends on NodeSizeArrayName) and initialized to -1.0.

Parameters:
numVertices The number of vertices on the tree.
Return values:
The array of node scale factors to be set on the output


Member Data Documentation

Definition at line 142 of file vtkCosmicTreeLayoutStrategy.h.

Definition at line 143 of file vtkCosmicTreeLayoutStrategy.h.

Definition at line 144 of file vtkCosmicTreeLayoutStrategy.h.

Definition at line 145 of file vtkCosmicTreeLayoutStrategy.h.


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

Generated on Mon Sep 27 18:20:58 2010 for VTK by  doxygen 1.5.6