Skip to content

Commit 69e29c2

Browse files
authored
Fix pop_point! for Tuple case when peeking (#54)
Fix pop_point! for Tuple case when peeking
2 parents 37438a1 + 3e5bcce commit 69e29c2

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DelaunayTriangulation"
22
uuid = "927a84f5-c5f4-47a5-9785-b46e178433df"
33
authors = ["Daniel VandenHeuvel <[email protected]>"]
4-
version = "0.6.3"
4+
version = "0.6.4"
55

66
[deps]
77
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"

src/operations/add_point.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,18 @@ function add_point!(tri::Triangulation, new_point;
6767
exterior_curve_index
6868
),
6969
peek=Val(false))
70-
if !(new_point isa Integer)
70+
int_flag = new_point isa Integer
71+
if !int_flag
7172
push_point!(tri, new_point)
7273
new_point = num_points(tri)
7374
end
7475
q = get_point(tri, new_point)
7576
flag = point_position_relative_to_triangle(tri, V, q)
76-
return add_point_bowyer_watson_and_process_after_found_triangle!(tri, new_point, V, q, flag, update_representative_point, store_event_history, event_history, peek)
77+
V = add_point_bowyer_watson_and_process_after_found_triangle!(tri, new_point, V, q, flag, update_representative_point, store_event_history, event_history, peek)
78+
if !int_flag && is_true(peek)
79+
pop_point!(tri)
80+
end
81+
return V
7782
end
7883

7984
function add_point!(tri::Triangulation, new_point_x, new_point_y;

test/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
66
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
77
ElasticArrays = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4"
88
ExactPredicates = "429591f6-91af-11e9-00e2-59fbe8cec110"
9-
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
109
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1110
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
1211
MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b"

test/operations/add_point.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ end
6262
[(0.0, rand()) for _ in 1:50]..., [(rand(), 0.0) for _ in 1:50]..., [(rand(), 1.0) for _ in 1:50]..., [(1.0, rand()) for _ in 1:50]...,
6363
[(rand(), rand()) for _ in 1:500]...]
6464
empty!(history)
65+
if rand() < 1/2
6566
add_point!(tri, x, y, store_event_history=Val(true), event_history=history, peek=Val(true))
67+
else
68+
add_point!(tri, (x, y), store_event_history=Val(true), event_history=history, peek=Val(true))
69+
end
6670
clear_empty_features!(tri)
6771
@test DT.compare_triangle_collections(get_triangles(_tri), get_triangles(tri))
6872
@test get_adjacent(tri) == get_adjacent(_tri)

0 commit comments

Comments
 (0)