2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * Contributor(s): Nicholas Bishop
20 * ***** END GPL LICENSE BLOCK *****
26 #ifdef WITH_CXX_GUARDEDALLOC
27 # include "MEM_guardedalloc.h"
34 typedef float (*DualConCo)[3];
36 typedef unsigned int (*DualConTri)[3];
38 typedef unsigned int (*DualConLoop);
40 typedef struct DualConInput {
56 /* callback for allocating memory for output */
57 typedef void *(*DualConAllocOutput)(int totvert, int totquad);
58 /* callback for adding a new vertex to the output */
59 typedef void (*DualConAddVert)(void *output, const float co[3]);
60 /* callback for adding a new quad to the output */
61 typedef void (*DualConAddQuad)(void *output, const int vert_indices[4]);
64 DUALCON_FLOOD_FILL = 1,
72 /* keeps sharp edges */
73 DUALCON_SHARP_FEATURES,
78 * The three callback arguments are used for creating the output
79 * mesh. The alloc_output callback takes the total number of vertices
80 * and faces (quads) that will be in the output. It should allocate
81 * and return a structure to hold the output mesh. The add_vert and
82 * add_quad callbacks will then be called for each new vertex and
83 * quad, and the callback should add the new mesh elements to the
86 void *dualcon(const DualConInput *input_mesh,
87 /* callbacks for output */
88 DualConAllocOutput alloc_output,
89 DualConAddVert add_vert,
90 DualConAddQuad add_quad,
92 /* flags and settings to control the remeshing
105 #endif /* __DUALCON_H__ */