metasurf

annotate src/metasurf.h @ 7:246260d95415

added /usr/local/lib linker path
author John Tsiombikas <nuclear@mutantstargoat.com>
date Sat, 21 Jan 2012 04:15:30 +0200
parents 9ab057fba0c5
children
rev   line source
nuclear@2 1 /*
nuclear@2 2 metasurf - a library for implicit surface polygonization
nuclear@2 3 Copyright (C) 2011 John Tsiombikas <nuclear@member.fsf.org>
nuclear@2 4
nuclear@2 5 This program is free software: you can redistribute it and/or modify
nuclear@2 6 it under the terms of the GNU Lesser General Public License as published by
nuclear@2 7 the Free Software Foundation, either version 3 of the License, or
nuclear@2 8 (at your option) any later version.
nuclear@2 9
nuclear@2 10 This program is distributed in the hope that it will be useful,
nuclear@2 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@2 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@2 13 GNU Lesser General Public License for more details.
nuclear@2 14
nuclear@2 15 You should have received a copy of the GNU Lesser General Public License
nuclear@2 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@2 17 */
nuclear@2 18
nuclear@0 19 #ifndef METASURF_H_
nuclear@0 20 #define METASURF_H_
nuclear@0 21
nuclear@4 22 #define MSURF_GREATER 1
nuclear@4 23 #define MSURF_LESS 0
nuclear@4 24
nuclear@0 25 struct metasurface;
nuclear@0 26
nuclear@0 27 typedef float (*msurf_eval_func_t)(float, float, float);
nuclear@0 28 typedef void (*msurf_vertex_func_t)(float, float, float);
nuclear@0 29 typedef void (*msurf_normal_func_t)(float, float, float);
nuclear@0 30
nuclear@0 31 #ifdef __cplusplus
nuclear@0 32 extern "C" {
nuclear@0 33 #endif
nuclear@0 34
nuclear@0 35 struct metasurface *msurf_create(void);
nuclear@0 36 void msurf_free(struct metasurface *ms);
nuclear@0 37
nuclear@4 38 /* which is inside above or below the threshold */
nuclear@4 39 void msurf_inside(struct metasurface *ms, int inside);
nuclear@4 40
nuclear@2 41 /* set a scalar field evaluator function */
nuclear@0 42 void msurf_eval_func(struct metasurface *ms, msurf_eval_func_t func);
nuclear@2 43
nuclear@2 44 /* set a generated vertex callback function */
nuclear@0 45 void msurf_vertex_func(struct metasurface *ms, msurf_vertex_func_t func);
nuclear@2 46
nuclear@2 47 /* set a generated surface normal callback function (unused yet) */
nuclear@0 48 void msurf_normal_func(struct metasurface *ms, msurf_normal_func_t func);
nuclear@0 49
nuclear@2 50 /* set the bounding box (default: -1, -1, -1, 1, 1, 1)
nuclear@2 51 * keep this as tight as possible to avoid wasting grid resolution
nuclear@2 52 */
nuclear@0 53 void msurf_bounds(struct metasurface *ms, float xmin, float ymin, float zmin, float xmax, float ymax, float zmax);
nuclear@2 54
nuclear@2 55 /* resolution of the 3D evaluation grid, the bigger, the better, the slower
nuclear@2 56 * (default: 40, 40, 40)
nuclear@2 57 */
nuclear@0 58 void msurf_resolution(struct metasurface *ms, int xres, int yres, int zres);
nuclear@2 59
nuclear@2 60 /* isosurface threshold value (default: 0) */
nuclear@0 61 void msurf_threshold(struct metasurface *ms, float thres);
nuclear@0 62
nuclear@2 63
nuclear@2 64 /* finally call this to perform the polygonization */
nuclear@2 65 int msurf_polygonize(struct metasurface *ms);
nuclear@2 66
nuclear@0 67
nuclear@0 68 #ifdef __cplusplus
nuclear@0 69 }
nuclear@0 70 #endif
nuclear@0 71
nuclear@0 72 #endif /* METASURF_H_ */