0

I have a C function:

int isInPolygon(Point testPoint, Point* polygon, int n);

and the point is a simple struct:

typedef struct  {
int x;
int y;} Point;

Also Polygon is a list of Points.I defined a typemap in interface for Point:

%typemap(in) (Point testPoint){
if (!PyTuple_Check($input)) {
    PyErr_SetString(PyExc_ValueError, "Expecting a point in a tupple!");
    return NULL;
}}

How can I do that for Polygon?

Farshid Ashouri
  • 16,143
  • 7
  • 52
  • 66

0 Answers0