Revision: 6191
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6191&view=rev
Author:   efiring
Date:     2008-10-14 22:45:31 +0000 (Tue, 14 Oct 2008)

Log Message:
-----------
Change nxutils.points_inside_poly to return an array of bool, not int.

Modified Paths:
--------------
    trunk/matplotlib/src/nxutils.c

Modified: trunk/matplotlib/src/nxutils.c
===================================================================
--- trunk/matplotlib/src/nxutils.c      2008-10-14 21:20:16 UTC (rev 6190)
+++ trunk/matplotlib/src/nxutils.c      2008-10-14 22:45:31 UTC (rev 6191)
@@ -45,7 +45,7 @@
   if (! PyArg_ParseTuple(args, "ddO", &x, &y, &vertsarg))
     return NULL;
 
-  verts = (PyArrayObject *) PyArray_FromObject(vertsarg,PyArray_DOUBLE, 2, 2);
+  verts = (PyArrayObject *) PyArray_FromObject(vertsarg,NPY_DOUBLE, 2, 2);
 
   if (verts == NULL)
     {
@@ -113,7 +113,7 @@
   if (! PyArg_ParseTuple(args, "OO", &xypointsarg, &vertsarg))
     return NULL;
 
-  verts = (PyArrayObject *) PyArray_FromObject(vertsarg,PyArray_DOUBLE, 2, 2);
+  verts = (PyArrayObject *) PyArray_FromObject(vertsarg, NPY_DOUBLE, 2, 2);
 
   if (verts == NULL)
     {
@@ -158,7 +158,7 @@
     //printf("adding vert: %1.3f, %1.3f\n", xv[i], yv[i]);
   }
 
-  xypoints = (PyArrayObject *) PyArray_FromObject(xypointsarg,PyArray_DOUBLE, 
2, 2);
+  xypoints = (PyArrayObject *) PyArray_FromObject(xypointsarg, NPY_DOUBLE, 2, 
2);
 
   if (xypoints == NULL)
     {
@@ -187,7 +187,7 @@
   npoints = xypoints->dimensions[0];
   dimensions[0] = npoints;
 
-  mask = (PyArrayObject *)PyArray_SimpleNew(1,dimensions,PyArray_INT);
+  mask = (PyArrayObject *)PyArray_SimpleNew(1,dimensions, NPY_BOOL);
   if (mask==NULL) {
     Py_XDECREF(verts);
     Py_XDECREF(xypoints);
@@ -200,7 +200,7 @@
     y = *(double *)(xypoints->data +  i*xypoints->strides[0] + 
xypoints->strides[1]);
     b = pnpoly_api(npol, xv, yv, x, y);
     //printf("checking %d, %d, %1.3f, %1.3f, %d\n", npol, npoints, x, y, b);
-    *(int *)(mask->data+i*mask->strides[0]) = b;
+    *(char *)(mask->data + i*mask->strides[0]) = b;
 
   }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to