Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. //Add edges to check delaunay
  2. stack_edges_delaunay.push(current_halfedge);
  3. stack_edges_delaunay.push(current_halfedge->next);
  4. stack_edges_delaunay.push(current_halfedge->next->next);
  5.  
  6. //While exist some edge to check delaunay
  7. while(!stack_edges_delaunay.empty()) {
  8. HalfEdge *edge_delaunay = stack_edges_delaunay.top();
  9. stack_edges_delaunay.pop();
  10. if (edge_delaunay->twin->f != NULL && edge_delaunay->f != NULL) {
  11. if (Math::orientation25D(*(edge_delaunay->twin->next->next->v), *(edge_delaunay->v), *(edge_delaunay->next->v), *(edge_delaunay->next->next->v))){
  12. HalfEdge *e1 = edge_delaunay->next;
  13. HalfEdge *e2 = edge_delaunay->next->next;
  14. HalfEdge *et1 = edge_delaunay->twin->next;
  15. HalfEdge *et2 = edge_delaunay->twin->next->next;
  16.  
  17.  
  18. //New vertices assignations
  19. edge_delaunay->v = edge_delaunay->twin->next->next->v;
  20. edge_delaunay->twin->v = edge_delaunay->next->next->v;
  21.  
  22. //New edges assignations
  23. edge_delaunay->next = e2;
  24. e2->next = et1;
  25. et1->next = edge_delaunay;
  26.  
  27. edge_delaunay->twin->next = et2;
  28. et2->next = e1;
  29. e1->next = edge_delaunay->twin;
  30.  
  31. //Change edge of face edge
  32. edge_delaunay->f->e = edge_delaunay;
  33. //Change edge of face twin edge
  34. edge_delaunay->twin->f->e = edge_delaunay->twin;
  35. printf("FACES! %lu | %lu\n",edge_delaunay->f, edge_delaunay->twin->f);
  36.  
  37. //Add next edges to check delaunay
  38. stack_edges_delaunay.push(et1);
  39. stack_edges_delaunay.push(et2);
  40.  
  41. //Update face of auxiliar point if it is necessary
  42. if (edge_delaunay->f == faux || edge_delaunay->twin->f == faux) {
  43. float inter = Math::orientation2D(*(edge_delaunay->v), *(edge_delaunay->twin->v), paux);
  44. if (inter > 0){
  45. faux = edge_delaunay->f;
  46. } else {
  47. faux = edge_delaunay->twin->f;
  48. }
  49. }
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement