Skip to content

Commit

Permalink
Fixed a small bug: Voronoi vertex pointer init
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotsur committed Aug 22, 2018
1 parent 079af90 commit f4b8e8f
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions FortuneAlgo/FortuneAlgo/Voronoi/VoronoiDiagram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ void build_voronoi(const std::vector<Point2D> &points,
prev_leaf = arc->prev;
next_leaf = arc->next;

if (prev_leaf == nullptr || next_leaf == nullptr) {
int a = 100; a++;
}

// They should not be null
assert(prev_leaf != nullptr);
assert(next_leaf != nullptr);
Expand Down Expand Up @@ -265,6 +261,7 @@ void build_voronoi(const std::vector<Point2D> &points,
h_first->vertex = vertex;
h_second->vertex = vertex;
twin_nodes.second->vertex = vertex;
vertex->edge = h_first;

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

// bl::print_tree(root);
//
// printf("\n\n\n");
// bl::BLNodePtr node = root, prev_node = nullptr;
// while (node != nullptr) {
// if (node->is_leaf()) {
// prev_node = node;
// node = node->parent;
// } else if (prev_node == node->parent) {
// prev_node = node;
// node = node->left;
// } else if (prev_node == node->left) {
// prev_node = node;
// node = node->right;
// } else if (prev_node == node->right) {
// printf("Breakpoint: %d %d; Edge: %d %d\n", node->indices.first,
// node->indices.second,
// node->edge->l_index,
// node->edge->r_index);
//
// prev_node = node;
// node = node->parent;
// }
// }
}

0 comments on commit f4b8e8f

Please sign in to comment.