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

tree layout strategy reminiscent of astronomical systems More...

#include <vtkCosmicTreeLayoutStrategy.h>

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

Public Types

typedef vtkGraphLayoutStrategy Superclass
- Public Types inherited from vtkGraphLayoutStrategy
typedef vtkObject Superclass
- Public Types inherited from vtkObject
typedef vtkObjectBase 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 ()
- Public Member Functions inherited from vtkGraphLayoutStrategy
virtual void SetGraph (vtkGraph *graph)
virtual void Initialize ()
virtual int IsLayoutComplete ()
virtual void SetWeightEdges (bool state)
virtual bool GetWeightEdges ()
virtual void SetEdgeWeightField (const char *field)
virtual char * GetEdgeWeightField ()
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
virtual void DebugOff ()
unsigned char GetDebug ()
void SetDebug (unsigned char 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)
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 &os)
virtual void PrintHeader (ostream &os, vtkIndent indent)
virtual void PrintTrailer (ostream &os, vtkIndent indent)
int GetReferenceCount ()

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 Member Functions inherited from vtkGraphLayoutStrategy
 vtkGraphLayoutStrategy ()
 ~vtkGraphLayoutStrategy ()
- 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 &os)
virtual void ReportReferences (vtkGarbageCollector *)
 vtkObjectBase (const vtkObjectBase &)
void operator= (const vtkObjectBase &)

Protected Attributes

int SizeLeafNodesOnly
int LayoutDepth
vtkIdType LayoutRoot
char * NodeSizeArrayName
- Protected Attributes inherited from vtkGraphLayoutStrategy
vtkGraphGraph
char * EdgeWeightField
bool WeightEdges
- Protected Attributes inherited from vtkObject
unsigned char Debug
vtkTimeStamp MTime
vtkSubjectHelper * SubjectHelper
- Protected Attributes inherited from vtkObjectBase
int ReferenceCount
vtkWeakPointerBase ** WeakPointers

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.

Member Typedef Documentation

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 ( )
protectedvirtual

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
numVerticesThe number of vertices on the tree.
initialValueThe starting value of each node's radius. Only used when inputRadii is NULL.
inputRadiiEither NULL or the address of another array to be copied into the output array
Return values
Thearray 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
numVerticesThe number of vertices on the tree.
Return values
Thearray of node scale factors to be set on the output

Member Data Documentation

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.


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