[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41775] trunk/blender/source/blender/ python/mathutils/mathutils_geometry.c: formatting edits only - no functional changes
Campbell Barton
ideasman42 at gmail.com
Sun Nov 13 10:38:54 CET 2011
Revision: 41775
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41775
Author: campbellbarton
Date: 2011-11-13 09:38:53 +0000 (Sun, 13 Nov 2011)
Log Message:
-----------
formatting edits only - no functional changes
Modified Paths:
--------------
trunk/blender/source/blender/python/mathutils/mathutils_geometry.c
Modified: trunk/blender/source/blender/python/mathutils/mathutils_geometry.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_geometry.c 2011-11-13 09:20:04 UTC (rev 41774)
+++ trunk/blender/source/blender/python/mathutils/mathutils_geometry.c 2011-11-13 09:38:53 UTC (rev 41775)
@@ -85,7 +85,14 @@
float det, inv_det, u, v, t;
int clip= 1;
- if (!PyArg_ParseTuple(args, "O!O!O!O!O!|i:intersect_ray_tri", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &ray, &vector_Type, &ray_off , &clip)) {
+ if (!PyArg_ParseTuple(args,
+ "O!O!O!O!O!|i:intersect_ray_tri",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3,
+ &vector_Type, &ray,
+ &vector_Type, &ray_off, &clip))
+ {
return NULL;
}
if (vec1->size != 3 || vec2->size != 3 || vec3->size != 3 || ray->size != 3 || ray_off->size != 3) {
@@ -94,8 +101,14 @@
return NULL;
}
- if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1 || BaseMath_ReadCallback(vec3) == -1 || BaseMath_ReadCallback(ray) == -1 || BaseMath_ReadCallback(ray_off) == -1)
+ if ( BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1 ||
+ BaseMath_ReadCallback(ray) == -1 ||
+ BaseMath_ReadCallback(ray_off) == -1)
+ {
return NULL;
+ }
copy_v3_v3(v1, vec1->vec);
copy_v3_v3(v2, vec2->vec);
@@ -173,17 +186,28 @@
VectorObject *vec1, *vec2, *vec3, *vec4;
float v1[3], v2[3], v3[3], v4[3], i1[3], i2[3];
- if (!PyArg_ParseTuple(args, "O!O!O!O!:intersect_line_line", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &vec4)) {
+ if (!PyArg_ParseTuple(args, "O!O!O!O!:intersect_line_line",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3,
+ &vector_Type, &vec4))
+ {
return NULL;
}
+
if (vec1->size != vec2->size || vec1->size != vec3->size || vec3->size != vec2->size) {
PyErr_SetString(PyExc_ValueError,
"vectors must be of the same size");
return NULL;
}
- if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1 || BaseMath_ReadCallback(vec3) == -1 || BaseMath_ReadCallback(vec4) == -1)
+ if ( BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1 ||
+ BaseMath_ReadCallback(vec4) == -1)
+ {
return NULL;
+ }
if (vec1->size == 3 || vec1->size == 2) {
int result;
@@ -257,9 +281,14 @@
float n[3];
if (PyTuple_GET_SIZE(args) == 3) {
- if (!PyArg_ParseTuple(args, "O!O!O!:normal", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3)) {
+ if (!PyArg_ParseTuple(args, "O!O!O!:normal",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3))
+ {
return NULL;
}
+
if (vec1->size != vec2->size || vec1->size != vec3->size) {
PyErr_SetString(PyExc_ValueError,
"vectors must be of the same size");
@@ -271,13 +300,22 @@
return NULL;
}
- if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1 || BaseMath_ReadCallback(vec3) == -1)
+ if ( BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1)
+ {
return NULL;
+ }
normal_tri_v3(n, vec1->vec, vec2->vec, vec3->vec);
}
else {
- if (!PyArg_ParseTuple(args, "O!O!O!O!:normal", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3, &vector_Type, &vec4)) {
+ if (!PyArg_ParseTuple(args, "O!O!O!O!:normal",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3,
+ &vector_Type, &vec4))
+ {
return NULL;
}
if (vec1->size != vec2->size || vec1->size != vec3->size || vec1->size != vec4->size) {
@@ -291,8 +329,13 @@
return NULL;
}
- if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1 || BaseMath_ReadCallback(vec3) == -1 || BaseMath_ReadCallback(vec4) == -1)
+ if ( BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1 ||
+ BaseMath_ReadCallback(vec4) == -1)
+ {
return NULL;
+ }
normal_quad_v3(n, vec1->vec, vec2->vec, vec3->vec, vec4->vec);
}
@@ -319,7 +362,11 @@
{
VectorObject *vec1, *vec2, *vec3;
- if (!PyArg_ParseTuple(args, "O!O!O!:area_tri", &vector_Type, &vec1, &vector_Type, &vec2, &vector_Type, &vec3)) {
+ if (!PyArg_ParseTuple(args, "O!O!O!:area_tri",
+ &vector_Type, &vec1,
+ &vector_Type, &vec2,
+ &vector_Type, &vec3))
+ {
return NULL;
}
@@ -329,8 +376,12 @@
return NULL;
}
- if (BaseMath_ReadCallback(vec1) == -1 || BaseMath_ReadCallback(vec2) == -1 || BaseMath_ReadCallback(vec3) == -1)
+ if ( BaseMath_ReadCallback(vec1) == -1 ||
+ BaseMath_ReadCallback(vec2) == -1 ||
+ BaseMath_ReadCallback(vec3) == -1)
+ {
return NULL;
+ }
if (vec1->size == 3) {
return PyFloat_FromDouble(area_tri_v3(vec1->vec, vec2->vec, vec3->vec));
@@ -367,16 +418,21 @@
VectorObject *line_a1, *line_a2, *line_b1, *line_b2;
float vi[2];
if (!PyArg_ParseTuple(args, "O!O!O!O!:intersect_line_line_2d",
- &vector_Type, &line_a1,
- &vector_Type, &line_a2,
- &vector_Type, &line_b1,
- &vector_Type, &line_b2)
- ) {
+ &vector_Type, &line_a1,
+ &vector_Type, &line_a2,
+ &vector_Type, &line_b1,
+ &vector_Type, &line_b2))
+ {
return NULL;
}
- if (BaseMath_ReadCallback(line_a1) == -1 || BaseMath_ReadCallback(line_a2) == -1 || BaseMath_ReadCallback(line_b1) == -1 || BaseMath_ReadCallback(line_b2) == -1)
+ if ( BaseMath_ReadCallback(line_a1) == -1 ||
+ BaseMath_ReadCallback(line_a2) == -1 ||
+ BaseMath_ReadCallback(line_b1) == -1 ||
+ BaseMath_ReadCallback(line_b2) == -1)
+ {
return NULL;
+ }
if (isect_seg_seg_v2_point(line_a1->vec, line_a2->vec, line_b1->vec, line_b2->vec, vi) == 1) {
return newVectorObject(vi, 2, Py_NEW, NULL);
@@ -411,20 +467,20 @@
int no_flip= 0;
float isect[3];
if (!PyArg_ParseTuple(args, "O!O!O!O!|i:intersect_line_plane",
- &vector_Type, &line_a,
- &vector_Type, &line_b,
- &vector_Type, &plane_co,
- &vector_Type, &plane_no,
- &no_flip)
- ) {
+ &vector_Type, &line_a,
+ &vector_Type, &line_b,
+ &vector_Type, &plane_co,
+ &vector_Type, &plane_no,
+ &no_flip))
+ {
return NULL;
}
if ( BaseMath_ReadCallback(line_a) == -1 ||
BaseMath_ReadCallback(line_b) == -1 ||
BaseMath_ReadCallback(plane_co) == -1 ||
- BaseMath_ReadCallback(plane_no) == -1
- ) {
+ BaseMath_ReadCallback(plane_no) == -1)
+ {
return NULL;
}
@@ -471,18 +527,18 @@
float isect_b[3];
if (!PyArg_ParseTuple(args, "O!O!O!f|i:intersect_line_sphere",
- &vector_Type, &line_a,
- &vector_Type, &line_b,
- &vector_Type, &sphere_co,
- &sphere_radius, &clip)
- ) {
+ &vector_Type, &line_a,
+ &vector_Type, &line_b,
+ &vector_Type, &sphere_co,
+ &sphere_radius, &clip))
+ {
return NULL;
}
- if ( BaseMath_ReadCallback(line_a) == -1 ||
+ if ( BaseMath_ReadCallback(line_a) == -1 ||
BaseMath_ReadCallback(line_b) == -1 ||
- BaseMath_ReadCallback(sphere_co) == -1
- ) {
+ BaseMath_ReadCallback(sphere_co) == -1)
+ {
return NULL;
}
@@ -551,18 +607,18 @@
float isect_b[3];
if (!PyArg_ParseTuple(args, "O!O!O!f|i:intersect_line_sphere_2d",
- &vector_Type, &line_a,
- &vector_Type, &line_b,
- &vector_Type, &sphere_co,
- &sphere_radius, &clip)
- ) {
+ &vector_Type, &line_a,
+ &vector_Type, &line_b,
+ &vector_Type, &sphere_co,
+ &sphere_radius, &clip))
+ {
return NULL;
}
if ( BaseMath_ReadCallback(line_a) == -1 ||
BaseMath_ReadCallback(line_b) == -1 ||
- BaseMath_ReadCallback(sphere_co) == -1
- ) {
+ BaseMath_ReadCallback(sphere_co) == -1)
+ {
return NULL;
}
else {
@@ -617,16 +673,20 @@
PyObject *ret;
if (!PyArg_ParseTuple(args, "O!O!O!:intersect_point_line",
- &vector_Type, &pt,
- &vector_Type, &line_1,
- &vector_Type, &line_2)
- ) {
+ &vector_Type, &pt,
+ &vector_Type, &line_1,
+ &vector_Type, &line_2))
+ {
return NULL;
}
-
- if (BaseMath_ReadCallback(pt) == -1 || BaseMath_ReadCallback(line_1) == -1 || BaseMath_ReadCallback(line_2) == -1)
+
+ if ( BaseMath_ReadCallback(pt) == -1 ||
+ BaseMath_ReadCallback(line_1) == -1 ||
+ BaseMath_ReadCallback(line_2) == -1)
+ {
return NULL;
-
+ }
+
/* accept 2d verts */
if (pt->size==3) { copy_v3_v3(pt_in, pt->vec);}
else { pt_in[2]=0.0; copy_v2_v2(pt_in, pt->vec); }
@@ -666,17 +726,22 @@
VectorObject *pt_vec, *tri_p1, *tri_p2, *tri_p3;
if (!PyArg_ParseTuple(args, "O!O!O!O!:intersect_point_tri_2d",
- &vector_Type, &pt_vec,
- &vector_Type, &tri_p1,
- &vector_Type, &tri_p2,
- &vector_Type, &tri_p3)
- ) {
+ &vector_Type, &pt_vec,
+ &vector_Type, &tri_p1,
+ &vector_Type, &tri_p2,
+ &vector_Type, &tri_p3))
+ {
return NULL;
}
- if (BaseMath_ReadCallback(pt_vec) == -1 || BaseMath_ReadCallback(tri_p1) == -1 || BaseMath_ReadCallback(tri_p2) == -1 || BaseMath_ReadCallback(tri_p3) == -1)
+ if ( BaseMath_ReadCallback(pt_vec) == -1 ||
+ BaseMath_ReadCallback(tri_p1) == -1 ||
+ BaseMath_ReadCallback(tri_p2) == -1 ||
+ BaseMath_ReadCallback(tri_p3) == -1)
+ {
return NULL;
-
+ }
+
return PyLong_FromLong(isect_point_tri_v2(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec));
}
@@ -702,18 +767,24 @@
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list