Blender V4.3
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 WITH_CXX_GUARDEDALLOC
9# include "MEM_guardedalloc.h"
10#endif
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16typedef float (*DualConCo)[3];
17
18typedef unsigned int (*DualConTri)[3];
19
20typedef unsigned int *DualConLoop;
21
37
38/* callback for allocating memory for output */
39typedef void *(*DualConAllocOutput)(int totvert, int totquad);
40/* callback for adding a new vertex to the output */
41typedef void (*DualConAddVert)(void *output, const float co[3]);
42/* callback for adding a new quad to the output */
43typedef void (*DualConAddQuad)(void *output, const int vert_indices[4]);
44
45typedef enum {
48
49typedef enum {
50 /* blocky */
52 /* smooth */
54 /* keeps sharp edges */
57
58/* Usage:
59 *
60 * The three callback arguments are used for creating the output
61 * mesh. The alloc_output callback takes the total number of vertices
62 * and faces (quads) that will be in the output. It should allocate
63 * and return a structure to hold the output mesh. The add_vert and
64 * add_quad callbacks will then be called for each new vertex and
65 * quad, and the callback should add the new mesh elements to the
66 * structure.
67 */
68void *dualcon(const DualConInput *input_mesh,
69 /* callbacks for output */
70 DualConAllocOutput alloc_output,
71 DualConAddVert add_vert,
72 DualConAddQuad add_quad,
73
74 /* flags and settings to control the remeshing
75 * algorithm */
76 DualConFlags flags,
77 DualConMode mode,
78 float threshold,
79 float hermite_num,
80 float scale,
81 int depth);
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif /* __DUALCON_H__ */
Read Guarded memory(de)allocation.
#define output
DualConMode
Definition dualcon.h:49
@ DUALCON_SHARP_FEATURES
Definition dualcon.h:55
@ DUALCON_CENTROID
Definition dualcon.h:51
@ DUALCON_MASS_POINT
Definition dualcon.h:53
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)
unsigned int * DualConLoop
Definition dualcon.h:20
struct DualConInput DualConInput
void(* DualConAddQuad)(void *output, const int vert_indices[4])
Definition dualcon.h:43
unsigned int(* DualConTri)[3]
Definition dualcon.h:18
float(* DualConCo)[3]
Definition dualcon.h:16
void(* DualConAddVert)(void *output, const float co[3])
Definition dualcon.h:41
void *(* DualConAllocOutput)(int totvert, int totquad)
Definition dualcon.h:39
DualConFlags
Definition dualcon.h:45
@ DUALCON_FLOOD_FILL
Definition dualcon.h:46
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
int co_stride
Definition dualcon.h:26
int tri_stride
Definition dualcon.h:30
int loop_stride
Definition dualcon.h:33
DualConCo co
Definition dualcon.h:25
float min[3]
Definition dualcon.h:35
DualConLoop mloop
Definition dualcon.h:23
DualConTri corner_tris
Definition dualcon.h:29