6 #define MSURF_GREATER 1
10 #define MSURF_NORMALIZE 2
18 struct metasurface *msurf_create(void);
19 void msurf_free(struct metasurface *ms);
21 void msurf_enable(struct metasurface *ms, unsigned int opt);
22 void msurf_disable(struct metasurface *ms, unsigned int opt);
23 int msurf_is_enabled(struct metasurface *ms, unsigned int opt);
25 /* which is inside above or below the threshold */
26 void msurf_set_inside(struct metasurface *ms, int inside);
27 int msurf_get_inside(struct metasurface *ms);
29 /* set the bounding box (default: -1, -1, -1, 1, 1, 1)
30 * keep this as tight as possible to avoid wasting grid resolution
32 void msurf_set_bounds(struct metasurface *ms, float xmin, float ymin, float zmin, float xmax, float ymax, float zmax);
33 void msurf_get_bounds(struct metasurface *ms, float *xmin, float *ymin, float *zmin, float *xmax, float *ymax, float *zmax);
35 /* resolution of the 3D evaluation grid, the bigger, the better, the slower
36 * (default: 40, 40, 40)
38 void msurf_set_resolution(struct metasurface *ms, int xres, int yres, int zres);
39 void msurf_get_resolution(struct metasurface *ms, int *xres, int *yres, int *zres);
41 /* isosurface threshold value (default: 0) */
42 void msurf_set_threshold(struct metasurface *ms, float thres);
43 float msurf_get_threshold(struct metasurface *ms);
45 /* get pointer to the scalar field */
46 float *msurf_voxels(struct metasurface *ms);
47 float *msurf_slice(struct metasurface *ms, int idx);
49 /* finally call this to perform the polygonization */
50 int msurf_polygonize(struct metasurface *ms);
52 int msurf_vertex_count(struct metasurface *ms);
53 struct g3d_vertex *msurf_vertices(struct metasurface *ms);
59 #endif /* METASURF_H_ */