[Bf-blender-cvs] [35ed748] master: Mesh API: rename 'octree' to 'spatial' since internally its using kdtree

Campbell Barton noreply at git.blender.org
Wed Mar 12 15:50:16 CET 2014


Commit: 35ed7486c76f11b397d0ff131160f8629af3b49b
Author: Campbell Barton
Date:   Thu Mar 13 01:46:21 2014 +1100
https://developer.blender.org/rB35ed7486c76f11b397d0ff131160f8629af3b49b

Mesh API: rename 'octree' to 'spatial' since internally its using kdtree

===================================================================

M	source/blender/editors/armature/armature_skinning.c
M	source/blender/editors/include/ED_mesh.h
M	source/blender/editors/mesh/editmesh_utils.c
M	source/blender/editors/mesh/meshtools.c
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/object/object_shapekey.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/util/ed_util.c
M	source/blenderplayer/bad_level_call_stubs/stubs.c

===================================================================

diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c
index 7ec0acf..8628627 100644
--- a/source/blender/editors/armature/armature_skinning.c
+++ b/source/blender/editors/armature/armature_skinning.c
@@ -403,7 +403,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
 	}
 
 	/* only generated in some cases but can call anyway */
-	mesh_octree_table(ob, NULL, NULL, 'e');
+	ED_mesh_mirror_spatial_table(ob, NULL, NULL, 'e');
 
 	/* free the memory allocated */
 	MEM_freeN(bonelist);
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 2d7e558..6c07e5e 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -301,8 +301,8 @@ int         join_mesh_exec(struct bContext *C, struct wmOperator *op);
 int         join_mesh_shapes_exec(struct bContext *C, struct wmOperator *op);
 
 /* mirror lookup api */
-int         mesh_octree_table(struct Object *ob, struct BMEditMesh *em, const float co[3], char mode);
-int         mesh_mirrtopo_table(struct Object *ob, char mode);
+int         ED_mesh_mirror_spatial_table(struct Object *ob, struct BMEditMesh *em, const float co[3], char mode);
+int         ED_mesh_mirror_topo_table(struct Object *ob, char mode);
 
 /* retrieves mirrored cache vert, or NULL if there isn't one.
  * note: calling this without ensuring the mirror cache state
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 4d5fbda..b84a0cc 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -402,8 +402,8 @@ void EDBM_mesh_free(BMEditMesh *em)
 	/* These tables aren't used yet, so it's not strictly necessary
 	 * to 'end' them (with 'e' param) but if someone tries to start
 	 * using them, having these in place will save a lot of pain */
-	mesh_octree_table(NULL, NULL, NULL, 'e');
-	mesh_mirrtopo_table(NULL, 'e');
+	ED_mesh_mirror_spatial_table(NULL, NULL, NULL, 'e');
+	ED_mesh_mirror_topo_table(NULL, 'e');
 
 	BKE_editmesh_free(em);
 }
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 8047959..5558e6f 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -670,11 +670,11 @@ static struct { void *tree; } MirrKdStore = {NULL};
 
 /* mode is 's' start, or 'e' end, or 'u' use */
 /* if end, ob can be NULL */
