#include <vtkCosmicTreeLayoutStrategy.h>
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.
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 () |
vtkDoubleArray * | CreateRadii (vtkIdType numVertices, double initialValue, vtkDataArray *inputRadii) |
vtkDoubleArray * | CreateScaleFactors (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 |
Reimplemented from vtkGraphLayoutStrategy.
Definition at line 47 of file vtkCosmicTreeLayoutStrategy.h.
enum vtkCosmicTreeLayoutStrategy::RadiusMode [protected] |
How are node sizes specified?
Definition at line 96 of file vtkCosmicTreeLayoutStrategy.h.
vtkCosmicTreeLayoutStrategy::vtkCosmicTreeLayoutStrategy | ( | ) | [protected] |
virtual vtkCosmicTreeLayoutStrategy::~vtkCosmicTreeLayoutStrategy | ( | ) | [protected, virtual] |
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.
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 |
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.
numVertices | The number of vertices on the tree. |
The | array of node scale factors to be set on the output |
int vtkCosmicTreeLayoutStrategy::SizeLeafNodesOnly [protected] |
Definition at line 142 of file vtkCosmicTreeLayoutStrategy.h.
int vtkCosmicTreeLayoutStrategy::LayoutDepth [protected] |
Definition at line 143 of file vtkCosmicTreeLayoutStrategy.h.
vtkIdType vtkCosmicTreeLayoutStrategy::LayoutRoot [protected] |
Definition at line 144 of file vtkCosmicTreeLayoutStrategy.h.
char* vtkCosmicTreeLayoutStrategy::NodeSizeArrayName [protected] |
Definition at line 145 of file vtkCosmicTreeLayoutStrategy.h.