Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_edgehash.h
| Show All 17 Lines | |||||
| #define __BLI_EDGEHASH_H__ | #define __BLI_EDGEHASH_H__ | ||||
| /** \file | /** \file | ||||
| * \ingroup bli | * \ingroup bli | ||||
| */ | */ | ||||
| #include "BLI_compiler_attrs.h" | #include "BLI_compiler_attrs.h" | ||||
| #ifdef __cplusplus | |||||
| extern "C" { | |||||
| #endif | |||||
| struct EdgeHash; | struct EdgeHash; | ||||
| typedef struct EdgeHash EdgeHash; | typedef struct EdgeHash EdgeHash; | ||||
| struct _EdgeHash_Edge { | struct _EdgeHash_Edge { | ||||
| uint v_low, v_high; | uint v_low, v_high; | ||||
| }; | }; | ||||
| struct _EdgeHash_Entry { | struct _EdgeHash_Entry { | ||||
| ▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
| #define BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS(totpoly) ((totpoly)*2) | #define BLI_EDGEHASH_SIZE_GUESS_FROM_POLYS(totpoly) ((totpoly)*2) | ||||
| /* *** EdgeSet *** */ | /* *** EdgeSet *** */ | ||||
| struct EdgeSet; | struct EdgeSet; | ||||
| typedef struct EdgeSet EdgeSet; | typedef struct EdgeSet EdgeSet; | ||||
| typedef struct EdgeSetIterator { | typedef struct EdgeSetIterator { | ||||
| struct _EdgeHash_Edge *edges; | const struct _EdgeHash_Edge *edges; | ||||
| uint length; | uint length; | ||||
| uint index; | uint index; | ||||
| } EdgeSetIterator; | } EdgeSetIterator; | ||||
| EdgeSet *BLI_edgeset_new_ex(const char *info, const unsigned int nentries_reserve) | EdgeSet *BLI_edgeset_new_ex(const char *info, const unsigned int nentries_reserve) | ||||
| ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; | ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; | ||||
| EdgeSet *BLI_edgeset_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; | EdgeSet *BLI_edgeset_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; | ||||
| int BLI_edgeset_len(EdgeSet *es) ATTR_WARN_UNUSED_RESULT; | int BLI_edgeset_len(EdgeSet *es) ATTR_WARN_UNUSED_RESULT; | ||||
| Show All 18 Lines | |||||
| { | { | ||||
| esi->index++; | esi->index++; | ||||
| } | } | ||||
| BLI_INLINE bool BLI_edgesetIterator_isDone(EdgeSetIterator *esi) | BLI_INLINE bool BLI_edgesetIterator_isDone(EdgeSetIterator *esi) | ||||
| { | { | ||||
| return esi->index >= esi->length; | return esi->index >= esi->length; | ||||
| } | } | ||||
| #ifdef __cplusplus | |||||
| } | |||||
| #endif | |||||
| #endif /* __BLI_EDGEHASH_H__ */ | #endif /* __BLI_EDGEHASH_H__ */ | ||||