public class VisitKt
| Modifier and Type | Method and Description |
|---|---|
static <D> void |
visit(Quadtree<D> $receiver,
kotlin.jvm.functions.Function5<? super io.data2viz.quadtree.QuadtreeNode<D>,? super java.lang.Double,? super java.lang.Double,? super java.lang.Double,? super java.lang.Double,java.lang.Boolean> callback)
Visits each node in the quadtree in pre-order traversal, invoking the specified callback with arguments
node, x0, y0, x1, y1 for each node, where node is the node being visited, ⟨x0, y0⟩ are the lower bounds of the
node, and ⟨x1, y1⟩ are the upper bounds.
(Assuming that positive x is right and positive y is down, as is typically the case in Canvas and SVG,
⟨x0, y0⟩ is the top-left corner and ⟨x1, y1⟩ is the lower-right corner; however, the coordinate system is arbitrary,
so more formally x0 <= x1 and y0 <= y1).
|
static <D> void |
visitAfter(Quadtree<D> $receiver,
kotlin.jvm.functions.Function5<? super io.data2viz.quadtree.QuadtreeNode<D>,? super java.lang.Double,? super java.lang.Double,? super java.lang.Double,? super java.lang.Double,kotlin.Unit> callback)
Visits each node in the quadtree in post-order traversal, invoking the specified callback with arguments
node, x0, y0, x1, y1 for each node, where node is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node,
and ⟨x1, y1⟩ are the upper bounds.
(Assuming that positive x is right and positive y is down, as is typically the case in Canvas and SVG, ⟨x0, y0⟩
is the top-left corner and ⟨x1, y1⟩ is the lower-right corner; however, the coordinate system is arbitrary,
so more formally x0 <= x1 and y0 <= y1.) Returns root.
|
public static <D> void visit(Quadtree<D> $receiver, kotlin.jvm.functions.Function5<? super io.data2viz.quadtree.QuadtreeNode<D>,? super java.lang.Double,? super java.lang.Double,? super java.lang.Double,? super java.lang.Double,java.lang.Boolean> callback)
Visits each node in the quadtree in pre-order traversal, invoking the specified callback with arguments node, x0, y0, x1, y1 for each node, where node is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node, and ⟨x1, y1⟩ are the upper bounds. (Assuming that positive x is right and positive y is down, as is typically the case in Canvas and SVG, ⟨x0, y0⟩ is the top-left corner and ⟨x1, y1⟩ is the lower-right corner; however, the coordinate system is arbitrary, so more formally x0 <= x1 and y0 <= y1).
If the callback returns true for a given node, then the children of that node are not visited; otherwise, all child nodes are visited. This can be used to quickly visit only parts of the tree, for example when using the Barnes–Hut approximation. Note, however, that child quadrants are always visited in sibling order: top-left, top-right, bottom-left, bottom-right. In cases such as search, visiting siblings in a specific order may be faster.
public static <D> void visitAfter(Quadtree<D> $receiver, kotlin.jvm.functions.Function5<? super io.data2viz.quadtree.QuadtreeNode<D>,? super java.lang.Double,? super java.lang.Double,? super java.lang.Double,? super java.lang.Double,kotlin.Unit> callback)
Visits each node in the quadtree in post-order traversal, invoking the specified callback with arguments node, x0, y0, x1, y1 for each node, where node is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node, and ⟨x1, y1⟩ are the upper bounds. (Assuming that positive x is right and positive y is down, as is typically the case in Canvas and SVG, ⟨x0, y0⟩ is the top-left corner and ⟨x1, y1⟩ is the lower-right corner; however, the coordinate system is arbitrary, so more formally x0 <= x1 and y0 <= y1.) Returns root.