des bubulles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bubulles.h 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. bubulles.h
  3. */
  4. /* --------------------------------------------------------------------- */
  5. #define LIBBB_VERSION 50
  6. #define SZ_BUBULLE_TEXT 51 /* arbitrary value */
  7. /* a 3d space coordinate */
  8. typedef struct {
  9. double x, y, z;
  10. unsigned long reserved;
  11. } XYZ;
  12. /* colors and transparency */
  13. typedef struct {
  14. float r, g, b, a;
  15. unsigned long reserved;
  16. } RGBA;
  17. /*
  18. this is our main entity : the bubulle.
  19. 'bubulle' is a slang french word for 'friendly bubble'.
  20. */
  21. typedef struct {
  22. XYZ p; /* position */
  23. double d; /* diameter */
  24. int gray; /* used as an index */
  25. RGBA col;
  26. long ttl; /* bubulles can be aged */
  27. double kvalue; /* wtf ? */
  28. } Bubulle;
  29. /*
  30. this is the bubulles list descriptor.
  31. */
  32. typedef struct {
  33. char name[SZ_BUBULLE_TEXT+1];
  34. int size; /* max number of bubulles */
  35. int fidx; /* next free slot */
  36. XYZ position; /* global position */
  37. unsigned long flags;
  38. Bubulle *bbs; /* ptr to a movable array */
  39. } BBList;
  40. BBList * alloc_bubulles(char *name, int nbre, int k);
  41. int free_bubulles(BBList *bbl, int k);
  42. int print_bublist_desc(BBList *bbl, int k);
  43. int push_bubulle(BBList *where, Bubulle *what);
  44. int poke_bubulle(BBList *where, Bubulle *what, int idx);
  45. int peek_bubulle(BBList *from, Bubulle *to, int idx);
  46. int cleanfill_my_bublist(BBList *what, int k);
  47. int bubulles_version(int k);
  48. void bubulles_sizeof(int k);
  49. Bubulle * bubulle_getaddr(BBList *where, int idx);
  50. int fprint_bubulles(FILE *fp, char *title, BBList *bbl, int k);
  51. int niceprint_bubulle(Bubulle *what, int unused);
  52. int bubulles_to_data(char *fname, char *title, BBList *bbl, int k);
  53. /* --------------------------------------------------------------------- */
  54. /* sometime we want to look at the bounding box */
  55. typedef struct {
  56. double minX, minY, minZ;
  57. double maxX, maxY, maxZ;
  58. int flags;
  59. } BBox;
  60. int bounding_box(Bubulle *boubs, int nbre, BBox *bbox);
  61. int print_bbox(BBox *bbox, int k);
  62. /* --------------------------------------------------------------------- */