metasurf
diff src/metasurf.h @ 2:9ab057fba0c5
added copyright statements, added comments, yada yada
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 25 Oct 2011 08:59:07 +0300 |
parents | 7aa4627e492b |
children | 2c575855f707 |
line diff
1.1 --- a/src/metasurf.h Tue Oct 25 07:57:07 2011 +0300 1.2 +++ b/src/metasurf.h Tue Oct 25 08:59:07 2011 +0300 1.3 @@ -1,3 +1,21 @@ 1.4 +/* 1.5 +metasurf - a library for implicit surface polygonization 1.6 +Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org> 1.7 + 1.8 +This program is free software: you can redistribute it and/or modify 1.9 +it under the terms of the GNU Lesser General Public License as published by 1.10 +the Free Software Foundation, either version 3 of the License, or 1.11 +(at your option) any later version. 1.12 + 1.13 +This program is distributed in the hope that it will be useful, 1.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of 1.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.16 +GNU Lesser General Public License for more details. 1.17 + 1.18 +You should have received a copy of the GNU Lesser General Public License 1.19 +along with this program. If not, see <http://www.gnu.org/licenses/>. 1.20 +*/ 1.21 + 1.22 #ifndef METASURF_H_ 1.23 #define METASURF_H_ 1.24 1.25 @@ -14,15 +32,32 @@ 1.26 struct metasurface *msurf_create(void); 1.27 void msurf_free(struct metasurface *ms); 1.28 1.29 +/* set a scalar field evaluator function */ 1.30 void msurf_eval_func(struct metasurface *ms, msurf_eval_func_t func); 1.31 + 1.32 +/* set a generated vertex callback function */ 1.33 void msurf_vertex_func(struct metasurface *ms, msurf_vertex_func_t func); 1.34 + 1.35 +/* set a generated surface normal callback function (unused yet) */ 1.36 void msurf_normal_func(struct metasurface *ms, msurf_normal_func_t func); 1.37 1.38 +/* set the bounding box (default: -1, -1, -1, 1, 1, 1) 1.39 + * keep this as tight as possible to avoid wasting grid resolution 1.40 + */ 1.41 void msurf_bounds(struct metasurface *ms, float xmin, float ymin, float zmin, float xmax, float ymax, float zmax); 1.42 + 1.43 +/* resolution of the 3D evaluation grid, the bigger, the better, the slower 1.44 + * (default: 40, 40, 40) 1.45 + */ 1.46 void msurf_resolution(struct metasurface *ms, int xres, int yres, int zres); 1.47 + 1.48 +/* isosurface threshold value (default: 0) */ 1.49 void msurf_threshold(struct metasurface *ms, float thres); 1.50 1.51 -void msurf_polygonize(struct metasurface *ms); 1.52 + 1.53 +/* finally call this to perform the polygonization */ 1.54 +int msurf_polygonize(struct metasurface *ms); 1.55 + 1.56 1.57 #ifdef __cplusplus 1.58 }