static void MarkSubtree(Node *subtree, MarkContext *context) { if(NodeIsLeaf(subtree)){ MarkLeaf(subtree, context); } else { MarkSubtree(subtree->A, context); MarkSubtree(subtree->B, context); // TODO Force TCO here? } }
static void MarkSubtree(Node *subtree, MarkContext *context) { if(NodeIsLeaf(subtree)){ MarkLeaf(subtree, context); } else { MarkSubtree(subtree->A, context); MarkSubtree(subtree->B, context); } }
static void LeafAddPairs(Node *leaf, cpBBTree *tree) { cpSpatialIndex *dynamicIndex = tree->spatialIndex.dynamicIndex; if(dynamicIndex){ Node *dynamicRoot = GetRootIfTree(dynamicIndex); if(dynamicRoot){ cpBBTree *dynamicTree = GetTree(dynamicIndex); MarkContext context = {dynamicTree, NULL, NULL, NULL}; MarkLeafQuery(dynamicRoot, leaf, cpTrue, &context); } } else { Node *staticRoot = GetRootIfTree(tree->spatialIndex.staticIndex); MarkContext context = {tree, staticRoot, VoidQueryFunc, NULL}; MarkLeaf(leaf, &context); } }