home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / lib / H / access / boundingbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.0 KB  |  40 lines

  1. /*
  2.  *  boundingbox.h -- declarations for rectangles (used by rtree code)
  3.  *
  4.  *    $Header: /private/postgres/src/lib/H/access/RCS/boundingbox.h,v 1.3 1989/09/05 17:03:54 mao Version_2 $
  5.  */
  6.  
  7. /* Define structures for containing rectangles. */
  8. struct rectangle 
  9.     {
  10.     float        lowx;
  11.     float        lowy;
  12.     float        highx;
  13.     float        highy;
  14.     };
  15.  
  16. #ifndef HORIZONTAL
  17. #define HORIZONTAL  1
  18. #define VERTICAL    2
  19. #endif
  20. typedef    struct rectangle  Rect;
  21.  
  22. #define    BOUNDBOX Rect
  23.  
  24. #define    INSIDE_BOX(box,d)     (Inside_Box((d),(box)))
  25.  
  26. #define    OVERLAP_BOX(box,d)  (Overlap_Box((d),(box)))
  27.  
  28. #define    NEW_ENCLOSE_BOX(out,current,new)    (Surround_Box(out,current,new))
  29.  
  30. #define NORTHOF_BOX(box,d)    ((d)->lowy > (box)->lowy)
  31. #define SOUTHOF_BOX(box,d)    ((d)->highy < (box)->highy)
  32. #define EASTOF_BOX(box,d)    ((d)->lowx > (box)->lowx)
  33. #define WESTOF_BOX(box,d)    ((d)->highx < (box)->highx)
  34.  
  35. #define    SPLIT_DIRECTION(encl, north, south, east, west)    \
  36.                     (split_choice(encl,north,south,east,west))
  37.  
  38. #define    FIND_BEST_INSERT_BOX(d,ba,n)    (find_best_insertion_box((d),(ba),(n)))
  39.  
  40.