Blender V4.3
scanfill_utils.c File Reference
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "BLI_scanfill.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Classes

struct  PolyInfo
 
struct  ScanFillIsect
 

Macros

#define V_ISISECT   1
 
#define E_ISISECT   1
 
#define E_ISDELETE   2
 
#define EFLAG_SET(eed, val)
 
#define VFLAG_SET(eve, val)
 

Typedefs

typedef struct PolyInfo PolyInfo
 
typedef struct ScanFillIsect ScanFillIsect
 

Functions

static ListBaseedge_isect_ls_ensure (GHash *isect_hash, ScanFillEdge *eed)
 
static ListBaseedge_isect_ls_add (GHash *isect_hash, ScanFillEdge *eed, ScanFillIsect *isect)
 
static int edge_isect_ls_sort_cb (void *thunk, const void *def_a_ptr, const void *def_b_ptr)
 
static ScanFillEdgeedge_step (PolyInfo *poly_info, const ushort poly_nr, ScanFillVert *v_prev, ScanFillVert *v_curr, ScanFillEdge *e_curr)
 
static bool scanfill_preprocess_self_isect (ScanFillContext *sf_ctx, PolyInfo *poly_info, const ushort poly_nr, ListBase *filledgebase)
 
bool BLI_scanfill_calc_self_isect (ScanFillContext *sf_ctx, ListBase *remvertbase, ListBase *remedgebase)
 

Macro Definition Documentation

◆ E_ISDELETE

#define E_ISDELETE   2

◆ E_ISISECT

#define E_ISISECT   1

Definition at line 41 of file scanfill_utils.c.

Referenced by edge_isect_ls_add(), and scanfill_preprocess_self_isect().

◆ EFLAG_SET

#define EFLAG_SET ( eed,
val )
Value:
{ \
CHECK_TYPE(eed, ScanFillEdge *); \
(eed)->user_flag = (eed)->user_flag | (uint)val; \
} \
(void)0
unsigned int uint

Definition at line 44 of file scanfill_utils.c.

Referenced by edge_isect_ls_add(), and scanfill_preprocess_self_isect().

◆ V_ISISECT

#define V_ISISECT   1

Definition at line 40 of file scanfill_utils.c.

Referenced by scanfill_preprocess_self_isect().

◆ VFLAG_SET

#define VFLAG_SET ( eve,
val )
Value:
{ \
CHECK_TYPE(eve, ScanFillVert *); \
(eve)->user_flag = (eve)->user_flag | (uint)val; \
} \
(void)0

Definition at line 59 of file scanfill_utils.c.

Referenced by scanfill_preprocess_self_isect().

Typedef Documentation

◆ PolyInfo

typedef struct PolyInfo PolyInfo

◆ ScanFillIsect

typedef struct ScanFillIsect ScanFillIsect

Function Documentation

◆ BLI_scanfill_calc_self_isect()

◆ edge_isect_ls_add()

static ListBase * edge_isect_ls_add ( GHash * isect_hash,
ScanFillEdge * eed,
ScanFillIsect * isect )
static

◆ edge_isect_ls_ensure()

static ListBase * edge_isect_ls_ensure ( GHash * isect_hash,
ScanFillEdge * eed )
static

Definition at line 94 of file scanfill_utils.c.

References BLI_ghash_ensure_p(), and MEM_callocN.

Referenced by edge_isect_ls_add().

◆ edge_isect_ls_sort_cb()

static int edge_isect_ls_sort_cb ( void * thunk,
const void * def_a_ptr,
const void * def_b_ptr )
static

Definition at line 119 of file scanfill_utils.c.

References b, ScanFillIsect::co, and len_squared_v2v2().

Referenced by scanfill_preprocess_self_isect().

◆ edge_step()

static ScanFillEdge * edge_step ( PolyInfo * poly_info,
const ushort poly_nr,
ScanFillVert * v_prev,
ScanFillVert * v_curr,
ScanFillEdge * e_curr )
static

◆ scanfill_preprocess_self_isect()