home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / cprog / voronoi.lha / defs.h next >
Encoding:
C/C++ Source or Header  |  1993-03-19  |  1.3 KB  |  87 lines

  1. #ifndef NULL
  2. #define NULL 0
  3. #endif
  4. #define DELETED -2
  5.  
  6. int triangulate, sorted, plot, debug;
  7.  
  8. struct    Freenode    {
  9. struct    Freenode    *nextfree;
  10. };
  11. struct    Freelist    {
  12. struct    Freenode    *head;
  13. int            nodesize;
  14. };
  15. char *getfree();
  16. char *malloc();
  17. char *myalloc();
  18.  
  19. float xmin, xmax, ymin, ymax, deltax, deltay;
  20.  
  21.  
  22. struct Point    {
  23. float x,y;
  24. };
  25.  
  26. /* structure used both for sites and for vertices */
  27. struct Site    {
  28. struct    Point    coord;
  29. int        sitenbr;
  30. int        refcnt;
  31. };
  32.  
  33.  
  34. struct    Site    *sites;
  35. int        nsites;
  36. int        siteidx;
  37. int        sqrt_nsites;
  38. int        nvertices;
  39. struct     Freelist sfl;
  40. struct    Site    *bottomsite;
  41.  
  42.  
  43. struct Edge    {
  44. float        a,b,c;
  45. struct    Site     *ep[2];
  46. struct    Site    *reg[2];
  47. int        edgenbr;
  48. };
  49. #define le 0
  50. #define re 1
  51. int nedges;
  52. struct    Freelist efl;
  53.  
  54. int has_endpoint(),right_of();
  55. struct Site *intersect();
  56. float dist();
  57. struct Point PQ_min();
  58. struct Halfedge *PQextractmin();
  59. struct Edge *bisect();
  60.  
  61. struct Halfedge {
  62. struct Halfedge    *ELleft, *ELright;
  63. struct Edge    *ELedge;
  64. int        ELrefcnt;
  65. char        ELpm;
  66. struct    Site    *vertex;
  67. float        ystar;
  68. struct    Halfedge *PQnext;
  69. };
  70.  
  71. struct   Freelist    hfl;
  72. struct    Halfedge *ELleftend, *ELrightend;
  73. int     ELhashsize;
  74. struct    Halfedge **ELhash;
  75. struct    Halfedge *HEcreate(), *ELleft(), *ELright(), *ELleftbnd();
  76. struct    Site *leftreg(), *rightreg();
  77.  
  78.  
  79. int PQhashsize;
  80. struct    Halfedge *PQhash;
  81. struct    Halfedge *PQfind();
  82. int PQcount;
  83. int PQmin;
  84. int PQempty();
  85.  
  86.  
  87.