[Bf-blender-cvs] [8313794] mathutils_bvhtree: cleanup
Campbell Barton
noreply at git.blender.org
Wed Jul 15 18:41:03 CEST 2015
Commit: 83137948f45cf9690165690299e40b99d28d1773
Author: Campbell Barton
Date: Thu Jul 16 02:36:28 2015 +1000
Branches: mathutils_bvhtree
https://developer.blender.org/rB83137948f45cf9690165690299e40b99d28d1773
cleanup
===================================================================
M source/blender/python/mathutils/mathutils_bvhtree.c
===================================================================
diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c
index 00b2214..6fc2fa5 100644
--- a/source/blender/python/mathutils/mathutils_bvhtree.c
+++ b/source/blender/python/mathutils/mathutils_bvhtree.c
@@ -117,7 +117,9 @@ static const float max_dist_default = 1.844674352395373e+19f;
/* Utility helper functions */
/* return various derived meshes based on requested settings */
-static DerivedMesh *bvh_get_derived_mesh(const char *funcname, struct Scene *scene, Object *ob, bool use_deform, bool use_render, bool use_cage)
+static DerivedMesh *bvh_get_derived_mesh(
+ const char *funcname, struct Scene *scene, Object *ob,
+ bool use_deform, bool use_render, bool use_cage)
{
/* we only need minimum mesh data for topology and vertex locations */
CustomDataMask mask = CD_MASK_BAREMESH;
@@ -448,7 +450,9 @@ static PyObject *py_BVHTreeDerivedMesh_ray_cast(PyBVHTree_DerivedMesh *self, PyO
meshdata->raycast_callback, meshdata) != -1)
{
if (hit.dist <= max_dist) {
- int ret_index = self->use_poly_index ? dm_tessface_to_poly_index(ob->derivedFinal, hit.index) : hit.index;
+ int ret_index = self->use_poly_index ?
+ dm_tessface_to_poly_index(ob->derivedFinal, hit.index) :
+ hit.index;
return bvhtree_ray_hit_to_py(hit.co, hit.no, ret_index, hit.dist);
}
}
@@ -481,7 +485,9 @@ static PyObject *py_BVHTreeDerivedMesh_find_nearest(PyBVHTree_DerivedMesh *self,
if (BLI_bvhtree_find_nearest(meshdata->tree, co, &nearest,
meshdata->nearest_callback, meshdata) != -1)
{
- int ret_index = self->use_poly_index ? dm_tessface_to_poly_index(ob->derivedFinal, nearest.index) : nearest.index;
+ int ret_index = self->use_poly_index ?
+ dm_tessface_to_poly_index(ob->derivedFinal, nearest.index) :
+ nearest.index;
return bvhtree_nearest_to_py(nearest.co, nearest.no, ret_index, sqrtf(nearest.dist_sq));
}
}
@@ -502,7 +508,7 @@ PyDoc_STRVAR(py_BVHTreeDerivedMesh_doc,
"\n"
" :arg object: Mesh object.\n"
" :type object: :class:`Object`\n"
-" :art type: Type of geometry to use for this tree.\n"
+" :arg type: Type of geometry to use for this tree.\n"
" :type type: :string in [" PYBVH_DM_TYPES_STR "]\n"
);
PyTypeObject PyBVHTreeDerivedMesh_Type = {
@@ -648,7 +654,9 @@ static PyObject *py_BVHTreeBMesh_find_nearest(PyBVHTree_BMesh *self, PyObject *a
nearest_vert = BKE_bmbvh_find_vert_closest(bmdata, co, max_dist);
if (nearest_vert) {
- return bvhtree_nearest_to_py(nearest_vert->co, nearest_vert->no, BM_elem_index_get(nearest_vert), len_v3v3(co, nearest_vert->co));
+ return bvhtree_nearest_to_py(
+ nearest_vert->co, nearest_vert->no,
+ BM_elem_index_get(nearest_vert), len_v3v3(co, nearest_vert->co));
}
}
@@ -962,15 +970,17 @@ PyDoc_STRVAR(py_BVHTreeCustom_doc,
"\n"
" BVH tree constructed from custom geometry data.\n"
"\n"
-" :arg vertices: float triplets each representing (X, Y, Z) eg: [(0.0, 1.0, 0.5), ...].\n"
+" :arg vertices: float triplets each representing (X, Y, Z)\n"
+" eg: [(0.0, 1.0, 0.5), ...].\n"
" :type vertices: :float triplet sequence\n"
-" :art triangles: triangles, each containing three indices to the vertices argument. eg: [(5, 6, 9), (1, 2, 3), ...]\n"
+" :arg triangles: triangles, each containing three indices to the vertices argument.\n"
+" eg: [(5, 6, 9), (1, 2, 3), ...]\n"
" :type triangles: :int tuple sequence\n"
);
PyTypeObject PyBVHTreeCustom_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "BVHTreeCustom", /* tp_name */
- sizeof(PyBVHTree_Custom), /* tp_basicsize */
+ "BVHTreeCustom", /* tp_name */
+ sizeof(PyBVHTree_Custom), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
(destructor)PyBVHTreeCustom__tp_dealloc,/* tp_dealloc */
@@ -989,14 +999,14 @@ PyTypeObject PyBVHTreeCustom_Type = {
NULL, /* tp_setattro */
NULL, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
- py_BVHTreeCustom_doc, /* Documentation string */
+ py_BVHTreeCustom_doc, /* Documentation string */
NULL, /* tp_traverse */
NULL, /* tp_clear */
NULL, /* tp_richcompare */
0, /* tp_weaklistoffset */
NULL, /* tp_iter */
NULL, /* tp_iternext */
- (struct PyMethodDef *)PyBVHTreeCustom_methods, /* tp_methods */
+ (PyMethodDef *)PyBVHTreeCustom_methods, /* tp_methods */
NULL, /* tp_members */
NULL, /* tp_getset */
NULL, /* tp_base */
@@ -1004,7 +1014,7 @@ PyTypeObject PyBVHTreeCustom_Type = {
NULL, /* tp_descr_get */
NULL, /* tp_descr_set */
0, /* tp_dictoffset */
- (initproc)PyBVHTreeCustom__tp_init, /* tp_init */
+ (initproc)PyBVHTreeCustom__tp_init, /* tp_init */
(allocfunc)PyType_GenericAlloc, /* tp_alloc */
(newfunc)PyType_GenericNew, /* tp_new */
(freefunc)0, /* tp_free */
More information about the Bf-blender-cvs
mailing list