Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-18 05:20:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-18 05:20:04 +0400
commit9cceec40c47543eb372bd9c1331901857b5f120a (patch)
tree0eb00b227a806279d6cf81593781dfd8656d5fd3 /source/blender/editors
parent2fefbf24a50c3cba1fe9ba984e9cfaeec4eae4a5 (diff)
use modified vertex coords for calculating display thickness and intersections.
internal improvement to editmesh_bvh.c - optionally pass cage-coords as an arg, rather then calculating the coords in BKE_bmbvh_new(), since all callers already have coords calculated. - de-duplicate coords creation function from knife and bmbvhm, move into own generic function: BKE_editmesh_vertexCos_get()
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c31
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c4
-rw-r--r--source/blender/editors/transform/transform.c2
3 files changed, 7 insertions, 30 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 022e753dd40..040a40c470a 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -2954,20 +2954,6 @@ static void knifetool_exit(bContext *C, wmOperator *op)
op->customdata = NULL;
}
-static void cage_mapped_verts_callback(void *userData, int index, const float co[3],
- const float UNUSED(no_f[3]), const short UNUSED(no_s[3]))
-{
- void **data = userData;
- BMEditMesh *em = data[0];
- float (*cagecos)[3] = data[1];
- SmallHash *hash = data[2];
-
- if (index >= 0 && index < em->bm->totvert && !BLI_smallhash_haskey(hash, index)) {
- BLI_smallhash_insert(hash, index, NULL);
- copy_v3_v3(cagecos[index], co);
- }
-}
-
static void knifetool_update_mval(KnifeTool_OpData *kcd, const float mval[2])
{
knife_recalc_projmat(kcd);
@@ -2990,9 +2976,6 @@ static void knifetool_init(bContext *C, KnifeTool_OpData *kcd,
{
Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
- DerivedMesh *cage, *final;
- SmallHash shash;
- void *data[3];
/* assign the drawing handle for drawing preview line... */
kcd->ob = obedit;
@@ -3004,20 +2987,12 @@ static void knifetool_init(bContext *C, KnifeTool_OpData *kcd,
BM_mesh_elem_index_ensure(kcd->em->bm, BM_VERT);
- cage = editbmesh_get_derived_cage_and_final(scene, obedit, kcd->em, &final, CD_MASK_DERIVEDMESH);
- kcd->cagecos = MEM_callocN(sizeof(float) * 3 * kcd->em->bm->totvert, "knife cagecos");
- data[0] = kcd->em;
- data[1] = kcd->cagecos;
- data[2] = &shash;
-
- BLI_smallhash_init(&shash);
- cage->foreachMappedVert(cage, cage_mapped_verts_callback, data);
- BLI_smallhash_release(&shash);
+ kcd->cagecos = BKE_editmesh_vertexCos_get(kcd->em, scene, NULL);
kcd->bmbvh = BKE_bmbvh_new(kcd->em,
- (BMBVH_USE_CAGE | BMBVH_RETURN_ORIG) |
+ BMBVH_RETURN_ORIG |
(only_select ? BMBVH_RESPECT_SELECT : BMBVH_RESPECT_HIDDEN),
- scene);
+ kcd->cagecos, false);
kcd->arena = BLI_memarena_new(1 << 15, "knife");
kcd->vthresh = KMAXDIST - 1;
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 01e3ed4f4cb..819a8f78e6c 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -1166,7 +1166,7 @@ void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const bool use_select)
ED_mesh_mirrtopo_init(me, -1, &mesh_topo_store, true);
}
else {
- tree = BKE_bmbvh_new(em, 0, NULL);
+ tree = BKE_bmbvh_new(em, 0, NULL, false);
}
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
@@ -1379,6 +1379,8 @@ int EDBM_view3d_poll(bContext *C)
return 0;
}
+
+
/* -------------------------------------------------------------------- */
/* BMBVH functions */
// XXX
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 487c26aaf54..ca73405fb16 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -5176,7 +5176,7 @@ static int createEdgeSlideVerts(TransInfo *t)
use_btree_disp = (v3d && t->obedit->dt > OB_WIRE && v3d->drawtype > OB_WIRE);
if (use_btree_disp) {
- btree = BKE_bmbvh_new(em, BMBVH_RESPECT_HIDDEN, NULL);
+ btree = BKE_bmbvh_new(em, BMBVH_RESPECT_HIDDEN, NULL, false);
}
else {
btree = NULL;