Blender  V3.3
BLI_delaunay_2d.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
104 typedef struct CDT_input {
109  int (*edges)[2];
110  int *faces;
113  float epsilon;
114  bool need_ids;
116 
146 typedef struct CDT_result {
152  int (*edges)[2];
153  int *faces;
166 
168 typedef enum CDT_output_type {
187 
195 
197 
198 #ifdef __cplusplus
199 }
200 
201 /* C++ Interface. */
202 
203 # include "BLI_array.hh"
204 # include "BLI_math_mpq.hh"
205 # include "BLI_math_vec_mpq_types.hh"
206 # include "BLI_math_vec_types.hh"
207 # include "BLI_vector.hh"
208 
209 namespace blender::meshintersect {
210 
212 template<typename Arith_t> struct vec2_impl;
213 template<> struct vec2_impl<double> {
214  typedef double2 type;
215 };
216 
217 # ifdef WITH_GMP
218 template<> struct vec2_impl<mpq_class> {
219  typedef mpq2 type;
220 };
221 # endif
222 
223 template<typename Arith_t> using vec2 = typename vec2_impl<Arith_t>::type;
224 
225 template<typename Arith_t> class CDT_input {
226  public:
227  Array<vec2<Arith_t>> vert;
228  Array<std::pair<int, int>> edge;
229  Array<Vector<int>> face;
230  Arith_t epsilon{0};
231  bool need_ids{true};
232 };
233 
234 template<typename Arith_t> class CDT_result {
235  public:
236  Array<vec2<Arith_t>> vert;
237  Array<std::pair<int, int>> edge;
238  Array<Vector<int>> face;
239  /* The orig vectors are only populated if the need_ids input field is true. */
241  Array<Vector<int>> vert_orig;
251  Array<Vector<int>> edge_orig;
253  Array<Vector<int>> face_orig;
255  int face_edge_offset;
256 };
257 
259 
260 # ifdef WITH_GMP
262  CDT_output_type output_type);
263 # endif
264 
265 } /* namespace blender::meshintersect */
266 
267 #endif /* __cplusplus */
typedef float(TangentPoint)[2]
CDT_result * BLI_delaunay_2d_cdt_calc(const CDT_input *input, const CDT_output_type output_type)
struct CDT_result CDT_result
CDT_output_type
@ CDT_CONSTRAINTS_VALID_BMESH
@ CDT_CONSTRAINTS_VALID_BMESH_WITH_HOLES
@ CDT_CONSTRAINTS
@ CDT_INSIDE
@ CDT_FULL
@ CDT_INSIDE_WITH_HOLES
struct CDT_input CDT_input
void BLI_delaunay_2d_cdt_free(CDT_result *result)
typedef double(DMatrix)[4][4]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
blender::meshintersect::CDT_result< double > delaunay_2d_calc(const CDT_input< double > &input, CDT_output_type output_type)
ccl_global KernelShaderEvalInput * input
static double epsilon
vec_base< double, 2 > double2
float(* vert_coords)[2]
int(* edges)[2]
int * faces_len_table
int * faces_start_table
int * faces_start_table
int * verts_orig_len_table
int * edges_orig_len_table
int * verts_orig_start_table
int * faces_orig_start_table
int * edges_orig_start_table
int * faces_orig_len_table
int(* edges)[2]
int * faces_len_table
float(* vert_coords)[2]