Blender V5.0
dualcon.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#ifndef __DUALCON_H__
6#define __DUALCON_H__
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12typedef float (*DualConCo)[3];
13
14typedef unsigned int (*DualConTri)[3];
15
16typedef unsigned int *DualConCornerVerts;
17
33
34/* callback for allocating memory for output */
35typedef void *(*DualConAllocOutput)(int totvert, int totquad);
36/* callback for adding a new vertex to the output */
37typedef void (*DualConAddVert)(void *output, const float co[3]);
38/* callback for adding a new quad to the output */
39typedef void (*DualConAddQuad)(void *output, const int vert_indices[4]);
40
41typedef enum {
44
45typedef enum {
46 /* blocky */
48 /* smooth */
50 /* keeps sharp edges */
53
54/* Usage:
55 *
56 * The three callback arguments are used for creating the output
57 * mesh. The alloc_output callback takes the total number of vertices
58 * and faces (quads) that will be in the output. It should allocate
59 * and return a structure to hold the output mesh. The add_vert and
60 * add_quad callbacks will then be called for each new vertex and
61 * quad, and the callback should add the new mesh elements to the
62 * structure.
63 */
64void *dualcon(const DualConInput *input_mesh,
65 /* callbacks for output */
66 DualConAllocOutput alloc_output,
67 DualConAddVert add_vert,
68 DualConAddQuad add_quad,
69
70 /* flags and settings to control the remeshing
71 * algorithm */
72 DualConFlags flags,
73 DualConMode mode,
74 float threshold,
75 float hermite_num,
76 float scale,
77 int depth);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* __DUALCON_H__ */
nullptr float
DualConMode
Definition dualcon.h:45
@ DUALCON_SHARP_FEATURES
Definition dualcon.h:51
@ DUALCON_CENTROID
Definition dualcon.h:47
@ DUALCON_MASS_POINT
Definition dualcon.h:49
void * dualcon(const DualConInput *input_mesh, DualConAllocOutput alloc_output, DualConAddVert add_vert, DualConAddQuad add_quad, DualConFlags flags, DualConMode mode, float threshold, float hermite_num, float scale, int depth)
void(* DualConAddQuad)(void *output, const int vert_indices[4])
Definition dualcon.h:39
unsigned int(* DualConTri)[3]
Definition dualcon.h:14
float(* DualConCo)[3]
Definition dualcon.h:12
void(* DualConAddVert)(void *output, const float co[3])
Definition dualcon.h:37
void *(* DualConAllocOutput)(int totvert, int totquad)
Definition dualcon.h:35
DualConFlags
Definition dualcon.h:41
@ DUALCON_FLOOD_FILL
Definition dualcon.h:42
unsigned int * DualConCornerVerts
Definition dualcon.h:16
#define output
int co_stride
Definition dualcon.h:22
int tri_stride
Definition dualcon.h:26
DualConCo co
Definition dualcon.h:21
float min[3]
Definition dualcon.h:31
DualConCornerVerts corner_verts
Definition dualcon.h:19
int corner_verts_stride
Definition dualcon.h:29
float max[3]
Definition dualcon.h:31
DualConTri corner_tris
Definition dualcon.h:25