assman was renamed to assfile
[laserbrain_demo] / src / blobs / metasurf.h
1 #ifndef METASURF_H_
2 #define METASURF_H_
3
4 #define MSURF_GREATER   1
5 #define MSURF_LESS              0
6
7 #define MSURF_FLIP                      1
8 #define MSURF_NORMALIZE         2
9
10 struct metasurface;
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 struct metasurface *msurf_create(void);
17 void msurf_free(struct metasurface *ms);
18
19 void msurf_enable(struct metasurface *ms, unsigned int opt);
20 void msurf_disable(struct metasurface *ms, unsigned int opt);
21 int msurf_is_enabled(struct metasurface *ms, unsigned int opt);
22
23 /* which is inside above or below the threshold */
24 void msurf_set_inside(struct metasurface *ms, int inside);
25 int msurf_get_inside(struct metasurface *ms);
26
27 /* set the bounding box (default: -1, -1, -1, 1, 1, 1)
28  * keep this as tight as possible to avoid wasting grid resolution
29  */
30 void msurf_set_bounds(struct metasurface *ms, float xmin, float ymin, float zmin, float xmax, float ymax, float zmax);
31 void msurf_get_bounds(struct metasurface *ms, float *xmin, float *ymin, float *zmin, float *xmax, float *ymax, float *zmax);
32
33 /* resolution of the 3D evaluation grid, the bigger, the better, the slower
34  * (default: 40, 40, 40)
35  */
36 void msurf_set_resolution(struct metasurface *ms, int xres, int yres, int zres);
37 void msurf_get_resolution(struct metasurface *ms, int *xres, int *yres, int *zres);
38
39 /* isosurface threshold value (default: 0) */
40 void msurf_set_threshold(struct metasurface *ms, float thres);
41 float msurf_get_threshold(struct metasurface *ms);
42
43 /* get pointer to the scalar field */
44 float *msurf_voxels(struct metasurface *ms);
45 float *msurf_slice(struct metasurface *ms, int idx);
46
47 /* finally call this to perform the polygonization */
48 int msurf_polygonize(struct metasurface *ms);
49
50 int msurf_vertex_count(struct metasurface *ms);
51 float *msurf_vertices(struct metasurface *ms);
52 float *msurf_normals(struct metasurface *ms);
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif  /* METASURF_H_ */