Skip to content

Commit f4b8e8f

Browse files
committed
Fixed a small bug: Voronoi vertex pointer init
1 parent 079af90 commit f4b8e8f

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

FortuneAlgo/FortuneAlgo/Voronoi/VoronoiDiagram.cpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ void build_voronoi(const std::vector<Point2D> &points,
231231
prev_leaf = arc->prev;
232232
next_leaf = arc->next;
233233

234-
if (prev_leaf == nullptr || next_leaf == nullptr) {
235-
int a = 100; a++;
236-
}
237-
238234
// They should not be null
239235
assert(prev_leaf != nullptr);
240236
assert(next_leaf != nullptr);
@@ -265,6 +261,7 @@ void build_voronoi(const std::vector<Point2D> &points,
265261
h_first->vertex = vertex;
266262
h_second->vertex = vertex;
267263
twin_nodes.second->vertex = vertex;
264+
vertex->edge = h_first;
268265

269266
halfedges.push_back(twin_nodes.first);
270267
halfedges.push_back(twin_nodes.second);
@@ -291,28 +288,4 @@ void build_voronoi(const std::vector<Point2D> &points,
291288
}
292289
}
293290

294-
// bl::print_tree(root);
295-
//
296-
// printf("\n\n\n");
297-
// bl::BLNodePtr node = root, prev_node = nullptr;
298-
// while (node != nullptr) {
299-
// if (node->is_leaf()) {
300-
// prev_node = node;
301-
// node = node->parent;
302-
// } else if (prev_node == node->parent) {
303-
// prev_node = node;
304-
// node = node->left;
305-
// } else if (prev_node == node->left) {
306-
// prev_node = node;
307-
// node = node->right;
308-
// } else if (prev_node == node->right) {
309-
// printf("Breakpoint: %d %d; Edge: %d %d\n", node->indices.first,
310-
// node->indices.second,
311-
// node->edge->l_index,
312-
// node->edge->r_index);
313-
//
314-
// prev_node = node;
315-
// node = node->parent;
316-
// }
317-
// }
318291
}

0 commit comments

Comments
 (0)