26 1, 3, 5, 11, 17, 37, 67, 131, 257, 521,
27 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309,
28 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459,
39 EHash *eh =
static_cast<EHash *
>(allocatorIFC->
alloc(allocator,
sizeof(*eh)));
58 while (numBuckets--) {
64 freeEntry(entry, user_data);
89 while (numBuckets--) {
90 for (entry = oldBuckets[numBuckets]; entry;) {
111 for (; (entry =
static_cast<EHEntry *
>(*prevp)); prevp = (
void **)&entry->
next) {
112 if (entry->
key == key) {
113 *prevp_r = (
void **)prevp;
127 if (entry->
key == key) {
188 return MEM_mallocN(numBytes,
"CCG standard alloc");
219#ifdef DUMP_RESULT_GRIDS
228 for (i = 0, index = 0; i < ss->
vMap->
curSize; i++) {
230 for (;
v;
v =
v->next, index++) {
232 printf(
"vertex index=%d, co=(%f, %f, %f)\n", index, co[0], co[1], co[2]);
236 for (i = 0, index = 0; i < ss->
eMap->
curSize; i++) {
238 for (;
e;
e =
e->next, index++) {
241 printf(
"edge index=%d, start_co=(%f, %f, %f)\n", index, co[0], co[1], co[2]);
242 for (x = 0; x < edgeSize; x++) {
244 printf(
"edge index=%d, seg=%d, co=(%f, %f, %f)\n", index, x, co[0], co[1], co[2]);
247 printf(
"edge index=%d, end_co=(%f, %f, %f)\n", index, co[0], co[1], co[2]);
251 for (i = 0, index = 0; i < ss->
fMap->
curSize; i++) {
253 for (; f; f = f->next, index++) {
254 for (S = 0; S < f->numVerts; S++) {
257 printf(
"face index=%d, vertex=%d, coord=(%f, %f, %f)\n", index, S, co[0], co[1], co[2]);
262 for (i = 0, index = 0; i < ss->
fMap->
curSize; i++) {
264 for (; f; f = f->next, index++) {
265 for (S = 0; S < f->numVerts; S++) {
269 printf(
"face index=%d, edge=%d, coord1=(%f, %f, %f), coord2=(%f, %f, %f)\n",
282 for (i = 0, index = 0; i < ss->
fMap->
curSize; i++) {
284 for (; f; f = f->next, index++) {
285 for (S = 0; S < f->numVerts; S++) {
287 for (x = 0; x < gridSize; x++) {
288 for (y = 0; y < gridSize; y++) {
290 printf(
"face index=%d. corner=%d, x=%d, y=%d, coord=(%f, %f, %f)\n",
300 for (x = 0; x < gridSize; x++) {
302 printf(
"face index=%d. corner=%d, ie_index=%d, coord=(%f, %f, %f)\n",
BLI_INLINE int ccg_edgesize(int level)
BLI_INLINE CCGVert ** FACE_getVerts(CCGFace *f)
BLI_INLINE int ccg_gridsize(int level)
BLI_INLINE CCGEdge ** FACE_getEdges(CCGFace *f)
#define EHASH_alloc(eh, nb)
#define EDGE_getCo(e, lvl, x)
#define FACE_getIFCo(f, lvl, S, x, y)
#define EHASH_free(eh, ptr)
#define VERT_getCo(v, lvl)
void(* EHEntryFreeFP)(EHEntry *, void *)
#define EHASH_hash(eh, item)
#define FACE_getIECo(f, lvl, S, x)
void ccg_ehashIterator_init(EHash *eh, EHashIterator *ehi)
void ccg_ehashIterator_next(EHashIterator *ehi)
void ccg_ehash_insert(EHash *eh, EHEntry *entry)
int ccg_ehashIterator_isStopped(EHashIterator *ehi)
void * ccg_ehash_lookupWithPrev(EHash *eh, void *key, void ***prevp_r)
static void _stdAllocator_free(CCGAllocatorHDL, void *ptr)
static void * _stdAllocator_realloc(CCGAllocatorHDL, void *ptr, int newSize, int)
void * ccg_ehashIterator_getCurrent(EHashIterator *ehi)
void ccg_ehash_free(EHash *eh, EHEntryFreeFP freeEntry, void *user_data)
EHash * ccg_ehash_new(int estimatedNumEntries, CCGAllocatorIFC *allocatorIFC, CCGAllocatorHDL allocator)
CCGAllocatorIFC * ccg_getStandardAllocatorIFC()
static void * _stdAllocator_alloc(CCGAllocatorHDL, int numBytes)
void * ccg_ehash_lookup(EHash *eh, void *key)
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void(* free)(CCGAllocatorHDL a, void *ptr)
void(* release)(CCGAllocatorHDL a)
void *(* alloc)(CCGAllocatorHDL a, int numBytes)
void *(* realloc)(CCGAllocatorHDL a, void *ptr, int newSize, int oldSize)
struct _EHEntry * curEntry
CCGAllocatorIFC allocatorIFC
CCGAllocatorHDL allocator