I have some C++ code wrapped using SWIG, and want to map a simple array of objects to a Python list. A much simplified example:
class Point {
int x;
int y;
};
class Polygon {
Point *ptlist();
int numPoints();
...
};
I want to be able to access ptlist() in Python as a sequence of Points, but can't find any obvious way of doing this using e.g. %extend or typemaps. Any help would be appreciated.