Blender  V3.3
dualcon.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef __DUALCON_H__
4 #define __DUALCON_H__
5 
6 #ifdef WITH_CXX_GUARDEDALLOC
7 # include "MEM_guardedalloc.h"
8 #endif
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef float (*DualConCo)[3];
15 
16 typedef unsigned int (*DualConTri)[3];
17 
18 typedef unsigned int *DualConLoop;
19 
20 typedef struct DualConInput {
22 
24  int co_stride;
25  int totco;
26 
29  int tottri;
30 
32 
33  float min[3], max[3];
35 
36 /* callback for allocating memory for output */
37 typedef void *(*DualConAllocOutput)(int totvert, int totquad);
38 /* callback for adding a new vertex to the output */
39 typedef void (*DualConAddVert)(void *output, const float co[3]);
40 /* callback for adding a new quad to the output */
41 typedef void (*DualConAddQuad)(void *output, const int vert_indices[4]);
42 
43 typedef enum {
45 } DualConFlags;
46 
47 typedef enum {
48  /* blocky */
50  /* smooth */
52  /* keeps sharp edges */
54 } DualConMode;
55 
56 /* Usage:
57  *
58  * The three callback arguments are used for creating the output
59  * mesh. The alloc_output callback takes the total number of vertices
60  * and faces (quads) that will be in the output. It should allocate
61  * and return a structure to hold the output mesh. The add_vert and
62  * add_quad callbacks will then be called for each new vertex and
63  * quad, and the callback should add the new mesh elements to the
64  * structure.
65  */
66 void *dualcon(const DualConInput *input_mesh,
67  /* callbacks for output */
68  DualConAllocOutput alloc_output,
69  DualConAddVert add_vert,
70  DualConAddQuad add_quad,
71 
72  /* flags and settings to control the remeshing
73  * algorithm */
74  DualConFlags flags,
75  DualConMode mode,
76  float threshold,
77  float hermite_num,
78  float scale,
79  int depth);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif /* __DUALCON_H__ */
typedef float(TangentPoint)[2]
Read Guarded memory(de)allocation.
SyclQueue void void size_t num_bytes void
DualConMode
Definition: dualcon.h:47
@ DUALCON_SHARP_FEATURES
Definition: dualcon.h:53
@ DUALCON_CENTROID
Definition: dualcon.h:49
@ DUALCON_MASS_POINT
Definition: dualcon.h:51
unsigned int * DualConLoop
Definition: dualcon.h:18
struct DualConInput DualConInput
void(* DualConAddQuad)(void *output, const int vert_indices[4])
Definition: dualcon.h:41
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(* DualConTri)[3]
Definition: dualcon.h:16
float(* DualConCo)[3]
Definition: dualcon.h:14
void(* DualConAddVert)(void *output, const float co[3])
Definition: dualcon.h:39
DualConFlags
Definition: dualcon.h:43
@ DUALCON_FLOOD_FILL
Definition: dualcon.h:44
void *(* DualConAllocOutput)(int totvert, int totquad)
Definition: dualcon.h:37
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
ccl_global KernelShaderEvalInput ccl_global float * output
int co_stride
Definition: dualcon.h:24
DualConTri looptri
Definition: dualcon.h:27
int tri_stride
Definition: dualcon.h:28
int loop_stride
Definition: dualcon.h:31
DualConCo co
Definition: dualcon.h:23
int totco
Definition: dualcon.h:25
int tottri
Definition: dualcon.h:29
float min[3]
Definition: dualcon.h:33
float max[3]
Definition: dualcon.h:33
DualConLoop mloop
Definition: dualcon.h:21