diff --git a/src/Model/DataBase.java b/src/Model/DataBase.java index ecb9611..3f033a5 100644 --- a/src/Model/DataBase.java +++ b/src/Model/DataBase.java @@ -628,6 +628,11 @@ public Point2D getU(Point2D p, Point2D prev, Point2D next) { } + public void updateUp(Point2D p, Point2D c) + { + u_p.replace(p, c); + } + //-----------O(n)---------------- public void addAllUpToK() { diff --git a/src/Model/NeighborVoronoiDiagram.java b/src/Model/NeighborVoronoiDiagram.java index 5fe3dc4..961cfb9 100644 --- a/src/Model/NeighborVoronoiDiagram.java +++ b/src/Model/NeighborVoronoiDiagram.java @@ -38,6 +38,7 @@ public void computeVoronoiDiagram() dataBase.addCandUtoE(c, dataBase.getUp2(p)); dataBase.addCandUtoE(c, dataBase.getUp2(before_p)); //u(q)=c; + dataBase.updateUp(before_p, c); dataBase.deleteMaxP(); n = n-1; }while(n != 2);