Blender
V5.0
intern
dualcon
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
9
extern
"C"
{
10
#endif
11
12
typedef
float
(*
DualConCo
)[3];
13
14
typedef
unsigned
int (*
DualConTri
)[3];
15
16
typedef
unsigned
int
*
DualConCornerVerts
;
17
18
typedef
struct
DualConInput
{
19
DualConCornerVerts
corner_verts
;
20
21
DualConCo
co
;
22
int
co_stride
;
23
int
totco
;
24
25
DualConTri
corner_tris
;
26
int
tri_stride
;
27
int
tottri
;
28
29
int
corner_verts_stride
;
30
31
float
min
[3],
max
[3];
32
}
DualConInput
;
33
34
/* callback for allocating memory for output */
35
typedef
void
*(*DualConAllocOutput)(
int
totvert,
int
totquad);
36
/* callback for adding a new vertex to the output */
37
typedef
void (*
DualConAddVert
)(
void
*
output
,
const
float
co[3]);
38
/* callback for adding a new quad to the output */
39
typedef
void (*
DualConAddQuad
)(
void
*
output
,
const
int
vert_indices[4]);
40
41
typedef
enum
{
42
DUALCON_FLOOD_FILL
= 1,
43
}
DualConFlags
;
44
45
typedef
enum
{
46
/* blocky */
47
DUALCON_CENTROID
,
48
/* smooth */
49
DUALCON_MASS_POINT
,
50
/* keeps sharp edges */
51
DUALCON_SHARP_FEATURES
,
52
}
DualConMode
;
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
*/
64
void
*
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__ */
float
nullptr float
Definition
closures_template.h:123
DualConMode
DualConMode
Definition
dualcon.h:45
DUALCON_SHARP_FEATURES
@ DUALCON_SHARP_FEATURES
Definition
dualcon.h:51
DUALCON_CENTROID
@ DUALCON_CENTROID
Definition
dualcon.h:47
DUALCON_MASS_POINT
@ DUALCON_MASS_POINT
Definition
dualcon.h:49
dualcon
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)
Definition
dualcon_c_api.cpp:144
DualConAddQuad
void(* DualConAddQuad)(void *output, const int vert_indices[4])
Definition
dualcon.h:39
DualConTri
unsigned int(* DualConTri)[3]
Definition
dualcon.h:14
DualConCo
float(* DualConCo)[3]
Definition
dualcon.h:12
DualConAddVert
void(* DualConAddVert)(void *output, const float co[3])
Definition
dualcon.h:37
DualConAllocOutput
void *(* DualConAllocOutput)(int totvert, int totquad)
Definition
dualcon.h:35
DualConFlags
DualConFlags
Definition
dualcon.h:41
DUALCON_FLOOD_FILL
@ DUALCON_FLOOD_FILL
Definition
dualcon.h:42
DualConCornerVerts
unsigned int * DualConCornerVerts
Definition
dualcon.h:16
output
#define output
Definition
gpu_shader_compat_cxx.hh:171
DualConInput
Definition
dualcon.h:18
DualConInput::co_stride
int co_stride
Definition
dualcon.h:22
DualConInput::tri_stride
int tri_stride
Definition
dualcon.h:26
DualConInput::co
DualConCo co
Definition
dualcon.h:21
DualConInput::totco
int totco
Definition
dualcon.h:23
DualConInput::tottri
int tottri
Definition
dualcon.h:27
DualConInput::min
float min[3]
Definition
dualcon.h:31
DualConInput::corner_verts
DualConCornerVerts corner_verts
Definition
dualcon.h:19
DualConInput::corner_verts_stride
int corner_verts_stride
Definition
dualcon.h:29
DualConInput::max
float max[3]
Definition
dualcon.h:31
DualConInput::corner_tris
DualConTri corner_tris
Definition
dualcon.h:25
Generated on
for Blender by
doxygen
1.16.1