PlotNode

Bounding Boxes

Legend for the drawing below:

**** - Self sigma BB.
~~~~ - Self pad box
#### - Self width and depth.
.... - All children
++++ - Child[n] sigma BB.

i.e. For a child its ++++ is equivalent to my ****.

D - Self datum point. S - Self plot datum point. x[n] - Child datum point. Pl - Parent landing point to self. Pt - Parent take-off point from self. P[n] - Self take off point and landing point to child n. pl[n] - Child n landing point from self. pt[n] - Child n take-off point to self. tdc - Top dead centre.

Box .... has depth of max(Boxes(++++).width) and width max(Box(~~~~), sum(Boxes(++++).depth)).

Each instance of class knows about the following: Boxes:

* ``****`` - Self sigma BB as computed Dim() objects: self.bbSigmaDepth and self.bbSigmaWidth. Or as computed Box() object self.bbSigma
* ``~~~~`` - As computed Dim() objects: self.bbSelfWidth, self.bbSelfDepth
* ``####`` - Self width and depth as Dim() objects: self.width and self.depth
* ``....`` - All children as a Box() object: self.bbChildren

And padding between ~~~~ and .... as Dim() object self.bbSpaceChildren

i.e. not ++++ - Child[n] sigma BB. That the caller knows about its children.

Points: Given D each instance of this class knows: S, Pl, Pt, P[0] to P[N-1], x[0], tdc (only).

In the following diagrams where lines are adjacent that means that there is no spacing between them.

-|-----> x increases
 |
 |
\/
y increases

D ***************************************************************************
*                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     *
*                ~                                    ~                     *
*                ~    S ### Pl ###tdc### Pt ######    ~                     *
*                ~    #                          #    ~                     *
*                ~    #                          #    ~                     *
*                ~    #                          #    ~                     *
*                ~    #                          #    ~                     *
*                ~    ## P[0] ## P[c] ## P[C-1] ##    ~                     *
*                ~                                    ~                     *
*                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     *
*                                        |                                  *
*                                        |= self._bbSpaceChildren           *
*                                        |                                  *
*...........................................................................*
*.x[0] + pl[0] + pt[0] +x[c] + pl[c] + pt[c] ++++++++++++x[C-1]+pl/pt[C-1]+.*
*.+                    ++                               ++                +.*
*.+                    ++                               ++                +.*
*.+++++++++++++++++++++++                               ++                +.*
*.                      +                               ++                +.*
*.                      +                               +++++++++++++++++++.*
*.                      +                               +                  .*
*.                      +++++++++++++++++++++++++++++++++                  .*
*...........................................................................*
*****************************************************************************

Note: .... can be narrower than ~~~~

Verticies

The following show root at the left. Linking parent to child:

                    PC_land    PC_stop
                     |            |
                     x>>>>>>>>>>>>x
                    /
                   /
    x>>>>>>>>>>>>x/
    |            |
PC_roll        PC_to

PC_roll and PC_to are determined by the parent. PC_land and PC_stop are determined by the child.

And child to parent:

CP_stop     CP_land
    |          |
    x<<<<<<<<<<x                                                                  x<<<<<<<<<<<<x
                   |            |
                CP_to        CP_roll

CP_roll and CP_to are determined by the child. CP_land and CP_stop are determined by the parent.

exception cpip.plot.PlotNode.ExceptionPlotNode

Exception when handling PlotNodeBbox object.

class cpip.plot.PlotNode.PlotNodeBbox

This is a class that can hold the width and depth of an object and the bounding box of self and the children. This can then compute various dimensions of self and children.

bbChildren

The bounding box of children as a Coord.Box() or None. i.e. the box ....

bbChildrenDepth

The bounding box depth of children as a Coord.Dim() or None. i.e. the depth of box ....

bbChildrenWidth

The bounding box width of children as a Coord.Dim() or None. i.e. the width of box ....

bbSelfDepth

