libbubulle/bubulles.h

69 lines
1.7 KiB
C

/*
bubulles.h
*/
/* --------------------------------------------------------------------- */
#define LIBBB_VERSION 48
#define SZ_BUBULLE_TEXT 51 /* arbitrary value */
/* a 3d space coordinate */
typedef struct {
double x, y, z;
unsigned long reserved;
} XYZ;
typedef struct {
float r, g, b, a;
unsigned long reserved;
} RGBA;
typedef struct {
XYZ p; /* position */
double d; /* diameter */
int gray;
RGBA col;
long ttl;
double kvalue; /* wtf ? */
} Bubulle;
typedef struct {
char name[SZ_BUBULLE_TEXT+1];
int size; /* max number of bubulles */
int fidx; /* next free slot */
XYZ position;
unsigned long flags;
Bubulle *bbs;
} BBList;
BBList * alloc_bubulles(char *name, int nbre, int k);
int free_bubulles(BBList *bbl, int k);
int print_bublist_desc(BBList *bbl, int k);
int push_bubulle(BBList *where, Bubulle *what);
int poke_bubulle(BBList *where, Bubulle *what, int idx);
int peek_bubulle(BBList *from, Bubulle *to, int idx);
int cleanfill_my_bublist(BBList *what, int k);
int bubulles_version(int k);
void bubulles_sizeof(int k);
Bubulle * bubulle_getaddr(BBList *where, int idx);
int fprint_bubulles(FILE *fp, char *title, BBList *bbl, int k);
int niceprint_bubulle(Bubulle *what, int unused);
int bubulles_to_data(char *fname, char *title, BBList *bbl, int k);
/* --------------------------------------------------------------------- */
/* sometime we want to look at the bounding box */
typedef struct {
double minX, minY, minZ;
double maxX, maxY, maxZ;
int flags;
} BBox;
int bounding_box(Bubulle *boubs, int nbre, BBox *bbox);
int print_bbox(BBox *bbox, int k);
/* --------------------------------------------------------------------- */