nuclear@0: #ifndef MESH_H_ nuclear@0: #define MESH_H_ nuclear@0: nuclear@1: struct mesh_vertattr; nuclear@1: struct mesh_polyidx; nuclear@1: struct mesh; nuclear@0: nuclear@0: #ifdef __cplusplus nuclear@0: extern "C" { nuclear@0: #endif nuclear@0: nuclear@1: /* --- vertex attributes --- */ nuclear@0: nuclear@1: int vattr_init(struct mesh_vertattr *ma, int elem_sz); nuclear@1: void vattr_destroy(struct mesh_vertattr *ma); nuclear@0: nuclear@1: int vattr_set_name(struct mesh_vertattr *ma, const char *name); nuclear@1: const char *vattr_get_name(struct mesh_vertattr *ma); nuclear@1: nuclear@1: int vattr_add_elem(struct mesh_vertattr *ma, void *elem); nuclear@1: nuclear@1: void *vattr_pointer(struct mesh_vertattr *ma); nuclear@1: int vattr_count(struct mesh_vertattr *ma); nuclear@1: int vattr_elem_size(struct mesh_vertattr *ma); nuclear@3: void *vattr_elem(struct mesh_vertattr *ma, int elem); nuclear@1: nuclear@1: /* --- mesh --- */ nuclear@1: nuclear@1: int mesh_init(struct mesh *m, int nverts); nuclear@0: void mesh_destroy(struct mesh *m); nuclear@0: nuclear@0: int mesh_set_name(struct mesh *m, const char *name); nuclear@1: const char *mesh_get_name(struct mesh *m); nuclear@1: nuclear@3: /* 1 - points, 2 - lines, 3 - triangles, 4 - quads */ nuclear@3: int mesh_poly_type(struct mesh *m); nuclear@3: nuclear@1: int mesh_add_attrib(struct mesh *m, struct mesh_vertattr *attr); nuclear@3: int mesh_num_attribs(struct mesh *m); nuclear@0: int mesh_find_attrib(struct mesh *m, const char *name); nuclear@0: nuclear@3: struct mesh_vertattr *mesh_attrib(struct mesh *m, int loc); nuclear@3: void *mesh_attrib_data(struct mesh *m, int loc); nuclear@3: int *mesh_poly_data(struct mesh *m, int loc); nuclear@3: nuclear@3: int mesh_attrib_count(struct mesh *m, int loc); nuclear@1: int mesh_poly_count(struct mesh *m); nuclear@1: nuclear@3: void *mesh_attrib_elem(struct mesh *m, int loc, int elem); nuclear@3: int mesh_attrib_elem_size(struct mesh *m, int loc); nuclear@3: nuclear@1: /* the variable arguments correspond to the N indices of the N-gon nuclear@1: * for this particular vertex attribute (attr_loc, retrieved by nuclear@1: * mesh_find_attrib) nuclear@1: */ nuclear@1: int mesh_add_polyref(struct mesh *m, int attr_loc, ...); nuclear@1: nuclear@0: #ifdef __cplusplus nuclear@0: } nuclear@0: #endif nuclear@0: nuclear@0: #endif /* MESH_H_ */