I have the following C function which I'm trying to SWIG-ify:
void GetAttOrder(int node, DCE_ORDER order, float att[3]);
which I want to call in Python and access via:
node = 0; order = DCD_TYPR;
attitude = GetAttOrder(node, order);
attitude[0] // 45.232
Where I've previously implemented the DCE_ORDER type as
typedef enum
{
DCD_TPYR = 0,
DCD_TYPR,
DCD_TYRP,
...
DCD_PRYT
} DCE_ORDER;
I've found some documentation on similar problems in the SWIG documentation, but I haven't had any luck implementing a solution. I've also looked into some other stackoverflow questions (this one seems suspiciously close), also to no avail. I suspect that I should use a typemap here, but am young and foolish when it comes to SWIG.
Any suggestions or pointers?
Many thanks.
float* GetAttOrder(int node, DCE_ORDER order)which calls yourGetAttOrder? I believe SWIG knows how to treat a pointer return as a Python list.