-int mesh_octree_table(Object *ob, BMEditMesh *em, const float co[3], char mode)
+int ED_mesh_mirror_spatial_table(Object *ob, BMEditMesh *em, const float co[3], char mode)
 {
 	if (mode == 'u') {        /* use table */
 		if (MirrKdStore.tree == NULL)
-			mesh_octree_table(ob, em, NULL, 's');
+			ED_mesh_mirror_spatial_table(ob, em, NULL, 's');
 
 		if (MirrKdStore.tree) {
 			KDTreeNearest nearest;
@@ -696,7 +696,7 @@ int mesh_octree_table(Object *ob, BMEditMesh *em, const float co[3], char mode)
 		int totvert;
 
 		if (MirrKdStore.tree) /* happens when entering this call without ending it */
-			mesh_octree_table(ob, em, co, 'e');
+			ED_mesh_mirror_spatial_table(ob, em, co, 'e');
 
 		if (em && me->edit_btmesh == em) {
 			totvert = em->bm->totvert;
@@ -758,11 +758,11 @@ static MirrTopoStore_t mesh_topo_store = {NULL, -1. - 1, -1};
 /* mode is 's' start, or 'e' end, or 'u' use */
 /* if end, ob can be NULL */
 /* note, is supposed return -1 on error, which callers are currently checking for, but is not used so far */
-int mesh_mirrtopo_table(Object *ob, char mode)
+int ED_mesh_mirror_topo_table(Object *ob, char mode)
 {
 	if (mode == 'u') {        /* use table */
 		if (ED_mesh_mirrtopo_recalc_check(ob->data, ob->mode, &mesh_topo_store)) {
-			mesh_mirrtopo_table(ob, 's');
+			ED_mesh_mirror_topo_table(ob, 's');
 		}
 	}
 	else if (mode == 's') { /* start table */
@@ -792,12 +792,12 @@ static int mesh_get_x_mirror_vert_spatial(Object *ob, int index)
 	vec[1] = mvert->co[1];
 	vec[2] = mvert->co[2];
 	
-	return mesh_octree_table(ob, NULL, vec, 'u');
+	return ED_mesh_mirror_spatial_table(ob, NULL, vec, 'u');
 }
 
 static int mesh_get_x_mirror_vert_topo(Object *ob, int index)
 {
-	if (mesh_mirrtopo_table(ob, 'u') == -1)
+	if (ED_mesh_mirror_topo_table(ob, 'u') == -1)
 		return -1;
 
 	return mesh_topo_store.index_lookup[index];
@@ -830,7 +830,7 @@ static BMVert *editbmesh_get_x_mirror_vert_spatial(Object *ob, BMEditMesh *em, c
 	vec[1] = co[1];
 	vec[2] = co[2];
 	
-	i = mesh_octree_table(ob, em, vec, 'u');
+	i = ED_mesh_mirror_spatial_table(ob, em, vec, 'u');
 	if (i != -1) {
 		return BM_vert_at_index(em->bm, i);
 	}
@@ -840,7 +840,7 @@ static BMVert *editbmesh_get_x_mirror_vert_spatial(Object *ob, BMEditMesh *em, c
 static BMVert *editbmesh_get_x_mirror_vert_topo(Object *ob, struct BMEditMesh *em, BMVert *eve, int index)
 {
 	intptr_t poinval;
-	if (mesh_mirrtopo_table(ob, 'u') == -1)
+	if (ED_mesh_mirror_topo_table(ob, 'u') == -1)
 		return NULL;
 
 	if (index == -1) {
@@ -1018,12 +1018,12 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em)
 	mirrorverts = MEM_callocN(sizeof(int) * me->totvert, "MirrorVerts");
 	mirrorfaces = MEM_callocN(sizeof(int) * 2 * me->totface, "MirrorFaces");
 
-	mesh_octree_table(ob, em, NULL, 's');
+	ED_mesh_mirror_spatial_table(ob, em, NULL, 's');
 
 	for (a = 0, mv = mvert; a < me->totvert; a++, mv++)
 		mirrorverts[a] = mesh_get_x_mirror_vert(ob, a, use_topology);
 
-	mesh_octree_table(ob, em, NULL, 'e');
+	ED_mesh_mirror_spatial_table(ob, em, NULL, 'e');
 
 	fhash = BLI_ghash_new_ex(mirror_facehash, mirror_facecmp, "mirror_facehash gh", me->totface);
 	for (a = 0, mf = mface; a < me->totface; a++, mf++)
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index b8caf02..201ce46 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -338,8 +338,8 @@ static bool ED_object_editmode_load_ex(Object *obedit, const bool freedata)
 			me->edit_btmesh = NULL;
 		}
 		if (obedit->restore_mode & OB_MODE_WEIGHT_PAINT) {
-			mesh_octree_table(NULL, NULL, NULL, 'e');
-			mesh_mirrtopo_table(NULL, 'e');
+			ED_mesh_mirror_spatial_table(NULL, NULL, NULL, 'e');
+			ED_mesh_mirror_topo_table(NULL, 'e');
 		}
 	}
 	else if (obedit->type == OB_ARMATURE) {
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index 3df4f72..5dd20a7 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -193,7 +193,7 @@ static bool object_shape_key_mirror(bContext *C, Object *ob,
 			float *fp1, *fp2;
 			float tvec[3];
 
-			mesh_octree_table(ob, NULL, NULL, 's');
+			ED_mesh_mirror_spatial_table(ob, NULL, NULL, 's');
 
 			for (i1 = 0, mv = me->mvert; i1 < me->totvert; i1++, mv++) {
 				i2 = mesh_get_x_mirror_vert(ob, i1, use_topology);
@@ -224,7 +224,7 @@ static bool object_shape_key_mirror(bContext *C, Object *ob,
 				}
 			}
 
-			mesh_octree_table(ob, NULL, NULL, 'e');
+			ED_mesh_mirror_spatial_table(ob, NULL, NULL, 'e');
 		}
 		else if (ob->type == OB_LATTICE) {
 			Lattice *lt = ob->data;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 12eb152..e058f92 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -2060,8 +2060,8 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
 		}
 
 		/* weight paint specific */
-		mesh_octree_table(NULL, NULL, NULL, 'e');
-		mesh_mirrtopo_table(NULL, 'e');
+		ED_mesh_mirror_spatial_table(NULL, NULL, NULL, 'e');
+		ED_mesh_mirror_topo_table(NULL, 'e');
 
 		paint_cursor_delete_textures();
 	}
@@ -2076,7 +2076,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
 		BKE_paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT);
 
 		/* weight paint specific */
-		mesh_octree_table(ob, NULL, NULL, 's');
+		ED_mesh_mirror_spatial_table(ob, NULL, NULL, 's');
 		ED_vgroup_sync_from_pose(ob);
 	}
 	
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index b4bd922..9aa00ae 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -5687,7 +5687,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
 		if (t->obedit->type == OB_MESH) {
 			BMEditMesh *em = BKE_editmesh_from_object(t->obedit);
 			/* table needs to be created for each edit command, since vertices can move etc */
-			mesh_octree_table(t->obedit, em, NULL, 'e');
+			ED_mesh_mirror_spatial_table(t->obedit, em, NULL, 'e');
 		}
 	}
 	else if ((t->flag & T_POSE) && (t->poseobj)) {
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 6e41fb9..b490d81 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -137,8 +137,8 @@ void ED_editors_exit(bContext *C)
 	}
 
 	/* global in meshtools... */
-	mesh_octree_table(NULL, NULL, NULL, 'e');
-	mesh_mirrtopo_table(NULL, 'e');
+	ED_mesh_mirror_spatial_table(NULL, NULL, NULL, 'e');
+	ED_mesh_mirror_topo_table(NULL, 'e');
 }
 
 /* flush any temp data from object editing to DNA before writing files,
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 9017248..bbece2a 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -457,8 +457,8 @@ float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vert
 void ED_vgroup_delete(struct Object *ob, struct bDeformGroup *defgroup) RET_NONE
 void ED_vgroup_clear(struct Object *ob) RET_NONE
 bool ED_vgroup_object_is_edit_mode(struct Object *ob) RET_ZERO
-int mesh_mirrtopo_table(struct Object *ob, char mode) RET_ZERO
-int mesh_octree_table(struct Object *ob, struct BMEditMesh *em, const float co[3], char mode) RET_ZERO
+int ED_mesh_mirror_topo_table(struct Object *ob, char mode) RET_ZERO
+int

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list