The depth of self plus padding as a Coord.Dim(). i.e. the depth of box ~~~~

bbSelfPadding

The immediate padding around self as a Coord.Pad().

bbSelfWidth

The width of self plus padding as a Coord.Dim() or None. i.e. the width of box ~~~~

bbSigma

Bounding box of self and my children as a Coord.Box().

bbSigmaDepth

The depth of self+children as a Coord.Dim() or None in the case that I don’t exist and I have no children. i.e. the depth of box ****

bbSigmaWidth

The depth of self+children as a Coord.Dim() or None in the case that I don’t exist and I have no children. i.e. the width of box ****

bbSpaceChildren

The additional distance to give to the children as a Coord.Dim().

box

The Coord.Box() of ####.

childBboxDatum(theDatum)

The point x[0] as a Coord.Pt() given theDatum as Coord.Pt() or None if no children.

depth

The immediate depth of the node, if None then no BB depth or bbSpaceChildrend is allocated. i.e. the depth of box ####

extendChildBbox(theChildBbox)

Extends the child bounding box by the amount theChildBbox which should be a Coord.Box(). This extends the .... line.

hasSetArea

Returns True if width and depth are set, False otherwise.

plotPointCentre(theLd)

Returns the logical point at the centre of the box shown as #### above.

plotPointSelf(theDatum)

The point S as a Coord.Pt() given theDatum as Coord.Pt().

width

The immediate width of the node, if None then no BB width is allocated. i.e. the width of box ####

class cpip.plot.PlotNode.PlotNodeBboxBoxy

Sub-class parent child edges that contact the corners of the box shown as #### above.

cpLand(theLd, childIndex)

The me-as-parent-from-child landing point given the logical datum as a Coord.Pt.

cpRoll(theLd)

The me-as-child-to-parent start point given the logical datum as a Coord.Pt.

cpStop(theLd, childIndex)

The me-as-parent-from-child stop point given the logical datum as a Coord.Pt.

cpTo(theLd)

The me-as-child-to-parent take off point given the logical datum as a Coord.Pt.

pcLand(theLd)

The parent-to-me-as-child landing point given the logical datum as a Coord.Pt.

pcRoll(theDatum, childIndex)

The me-as-parent-to-child logical start point given the logical datum as a Coord.Pt and the child ordinal. This gives equispaced points along the lower edge.

pcStop(theLd)

The parent-to-me-as-child stop point given the logical datum as a Coord.Pt.

pcTo(theDatum, childIndex)

The me-as-parent-to-child logical take off point given the logical datum as a Coord.Pt ind the child ordinal. This gives equispaced points along the lower edge.

class cpip.plot.PlotNode.PlotNodeBboxRoundy

Sub-class for parent child edges that contact the centre of the box shown as #### above.

cpLand(theDatumL, childIndex)

The me-as-parent-from-child landing point given the logical datum as a Coord.Pt.

cpRoll(theDatumL)

The me-as-child-to-parent start point given the logical datum as a Coord.Pt.

cpStop(theDatumL, childIndex)

The me-as-parent-from-child stop point given the logical datum as a Coord.Pt.

cpTo(theDatumL)

The me-as-child-to-parent take off point given the logical datum as a Coord.Pt.

pcLand(theDatumL)

The parent-to-me-as-child landing point given the logical datum as a Coord.Pt.

pcRoll(theDatumL, childIndex)

The me-as-parent-to-child logical start point given the logical datum as a Coord.Pt ind the child ordinal. This gives equispaced points along the lower edge.

pcStop(theDatumL)

The parent-to-me-as-child stop point given the logical datum as a Coord.Pt.

pcTo(theDatumL, childIndex)

The me-as-parent-to-child logical take off point given the logical datum as a Coord.Pt ind the child ordinal. This gives equispaced points along the lower edge.

Table Of Contents

Previous topic

Coord

Next topic

SVGWriter

This Page