Blender
V2.93
intern
dualcon
dualcon.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*/
16
17
#ifndef __DUALCON_H__
18
#define __DUALCON_H__
19
20
#ifdef WITH_CXX_GUARDEDALLOC
21
# include "
MEM_guardedalloc.h
"
22
#endif
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
28
typedef
float
(*
DualConCo
)[3];
29
30
typedef
unsigned
int (*
DualConTri
)[3];
31
32
typedef
unsigned
int
*
DualConLoop
;
33
34
typedef
struct
DualConInput
{
35
DualConLoop
mloop
;
36
37
DualConCo
co
;
38
int
co_stride
;
39
int
totco
;
40
41
DualConTri
looptri
;
42
int
tri_stride
;
43
int
tottri
;
44
45
int
loop_stride
;
46
47
float
min
[3],
max
[3];
48
}
DualConInput
;
49
50
/* callback for allocating memory for output */
51
typedef
void
*(*DualConAllocOutput)(
int
totvert,
int
totquad);
52
/* callback for adding a new vertex to the output */
53
typedef
void (*
DualConAddVert
)(
void
*
output
,
const
float
co[3]);
54
/* callback for adding a new quad to the output */
55
typedef
void (*
DualConAddQuad
)(
void
*
output
,
const
int
vert_indices[4]);
56
57
typedef
enum
{
58
DUALCON_FLOOD_FILL
= 1,
59
}
DualConFlags
;
60
61
typedef
enum
{
62
/* blocky */
63
DUALCON_CENTROID
,
64
/* smooth */
65
DUALCON_MASS_POINT
,
66
/* keeps sharp edges */
67
DUALCON_SHARP_FEATURES
,
68
}
DualConMode
;
69
70
/* Usage:
71
*
72
* The three callback arguments are used for creating the output
73
* mesh. The alloc_output callback takes the total number of vertices
74
* and faces (quads) that will be in the output. It should allocate
75
* and return a structure to hold the output mesh. The add_vert and
76
* add_quad callbacks will then be called for each new vertex and
77
* quad, and the callback should add the new mesh elements to the
78
* structure.
79
*/
80
void
*
dualcon
(
const
DualConInput
*input_mesh,
81
/* callbacks for output */
82
DualConAllocOutput
alloc_output,
83
DualConAddVert
add_vert,
84
DualConAddQuad
add_quad,
85
86
/* flags and settings to control the remeshing
87
* algorithm */
88
DualConFlags
flags,
89
DualConMode
mode,
90
float
threshold,
91
float
hermite_num,
92
float
scale,
93
int
depth);
94
95
#ifdef __cplusplus
96
}
97
#endif
98
99
#endif
/* __DUALCON_H__ */
float
typedef float(TangentPoint)[2]
MEM_guardedalloc.h
Read Guarded memory(de)allocation.
output
#define output
DualConMode
DualConMode
Definition:
dualcon.h:61
DUALCON_SHARP_FEATURES
@ DUALCON_SHARP_FEATURES
Definition:
dualcon.h:67
DUALCON_CENTROID
@ DUALCON_CENTROID
Definition:
dualcon.h:63
DUALCON_MASS_POINT
@ DUALCON_MASS_POINT
Definition:
dualcon.h:65
DualConLoop
unsigned int * DualConLoop
Definition:
dualcon.h:32
DualConInput
struct DualConInput DualConInput
DualConAddQuad
void(* DualConAddQuad)(void *output, const int vert_indices[4])
Definition:
dualcon.h:55
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:161
DualConTri
unsigned int(* DualConTri)[3]
Definition:
dualcon.h:30
DualConCo
float(* DualConCo)[3]
Definition:
dualcon.h:28
DualConAddVert
void(* DualConAddVert)(void *output, const float co[3])
Definition:
dualcon.h:53
DualConFlags
DualConFlags
Definition:
dualcon.h:57
DUALCON_FLOOD_FILL
@ DUALCON_FLOOD_FILL
Definition:
dualcon.h:58
DualConAllocOutput
void *(* DualConAllocOutput)(int totvert, int totquad)
Definition:
dualcon.h:51
DualConInput
Definition:
dualcon.h:34
DualConInput::co_stride
int co_stride
Definition:
dualcon.h:38
DualConInput::looptri
DualConTri looptri
Definition:
dualcon.h:41
DualConInput::tri_stride
int tri_stride
Definition:
dualcon.h:42
DualConInput::loop_stride
int loop_stride
Definition:
dualcon.h:45
DualConInput::co
DualConCo co
Definition:
dualcon.h:37
DualConInput::totco
int totco
Definition:
dualcon.h:39
DualConInput::tottri
int tottri
Definition:
dualcon.h:43
DualConInput::min
float min[3]
Definition:
dualcon.h:47
DualConInput::max
float max[3]
Definition:
dualcon.h:47
DualConInput::mloop
DualConLoop mloop
Definition:
dualcon.h:35
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1