Blender V2.61 - r43446
|
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_edgehash.h"
#include "BLI_mempool.h"
Go to the source code of this file.
Definition in file edgehash.c.
#define EDGE_HASH | ( | v0, | |
v1 | |||
) | ((v0 * 39)^(v1 * 31)) |
Definition at line 51 of file edgehash.c.
Referenced by BLI_edgehash_insert(), and BLI_edgehash_lookup_p().
#define EDGE_ORD | ( | v0, | |
v1 | |||
) |
if (v0 > v1) { \
v0 ^= v1; \
v1 ^= v0; \
v0 ^= v1; \
}
Definition at line 54 of file edgehash.c.
Referenced by BLI_edgehash_insert(), and BLI_edgehash_lookup_p().
Definition at line 63 of file edgehash.c.
void BLI_edgehash_clear | ( | EdgeHash * | eh, |
EdgeHashFreeFP | valfreefp | ||
) |
Definition at line 163 of file edgehash.c.
References BLI_mempool_free(), EdgeHash::buckets, credits_svn_gen::e, EdgeHash::epool, i, EdgeHash::nbuckets, EdgeHash::nentries, EdgeEntry::next, and NULL.
Referenced by BLI_edgehash_free().
void BLI_edgehash_free | ( | EdgeHash * | eh, |
EdgeHashFreeFP | valfreefp | ||
) |
Definition at line 184 of file edgehash.c.
References BLI_edgehash_clear(), BLI_mempool_destroy(), EdgeHash::buckets, EdgeHash::epool, and MEM_freeN().
Referenced by applyModifier(), arrayModifier_doArray(), BKE_mesh_calc_edges(), BKE_mesh_validate_arrays(), BME_bmesh_to_derivedmesh(), BME_derivedmesh_to_bmesh(), CDDM_calc_edges(), cloth_free_errorsprings(), cloth_free_modifier(), cloth_free_modifier_extern(), cutEdges(), dm_calc_normal(), draw_mesh_face_select(), EM_make_hq_normals(), explodeMesh(), laplacian_system_construct_end(), mesh_to_curve(), REEB_freeGraph(), select_linked_tfaces_with_seams(), smoothmesh_from_derivedmesh(), sph_solver_finalise(), and ss_sync_from_uv().
int BLI_edgehash_haskey | ( | EdgeHash * | eh, |
unsigned int | v0, | ||
unsigned int | v1 | ||
) |
Definition at line 153 of file edgehash.c.
References BLI_edgehash_lookup_p(), and NULL.
Referenced by arrayModifier_doArray(), BKE_mesh_calc_edges(), BKE_mesh_validate_arrays(), CDDM_calc_edges(), cloth_build_springs(), cloth_bvh_objcollision(), get_marked_edge_info__orFlags(), mesh_to_curve(), select_linked_tfaces_with_seams(), and ss_sync_from_uv().
void BLI_edgehash_insert | ( | EdgeHash * | eh, |
unsigned int | v0, | ||
unsigned int | v1, | ||
void * | val | ||
) |
Definition at line 92 of file edgehash.c.
References _ehash_hashsizes, BLI_mempool_alloc(), EdgeHash::buckets, EdgeHash::cursize, credits_svn_gen::e, EDGE_HASH, EDGE_ORD, EdgeHash::epool, hash, i, MEM_freeN(), MEM_mallocN(), EdgeHash::nbuckets, EdgeHash::nentries, EdgeEntry::next, EdgeEntry::v0, EdgeEntry::v1, simple_enum_gen::val, and EdgeEntry::val.
Referenced by applyModifier(), arrayModifier_doArray(), BKE_mesh_calc_edges(), BKE_mesh_validate_arrays(), BME_bmesh_to_derivedmesh(), BME_derivedmesh_to_bmesh(), CDDM_calc_edges(), cloth_build_springs(), createArc(), cutEdges(), explodeMesh(), get_marked_edge_info__orFlags(), hash_add_face(), laplacian_increase_edge_count(), mesh_to_curve(), select_linked_tfaces_with_seams(), smoothmesh_from_derivedmesh(), sph_springhash_build(), and ss_sync_from_uv().
void* BLI_edgehash_lookup | ( | EdgeHash * | eh, |
unsigned int | v0, | ||
unsigned int | v1 | ||
) |
Definition at line 146 of file edgehash.c.
References BLI_edgehash_lookup_p(), and NULL.
Referenced by BKE_mesh_validate_arrays(), BME_bmesh_to_derivedmesh(), BME_derivedmesh_to_bmesh(), createArc(), draw_mesh_face_select__setHiddenOpts(), draw_mesh_face_select__setSelectOpts(), edgecut_get(), laplacian_edge_count(), smoothmesh_from_derivedmesh(), and sph_force_cb().
void** BLI_edgehash_lookup_p | ( | EdgeHash * | eh, |
unsigned int | v0, | ||
unsigned int | v1 | ||
) |
Definition at line 131 of file edgehash.c.
References EdgeHash::buckets, credits_svn_gen::e, EDGE_HASH, EDGE_ORD, hash, EdgeHash::nbuckets, EdgeEntry::next, NULL, EdgeEntry::v0, EdgeEntry::v1, and EdgeEntry::val.
Referenced by BLI_edgehash_haskey(), BLI_edgehash_lookup(), get_marked_edge_info__orFlags(), laplacian_increase_edge_count(), and mergeArcEdges().
EdgeHash* BLI_edgehash_new | ( | void | ) |
Definition at line 78 of file edgehash.c.
References _ehash_hashsizes, BLI_mempool_create(), EdgeHash::buckets, EdgeHash::cursize, EdgeHash::epool, FALSE, MEM_callocN(), EdgeHash::nbuckets, EdgeHash::nentries, and TRUE.
Referenced by applyModifier(), arrayModifier_doArray(), BKE_mesh_calc_edges(), BKE_mesh_validate_arrays(), BME_bmesh_to_derivedmesh(), BME_derivedmesh_to_bmesh(), CDDM_calc_edges(), cloth_build_springs(), cutEdges(), dm_calc_normal(), EM_make_hq_normals(), explodeMesh(), get_tface_mesh_marked_edge_info(), laplacian_system_construct_end(), mesh_to_curve(), newReebGraph(), select_linked_tfaces_with_seams(), smoothmesh_from_derivedmesh(), sph_springhash_build(), and ss_sync_from_uv().
int BLI_edgehash_size | ( | EdgeHash * | eh | ) |
Definition at line 158 of file edgehash.c.
References EdgeHash::nentries.
Referenced by BKE_mesh_calc_edges(), and CDDM_calc_edges().
void BLI_edgehashIterator_free | ( | EdgeHashIterator * | ehi | ) |
Definition at line 217 of file edgehash.c.
References MEM_freeN().
Referenced by applyModifier(), BKE_mesh_calc_edges(), CDDM_calc_edges(), cutEdges(), dm_calc_normal(), EM_make_hq_normals(), and explodeMesh().
void BLI_edgehashIterator_getKey | ( | EdgeHashIterator * | ehi, |
unsigned int * | v0_r, | ||
unsigned int * | v1_r | ||
) |
Definition at line 222 of file edgehash.c.
References EdgeHashIterator::curEntry, EdgeEntry::v0, and EdgeEntry::v1.
Referenced by applyModifier(), BKE_mesh_calc_edges(), CDDM_calc_edges(), cutEdges(), dm_calc_normal(), EM_make_hq_normals(), and explodeMesh().
void* BLI_edgehashIterator_getValue | ( | EdgeHashIterator * | ehi | ) |
Definition at line 229 of file edgehash.c.
References EdgeHashIterator::curEntry, NULL, and EdgeEntry::val.
Referenced by applyModifier(), BKE_mesh_calc_edges(), cutEdges(), dm_calc_normal(), EM_make_hq_normals(), and explodeMesh().
int BLI_edgehashIterator_isDone | ( | EdgeHashIterator * | ehi | ) |
Definition at line 255 of file edgehash.c.
References EdgeHashIterator::curEntry.
Referenced by applyModifier(), BKE_mesh_calc_edges(), CDDM_calc_edges(), cutEdges(), dm_calc_normal(), EM_make_hq_normals(), and explodeMesh().
EdgeHashIterator* BLI_edgehashIterator_new | ( | EdgeHash * | eh | ) |
Create a new EdgeHashIterator. The hash table must not be mutated while the iterator is in use, and the iterator will step exactly BLI_edgehash_size(gh) times before becoming done.
Definition at line 203 of file edgehash.c.
References EdgeHash::buckets, EdgeHashIterator::curBucket, EdgeHashIterator::curEntry, EdgeHashIterator::eh, MEM_mallocN(), EdgeHash::nbuckets, and NULL.
Referenced by applyModifier(), BKE_mesh_calc_edges(), CDDM_calc_edges(), cutEdges(), dm_calc_normal(), EM_make_hq_normals(), and explodeMesh().
void BLI_edgehashIterator_setValue | ( | EdgeHashIterator * | ehi, |
void * | val | ||
) |
Definition at line 234 of file edgehash.c.
References EdgeHashIterator::curEntry, EdgeEntry::val, and simple_enum_gen::val.
Referenced by cutEdges(), and explodeMesh().
void BLI_edgehashIterator_step | ( | EdgeHashIterator * | ehi | ) |
Definition at line 241 of file edgehash.c.
References EdgeHash::buckets, EdgeHashIterator::curBucket, EdgeHashIterator::curEntry, EdgeHashIterator::eh, EdgeHash::nbuckets, and EdgeEntry::next.
Referenced by applyModifier(), BKE_mesh_calc_edges(), CDDM_calc_edges(), cutEdges(), dm_calc_normal(), EM_make_hq_normals(), and explodeMesh().
unsigned int _ehash_hashsizes[] [static] |
{ 1, 3, 5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459 }
Definition at line 44 of file edgehash.c.
Referenced by BLI_edgehash_insert(), and BLI_edgehash_new().