Provides a means of reinterpreting the coordinate system when plotting trees so that the the tree root can be top/left/bottom/right and the child order plotted anticlockwise or clockwise.
This can convert ‘logical’ positions into ‘physical’ positions. Where a ‘logical’ position is one with the root of the tree at the top and the child nodes below in lefttoright (i.e. anticlockwise) order. A ‘physical’ position is a plotable position where the root of the tree is top/left/bottom or right and the child nodes are in anticlockwise or clockwise order.
If the first suffix is ‘l’ this is the “logical” coordinate system. If the first suffix is ‘p’ this is the “physical” coordinate system.
Then:
C The canvas dimension, Cpw is "Canvas physical width"
W Width dimension, physical and logical.
D Depth dimension, physical and logical.
B Box datum position ("topleft"), physical and logical, x and y.
P Arbitrary point, physical and logical, x and y.
So this “logical view” of the tree graph (‘top’ and ‘‘): i.e. Root(s) is a top and children are written in an anticlockwise.
> x

\/
y
< Clw >
 To Parent
 
 Blx, Bly >*************************
 *  *
Cld * Dl *
 *< Wl >*
 *  *
 Plx, Ply >. *  *
 *************************
   
 To C[0] To C[c] To C[C1]
Or:
Origin  Cpw  Cpd  Wp  Dp  Bpx  Bpy  Ppx  Ppy 

top  Clw  Cld  Wl  Dl  Blx  Bly  Plx  Ply 
left  Cld  Clw  Dl  Wl  Bly  (ClwPlxWl)  Ply  ClwPlx 
bottom  Clw  Cld  Wl  Dl  (ClwPlxWl)  (CldPlyDl)  ClwPlx  CldPly 
right  Cld  Clw  Dl  Wl  (CldPlyDl)  Blx  CldPly  Plx 
Note the diagonal topright to bottomleft transference between each pair of columns. That is because with each successive line we are doing a 90 degree rotation (anticlockwise) plus a +ve y translation by Clw (top>left or bottom>right) or Cld (left>bottom or right>top).
Moving from one child to another is done in the following combinations:
Origin  ‘‘  ‘+’ 

top  right  left 
left  up  down 
bottom  left  right 
right  down  up 
Exception class for TreePlotTransform.
Exception class for out of range input on construction.
Provides a means of reinterpreting the coordinate system when plotting trees.
rootPosition = frozenset([‘top’, ‘bottom’, ‘left’, ‘right’]) default: ‘top’
sweepDirection = frozenset([‘+’, ‘‘]) default: ‘‘
Has functionality for interpreting width/depth to actual postions given rootPostion.
Given a logical datum (logical top left) and a logical box this returns logical bottom dead centre of a box.
Given a logical datum (logical top left) and a logical box this returns physical bottom dead centre of a box.
Given a logical point and logical box this returns a physical point that is the box datum (“upper left”).
Given a logical box this returns a Coord.Box that describes the physical box.
Returns a Coord.Box that describes the physical canvass.
Yield all possible root positions.
Yield all possible root positions.
Given a child physical datum point and a distance to next child this returns the next childs physical datum point. TODO: Remove this as redundant?
Given a logical datum (logical top left) and a logical box this returns logical ‘next’ dead centre of a box.
True if positive sweep, false otherwise.
Postincrempents the child logical datum point (‘topleft’) given the child logical datum point and the child.bbSigma. Returns a Coord.Pt(). This takes into account the sweep direction.
Preincrempents the child logical datum point (‘topleft’) given the child logical datum point and the child.bbSigma. Returns a Coord.Pt(). This takes into account the sweep direction.
Given a logical datum (logical top left) and a logical box this returns logical ‘previous’ dead centre of a box.
Given an arbitrary logical point as a Coord.Pt(), this returns the physical point as a Coord.Pt(). If units is supplied then the return value will be in those units.
Returns the starting child logical datum point (‘topleft’) given the children logical datum point and the children.bbSigma. Returns a Coord.Pt(). This takes into account the sweep direction.
Given a logical datum (logical top left) and a logical box this returns logical top dead centre of a box.
Given a logical datum (logical top left) and a logical box this returns physical top dead centre of a box.