1 |
jan |
1610 |
/* ---------------------------------------------------------------------------- |
2 |
|
|
* This file was automatically generated by SWIG (http://www.swig.org). |
3 |
|
|
* Version 1.3u-20010614-1939 (Alpha 5) |
4 |
|
|
* |
5 |
|
|
* This file is not intended to be easily readable and contains a number of |
6 |
|
|
* coding conventions designed to improve portability and efficiency. Do not make |
7 |
|
|
* changes to this file unless you know what you are doing--modify the SWIG |
8 |
|
|
* interface file instead. |
9 |
|
|
* ----------------------------------------------------------------------------- */ |
10 |
|
|
|
11 |
|
|
#define SWIGPYTHON |
12 |
|
|
/*********************************************************************** |
13 |
|
|
* common.swg |
14 |
|
|
* |
15 |
|
|
* This file contains generic SWIG runtime support for pointer |
16 |
|
|
* type checking as well as a few commonly used macros to control |
17 |
|
|
* external linkage. |
18 |
|
|
* |
19 |
|
|
* Author : David Beazley ([email protected]) |
20 |
|
|
* |
21 |
|
|
* Copyright (c) 1999-2000, The University of Chicago |
22 |
|
|
* |
23 |
|
|
* This file may be freely redistributed without license or fee provided |
24 |
|
|
* this copyright message remains intact. |
25 |
|
|
************************************************************************/ |
26 |
|
|
|
27 |
|
|
#include <string.h> |
28 |
|
|
|
29 |
|
|
#if defined(_WIN32) || defined(__WIN32__) |
30 |
|
|
# if defined(_MSC_VER) |
31 |
|
|
# if defined(STATIC_LINKED) |
32 |
|
|
# define SWIGEXPORT(a) a |
33 |
|
|
# else |
34 |
|
|
# define SWIGEXPORT(a) __declspec(dllexport) a |
35 |
|
|
# endif |
36 |
|
|
# else |
37 |
|
|
# if defined(__BORLANDC__) |
38 |
|
|
# define SWIGEXPORT(a) a _export |
39 |
|
|
# else |
40 |
|
|
# define SWIGEXPORT(a) a |
41 |
|
|
# endif |
42 |
|
|
#endif |
43 |
|
|
#else |
44 |
|
|
# define SWIGEXPORT(a) a |
45 |
|
|
#endif |
46 |
|
|
|
47 |
|
|
#ifdef SWIG_GLOBAL |
48 |
|
|
#define SWIGRUNTIME(a) SWIGEXPORT(a) |
49 |
|
|
#else |
50 |
|
|
#define SWIGRUNTIME(a) static a |
51 |
|
|
#endif |
52 |
|
|
|
53 |
|
|
#ifdef __cplusplus |
54 |
|
|
extern "C" { |
55 |
|
|
#endif |
56 |
|
|
|
57 |
|
|
typedef struct swig_type_info { |
58 |
|
|
char *name; |
59 |
|
|
void *(*converter)(void *); |
60 |
|
|
char *str; |
61 |
|
|
struct swig_type_info *next; |
62 |
|
|
struct swig_type_info *prev; |
63 |
|
|
} swig_type_info; |
64 |
|
|
|
65 |
|
|
#ifdef SWIG_NOINCLUDE |
66 |
|
|
SWIGEXPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); |
67 |
|
|
SWIGEXPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); |
68 |
|
|
SWIGEXPORT(void *) SWIG_TypeCast(swig_type_info *, void *); |
69 |
|
|
#else |
70 |
|
|
|
71 |
|
|
static swig_type_info *swig_type_list = 0; |
72 |
|
|
|
73 |
|
|
/* Register a type mapping with the type-checking */ |
74 |
|
|
SWIGRUNTIME(swig_type_info *) |
75 |
|
|
SWIG_TypeRegister(swig_type_info *ti) |
76 |
|
|
{ |
77 |
|
|
swig_type_info *tc, *head, *ret, *next; |
78 |
|
|
/* Check to see if this type has already been registered */ |
79 |
|
|
tc = swig_type_list; |
80 |
|
|
while (tc) { |
81 |
|
|
if (strcmp(tc->name, ti->name) == 0) { |
82 |
|
|
/* Already exists in the table. Just add additional types to the list */ |
83 |
|
|
head = tc; |
84 |
|
|
next = tc->next; |
85 |
|
|
goto l1; |
86 |
|
|
} |
87 |
|
|
tc = tc->prev; |
88 |
|
|
} |
89 |
|
|
head = ti; |
90 |
|
|
next = 0; |
91 |
|
|
|
92 |
|
|
/* Place in list */ |
93 |
|
|
ti->prev = swig_type_list; |
94 |
|
|
swig_type_list = ti; |
95 |
|
|
|
96 |
|
|
/* Build linked lists */ |
97 |
|
|
l1: |
98 |
|
|
ret = head; |
99 |
|
|
tc = ti + 1; |
100 |
|
|
/* Patch up the rest of the links */ |
101 |
|
|
while (tc->name) { |
102 |
|
|
head->next = tc; |
103 |
|
|
tc->prev = head; |
104 |
|
|
head = tc; |
105 |
|
|
tc++; |
106 |
|
|
} |
107 |
|
|
head->next = next; |
108 |
|
|
return ret; |
109 |
|
|
} |
110 |
|
|
|
111 |
|
|
/* Check the typename */ |
112 |
|
|
SWIGRUNTIME(swig_type_info *) |
113 |
|
|
SWIG_TypeCheck(char *c, swig_type_info *ty) |
114 |
|
|
{ |
115 |
|
|
swig_type_info *s; |
116 |
|
|
if (!ty) return 0; /* Void pointer */ |
117 |
|
|
s = ty->next; /* First element always just a name */ |
118 |
|
|
while (s) { |
119 |
|
|
if (strcmp(s->name,c) == 0) { |
120 |
|
|
if (s == ty->next) return s; |
121 |
|
|
/* Move s to the top of the linked list */ |
122 |
|
|
s->prev->next = s->next; |
123 |
|
|
if (s->next) { |
124 |
|
|
s->next->prev = s->prev; |
125 |
|
|
} |
126 |
|
|
/* Insert s as second element in the list */ |
127 |
|
|
s->next = ty->next; |
128 |
|
|
if (ty->next) ty->next->prev = s; |
129 |
|
|
ty->next = s; |
130 |
|
|
return s; |
131 |
|
|
} |
132 |
|
|
s = s->next; |
133 |
|
|
} |
134 |
|
|
return 0; |
135 |
|
|
} |
136 |
|
|
|
137 |
|
|
/* Cast a pointer (needed for C++ inheritance */ |
138 |
|
|
SWIGRUNTIME(void *) |
139 |
|
|
SWIG_TypeCast(swig_type_info *ty, void *ptr) |
140 |
|
|
{ |
141 |
|
|
if ((!ty) || (!ty->converter)) return ptr; |
142 |
|
|
return (*ty->converter)(ptr); |
143 |
|
|
} |
144 |
|
|
|
145 |
|
|
/* Search for a swig_type_info structure */ |
146 |
|
|
SWIGRUNTIME(void *) |
147 |
|
|
SWIG_TypeQuery(const char *name) { |
148 |
|
|
swig_type_info *ty = swig_type_list; |
149 |
|
|
while (ty) { |
150 |
|
|
if (ty->str && (strcmp(name,ty->str) == 0)) return ty; |
151 |
|
|
if (ty->name && (strcmp(name,ty->name) == 0)) return ty; |
152 |
|
|
ty = ty->prev; |
153 |
|
|
} |
154 |
|
|
return 0; |
155 |
|
|
} |
156 |
|
|
|
157 |
|
|
#endif |
158 |
|
|
|
159 |
|
|
#ifdef __cplusplus |
160 |
|
|
} |
161 |
|
|
#endif |
162 |
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
/*********************************************************************** |
166 |
|
|
* python.swg |
167 |
|
|
* |
168 |
|
|
* This file contains the runtime support for Python modules |
169 |
|
|
* and includes code for managing global variables and pointer |
170 |
|
|
* type checking. |
171 |
|
|
* |
172 |
|
|
* Author : David Beazley ([email protected]) |
173 |
|
|
************************************************************************/ |
174 |
|
|
|
175 |
|
|
#include <stdlib.h> |
176 |
|
|
#include "Python.h" |
177 |
|
|
|
178 |
|
|
#ifdef __cplusplus |
179 |
|
|
extern "C" { |
180 |
|
|
#endif |
181 |
|
|
|
182 |
|
|
#define SWIG_PY_INT 1 |
183 |
|
|
#define SWIG_PY_FLOAT 2 |
184 |
|
|
#define SWIG_PY_STRING 3 |
185 |
|
|
#define SWIG_PY_POINTER 4 |
186 |
|
|
|
187 |
|
|
/* Constant information structure */ |
188 |
|
|
typedef struct swig_const_info { |
189 |
|
|
int type; |
190 |
|
|
char *name; |
191 |
|
|
long lvalue; |
192 |
|
|
double dvalue; |
193 |
|
|
void *pvalue; |
194 |
|
|
swig_type_info **ptype; |
195 |
|
|
} swig_const_info; |
196 |
|
|
|
197 |
|
|
#ifdef SWIG_NOINCLUDE |
198 |
|
|
|
199 |
|
|
SWIGEXPORT(PyObject *) SWIG_newvarlink(); |
200 |
|
|
SWIGEXPORT(void) SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); |
201 |
|
|
SWIGEXPORT(int) SWIG_ConvertPtr(PyObject *, void **, swig_type_info *, int); |
202 |
|
|
SWIGEXPORT(void) SWIG_MakePtr(char *c, void *, swig_type_info *); |
203 |
|
|
SWIGEXPORT(PyObject *) SWIG_NewPointerObj(void *, swig_type_info *); |
204 |
|
|
SWIGEXPORT(void) SWIG_InstallConstants(PyObject *d, swig_const_info constants[]); |
205 |
|
|
|
206 |
|
|
#else |
207 |
|
|
|
208 |
|
|
/* ----------------------------------------------------------------------------- |
209 |
|
|
* global variable support code. |
210 |
|
|
* ----------------------------------------------------------------------------- */ |
211 |
|
|
|
212 |
|
|
typedef struct swig_globalvar { |
213 |
|
|
char *name; /* Name of global variable */ |
214 |
|
|
PyObject *(*get_attr)(void); /* Return the current value */ |
215 |
|
|
int (*set_attr)(PyObject *); /* Set the value */ |
216 |
|
|
struct swig_globalvar *next; |
217 |
|
|
} swig_globalvar; |
218 |
|
|
|
219 |
|
|
typedef struct swig_varlinkobject { |
220 |
|
|
PyObject_HEAD |
221 |
|
|
swig_globalvar *vars; |
222 |
|
|
} swig_varlinkobject; |
223 |
|
|
|
224 |
|
|
static PyObject * |
225 |
|
|
swig_varlink_repr(swig_varlinkobject *v) { |
226 |
|
|
v = v; |
227 |
|
|
return PyString_FromString("<Global variables>"); |
228 |
|
|
} |
229 |
|
|
|
230 |
|
|
static int |
231 |
|
|
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) { |
232 |
|
|
swig_globalvar *var; |
233 |
|
|
flags = flags; |
234 |
|
|
fprintf(fp,"Global variables { "); |
235 |
|
|
for (var = v->vars; var; var=var->next) { |
236 |
|
|
fprintf(fp,"%s", var->name); |
237 |
|
|
if (var->next) fprintf(fp,", "); |
238 |
|
|
} |
239 |
|
|
fprintf(fp," }\n"); |
240 |
|
|
return 0; |
241 |
|
|
} |
242 |
|
|
|
243 |
|
|
static PyObject * |
244 |
|
|
swig_varlink_getattr(swig_varlinkobject *v, char *n) { |
245 |
|
|
swig_globalvar *var = v->vars; |
246 |
|
|
while (var) { |
247 |
|
|
if (strcmp(var->name,n) == 0) { |
248 |
|
|
return (*var->get_attr)(); |
249 |
|
|
} |
250 |
|
|
var = var->next; |
251 |
|
|
} |
252 |
|
|
PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
253 |
|
|
return NULL; |
254 |
|
|
} |
255 |
|
|
|
256 |
|
|
static int |
257 |
|
|
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { |
258 |
|
|
swig_globalvar *var = v->vars; |
259 |
|
|
while (var) { |
260 |
|
|
if (strcmp(var->name,n) == 0) { |
261 |
|
|
return (*var->set_attr)(p); |
262 |
|
|
} |
263 |
|
|
var = var->next; |
264 |
|
|
} |
265 |
|
|
PyErr_SetString(PyExc_NameError,"Unknown C global variable"); |
266 |
|
|
return 1; |
267 |
|
|
} |
268 |
|
|
|
269 |
|
|
statichere PyTypeObject varlinktype = { |
270 |
|
|
PyObject_HEAD_INIT(0) |
271 |
|
|
0, |
272 |
|
|
"swigvarlink", /* Type name */ |
273 |
|
|
sizeof(swig_varlinkobject), /* Basic size */ |
274 |
|
|
0, /* Itemsize */ |
275 |
|
|
0, /* Deallocator */ |
276 |
|
|
(printfunc) swig_varlink_print, /* Print */ |
277 |
|
|
(getattrfunc) swig_varlink_getattr, /* get attr */ |
278 |
|
|
(setattrfunc) swig_varlink_setattr, /* Set attr */ |
279 |
|
|
0, /* tp_compare */ |
280 |
|
|
(reprfunc) swig_varlink_repr, /* tp_repr */ |
281 |
|
|
0, /* tp_as_number */ |
282 |
|
|
0, /* tp_as_mapping*/ |
283 |
|
|
0, /* tp_hash */ |
284 |
|
|
}; |
285 |
|
|
|
286 |
|
|
/* Create a variable linking object for use later */ |
287 |
|
|
SWIGRUNTIME(PyObject *) |
288 |
|
|
SWIG_newvarlink(void) { |
289 |
|
|
swig_varlinkobject *result = 0; |
290 |
|
|
result = PyMem_NEW(swig_varlinkobject,1); |
291 |
|
|
varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */ |
292 |
|
|
result->ob_type = &varlinktype; |
293 |
|
|
result->vars = 0; |
294 |
|
|
result->ob_refcnt = 0; |
295 |
|
|
Py_XINCREF((PyObject *) result); |
296 |
|
|
return ((PyObject*) result); |
297 |
|
|
} |
298 |
|
|
|
299 |
|
|
SWIGRUNTIME(void) |
300 |
|
|
SWIG_addvarlink(PyObject *p, char *name, |
301 |
|
|
PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { |
302 |
|
|
swig_varlinkobject *v; |
303 |
|
|
swig_globalvar *gv; |
304 |
|
|
v= (swig_varlinkobject *) p; |
305 |
|
|
gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); |
306 |
|
|
gv->name = (char *) malloc(strlen(name)+1); |
307 |
|
|
strcpy(gv->name,name); |
308 |
|
|
gv->get_attr = get_attr; |
309 |
|
|
gv->set_attr = set_attr; |
310 |
|
|
gv->next = v->vars; |
311 |
|
|
v->vars = gv; |
312 |
|
|
} |
313 |
|
|
/* Convert a pointer value */ |
314 |
|
|
SWIGRUNTIME(int) |
315 |
|
|
SWIG_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { |
316 |
|
|
unsigned long p; |
317 |
|
|
register int d; |
318 |
|
|
swig_type_info *tc; |
319 |
|
|
char *c; |
320 |
|
|
static PyObject *SWIG_this = 0; |
321 |
|
|
int newref = 0; |
322 |
|
|
|
323 |
|
|
if (!obj || (obj == Py_None)) { |
324 |
|
|
*ptr = 0; |
325 |
|
|
return 0; |
326 |
|
|
} |
327 |
|
|
#ifdef SWIG_COBJECT_TYPES |
328 |
|
|
if (!(PyCObject_Check(obj))) { |
329 |
|
|
if (!SWIG_this) |
330 |
|
|
SWIG_this = PyString_InternFromString("this"); |
331 |
|
|
obj = PyObject_GetAttr(obj,SWIG_this); |
332 |
|
|
newref = 1; |
333 |
|
|
if (!obj) goto type_error; |
334 |
|
|
if (!PyCObject_Check(obj)) { |
335 |
|
|
Py_DECREF(obj); |
336 |
|
|
goto type_error; |
337 |
|
|
} |
338 |
|
|
} |
339 |
|
|
*ptr = PyCObject_AsVoidPtr(obj); |
340 |
|
|
c = (char *) PyCObject_GetDesc(obj); |
341 |
|
|
if (newref) Py_DECREF(obj); |
342 |
|
|
goto cobject; |
343 |
|
|
#else |
344 |
|
|
if (!(PyString_Check(obj))) { |
345 |
|
|
if (!SWIG_this) |
346 |
|
|
SWIG_this = PyString_InternFromString("this"); |
347 |
|
|
obj = PyObject_GetAttr(obj,SWIG_this); |
348 |
|
|
newref = 1; |
349 |
|
|
if (!obj) goto type_error; |
350 |
|
|
if (!PyString_Check(obj)) { |
351 |
|
|
Py_DECREF(obj); |
352 |
|
|
goto type_error; |
353 |
|
|
} |
354 |
|
|
} |
355 |
|
|
c = PyString_AsString(obj); |
356 |
|
|
p = 0; |
357 |
|
|
/* Pointer values must start with leading underscore */ |
358 |
|
|
if (*c != '_') { |
359 |
|
|
*ptr = (void *) 0; |
360 |
|
|
if (strcmp(c,"NULL") == 0) { |
361 |
|
|
if (newref) Py_DECREF(obj); |
362 |
|
|
return 0; |
363 |
|
|
} else { |
364 |
|
|
if (newref) Py_DECREF(obj); |
365 |
|
|
goto type_error; |
366 |
|
|
} |
367 |
|
|
} |
368 |
|
|
c++; |
369 |
|
|
/* Extract hex value from pointer */ |
370 |
|
|
while ((d = *c)) { |
371 |
|
|
if ((d >= '0') && (d <= '9')) |
372 |
|
|
p = (p << 4) + (d - '0'); |
373 |
|
|
else if ((d >= 'a') && (d <= 'f')) |
374 |
|
|
p = (p << 4) + (d - ('a'-10)); |
375 |
|
|
else |
376 |
|
|
break; |
377 |
|
|
c++; |
378 |
|
|
} |
379 |
|
|
*ptr = (void *) p; |
380 |
|
|
if (newref) Py_DECREF(obj); |
381 |
|
|
#endif |
382 |
|
|
|
383 |
|
|
#ifdef SWIG_COBJECT_TYPES |
384 |
|
|
cobject: |
385 |
|
|
#endif |
386 |
|
|
|
387 |
|
|
if (ty) { |
388 |
|
|
tc = SWIG_TypeCheck(c,ty); |
389 |
|
|
if (!tc) goto type_error; |
390 |
|
|
*ptr = SWIG_TypeCast(tc,(void*)p); |
391 |
|
|
} |
392 |
|
|
return 0; |
393 |
|
|
|
394 |
|
|
type_error: |
395 |
|
|
|
396 |
|
|
if (flags) { |
397 |
|
|
if (ty) { |
398 |
|
|
char *temp = (char *) malloc(64+strlen(ty->name)); |
399 |
|
|
sprintf(temp,"Type error. Expected %s", ty->name); |
400 |
|
|
PyErr_SetString(PyExc_TypeError, temp); |
401 |
|
|
free((char *) temp); |
402 |
|
|
} else { |
403 |
|
|
PyErr_SetString(PyExc_TypeError,"Expected a pointer"); |
404 |
|
|
} |
405 |
|
|
} |
406 |
|
|
return -1; |
407 |
|
|
} |
408 |
|
|
|
409 |
|
|
/* Take a pointer and convert it to a string */ |
410 |
|
|
SWIGRUNTIME(void) |
411 |
|
|
SWIG_MakePtr(char *c, void *ptr, swig_type_info *ty) { |
412 |
|
|
static char hex[17] = "0123456789abcdef"; |
413 |
|
|
unsigned long p, s; |
414 |
|
|
char result[32], *r; |
415 |
|
|
r = result; |
416 |
|
|
p = (unsigned long) ptr; |
417 |
|
|
if (p > 0) { |
418 |
|
|
while (p > 0) { |
419 |
|
|
s = p & 0xf; |
420 |
|
|
*(r++) = hex[s]; |
421 |
|
|
p = p >> 4; |
422 |
|
|
} |
423 |
|
|
*r = '_'; |
424 |
|
|
while (r >= result) |
425 |
|
|
*(c++) = *(r--); |
426 |
|
|
strcpy (c, ty->name); |
427 |
|
|
} else { |
428 |
|
|
strcpy (c, "NULL"); |
429 |
|
|
} |
430 |
|
|
} |
431 |
|
|
|
432 |
|
|
/* Create a new pointer object */ |
433 |
|
|
SWIGRUNTIME(PyObject *) |
434 |
|
|
SWIG_NewPointerObj(void *ptr, swig_type_info *type) { |
435 |
|
|
char result[512]; |
436 |
|
|
PyObject *robj; |
437 |
|
|
if (!ptr) { |
438 |
|
|
Py_INCREF(Py_None); |
439 |
|
|
return Py_None; |
440 |
|
|
} |
441 |
|
|
#ifdef SWIG_COBJECT_TYPES |
442 |
|
|
robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, type->name, NULL); |
443 |
|
|
#else |
444 |
|
|
SWIG_MakePtr(result,ptr,type); |
445 |
|
|
robj = PyString_FromString(result); |
446 |
|
|
#endif |
447 |
|
|
return robj; |
448 |
|
|
} |
449 |
|
|
|
450 |
|
|
/* Install Constants */ |
451 |
|
|
SWIGRUNTIME(void) |
452 |
|
|
SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) { |
453 |
|
|
int i; |
454 |
|
|
PyObject *obj; |
455 |
|
|
for (i = 0; constants[i].type; i++) { |
456 |
|
|
switch(constants[i].type) { |
457 |
|
|
case SWIG_PY_INT: |
458 |
|
|
obj = PyInt_FromLong(constants[i].lvalue); |
459 |
|
|
break; |
460 |
|
|
case SWIG_PY_FLOAT: |
461 |
|
|
obj = PyFloat_FromDouble(constants[i].dvalue); |
462 |
|
|
break; |
463 |
|
|
case SWIG_PY_STRING: |
464 |
|
|
obj = PyString_FromString((char *) constants[i].pvalue); |
465 |
|
|
break; |
466 |
|
|
case SWIG_PY_POINTER: |
467 |
|
|
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype); |
468 |
|
|
break; |
469 |
|
|
default: |
470 |
|
|
obj = 0; |
471 |
|
|
break; |
472 |
|
|
} |
473 |
|
|
if (obj) { |
474 |
|
|
PyDict_SetItemString(d,constants[i].name,obj); |
475 |
|
|
Py_DECREF(obj); |
476 |
|
|
} |
477 |
|
|
} |
478 |
|
|
} |
479 |
|
|
|
480 |
|
|
#endif |
481 |
|
|
|
482 |
|
|
#ifdef __cplusplus |
483 |
|
|
} |
484 |
|
|
#endif |
485 |
|
|
|
486 |
|
|
|
487 |
|
|
|
488 |
|
|
/* -------- TYPES TABLE (BEGIN) -------- */ |
489 |
|
|
|
490 |
|
|
#define SWIGTYPE_p_float swig_types[0] |
491 |
|
|
#define SWIGTYPE_p_double swig_types[1] |
492 |
|
|
#define SWIGTYPE_p_p_char swig_types[2] |
493 |
|
|
#define SWIGTYPE_p_PJ swig_types[3] |
494 |
|
|
#define SWIGTYPE_p_int swig_types[4] |
495 |
|
|
#define SWIGTYPE_p_Projection swig_types[5] |
496 |
|
|
static swig_type_info *swig_types[7]; |
497 |
|
|
|
498 |
|
|
/* -------- TYPES TABLE (END) -------- */ |
499 |
|
|
|
500 |
|
|
|
501 |
|
|
/*----------------------------------------------- |
502 |
|
|
@(target):= Projectionc.so |
503 |
|
|
------------------------------------------------*/ |
504 |
|
|
#define SWIG_init initProjectionc |
505 |
|
|
|
506 |
|
|
#define SWIG_name "Projectionc" |
507 |
|
|
|
508 |
|
|
#include <projects.h> |
509 |
|
|
|
510 |
|
|
// We wrap the PJ structure in our own so we can keep the |
511 |
|
|
// type of units the user wants to operate in along. |
512 |
|
|
typedef enum {DEGREES, RADIANS} Units; |
513 |
|
|
typedef struct { |
514 |
|
|
Units units; |
515 |
|
|
PJ *proj; |
516 |
|
|
} Projection; |
517 |
|
|
|
518 |
|
|
static PyObject* l_output_helper(PyObject* target, PyObject* o) { |
519 |
|
|
PyObject* o2; |
520 |
|
|
if (!target) { |
521 |
|
|
target = o; |
522 |
|
|
} else if (target == Py_None) { |
523 |
|
|
Py_DECREF(Py_None); |
524 |
|
|
target = o; |
525 |
|
|
} else { |
526 |
|
|
if (!PyList_Check(target)) { |
527 |
|
|
o2 = target; |
528 |
|
|
target = PyList_New(0); |
529 |
|
|
PyList_Append(target, o2); |
530 |
|
|
Py_XDECREF(o2); |
531 |
|
|
} |
532 |
|
|
PyList_Append(target,o); |
533 |
|
|
Py_XDECREF(o); |
534 |
|
|
} |
535 |
|
|
return target; |
536 |
|
|
} |
537 |
|
|
|
538 |
|
|
static PyObject* t_output_helper(PyObject* target, PyObject* o) { |
539 |
|
|
PyObject* o2; |
540 |
|
|
PyObject* o3; |
541 |
|
|
|
542 |
|
|
if (!target) { |
543 |
|
|
target = o; |
544 |
|
|
} else if (target == Py_None) { |
545 |
|
|
Py_DECREF(Py_None); |
546 |
|
|
target = o; |
547 |
|
|
} else { |
548 |
|
|
if (!PyTuple_Check(target)) { |
549 |
|
|
o2 = target; |
550 |
|
|
target = PyTuple_New(1); |
551 |
|
|
PyTuple_SetItem(target, 0, o2); |
552 |
|
|
} |
553 |
|
|
o3 = PyTuple_New(1); |
554 |
|
|
PyTuple_SetItem(o3, 0, o); |
555 |
|
|
|
556 |
|
|
o2 = target; |
557 |
|
|
target = PySequence_Concat(o2, o3); |
558 |
|
|
Py_DECREF(o2); |
559 |
|
|
Py_DECREF(o3); |
560 |
|
|
} |
561 |
|
|
return target; |
562 |
|
|
} |
563 |
|
|
|
564 |
|
|
#define SWIG_MemoryError 1 |
565 |
|
|
#define SWIG_IOError 2 |
566 |
|
|
#define SWIG_RuntimeError 3 |
567 |
|
|
#define SWIG_IndexError 4 |
568 |
|
|
#define SWIG_TypeError 5 |
569 |
|
|
#define SWIG_DivisionByZero 6 |
570 |
|
|
#define SWIG_OverflowError 7 |
571 |
|
|
#define SWIG_SyntaxError 8 |
572 |
|
|
#define SWIG_ValueError 9 |
573 |
|
|
#define SWIG_SystemError 10 |
574 |
|
|
#define SWIG_UnknownError 99 |
575 |
|
|
|
576 |
|
|
static void _SWIG_exception(int code, char *msg) { |
577 |
|
|
switch(code) { |
578 |
|
|
case SWIG_MemoryError: |
579 |
|
|
PyErr_SetString(PyExc_MemoryError,msg); |
580 |
|
|
break; |
581 |
|
|
case SWIG_IOError: |
582 |
|
|
PyErr_SetString(PyExc_IOError,msg); |
583 |
|
|
break; |
584 |
|
|
case SWIG_RuntimeError: |
585 |
|
|
PyErr_SetString(PyExc_RuntimeError,msg); |
586 |
|
|
break; |
587 |
|
|
case SWIG_IndexError: |
588 |
|
|
PyErr_SetString(PyExc_IndexError,msg); |
589 |
|
|
break; |
590 |
|
|
case SWIG_TypeError: |
591 |
|
|
PyErr_SetString(PyExc_TypeError,msg); |
592 |
|
|
break; |
593 |
|
|
case SWIG_DivisionByZero: |
594 |
|
|
PyErr_SetString(PyExc_ZeroDivisionError,msg); |
595 |
|
|
break; |
596 |
|
|
case SWIG_OverflowError: |
597 |
|
|
PyErr_SetString(PyExc_OverflowError,msg); |
598 |
|
|
break; |
599 |
|
|
case SWIG_SyntaxError: |
600 |
|
|
PyErr_SetString(PyExc_SyntaxError,msg); |
601 |
|
|
break; |
602 |
|
|
case SWIG_ValueError: |
603 |
|
|
PyErr_SetString(PyExc_ValueError,msg); |
604 |
|
|
break; |
605 |
|
|
case SWIG_SystemError: |
606 |
|
|
PyErr_SetString(PyExc_SystemError,msg); |
607 |
|
|
break; |
608 |
|
|
default: |
609 |
|
|
PyErr_SetString(PyExc_RuntimeError,msg); |
610 |
|
|
break; |
611 |
|
|
} |
612 |
|
|
} |
613 |
|
|
|
614 |
|
|
#define SWIG_exception(a,b) { _SWIG_exception(a,b); return NULL; } |
615 |
|
|
|
616 |
|
|
#include <limits.h> |
617 |
|
|
|
618 |
|
|
/* Create a new integer array */ |
619 |
|
|
|
620 |
|
|
static int *int_array(int size) { |
621 |
|
|
#ifdef __cplusplus |
622 |
|
|
return new int[size]; |
623 |
|
|
#else |
624 |
|
|
return (int *) malloc(size*sizeof(int)); |
625 |
|
|
#endif |
626 |
|
|
} |
627 |
|
|
|
628 |
|
|
/* Destroy an integer array */ |
629 |
|
|
|
630 |
|
|
static void int_destroy(int *array) { |
631 |
|
|
if (array) { |
632 |
|
|
#ifdef __cplusplus |
633 |
|
|
delete [] array; |
634 |
|
|
#else |
635 |
|
|
free(array); |
636 |
|
|
#endif |
637 |
|
|
} |
638 |
|
|
} |
639 |
|
|
|
640 |
|
|
/* Return an element */ |
641 |
|
|
|
642 |
|
|
static int int_get(int *array, int index) { |
643 |
|
|
if (array) { |
644 |
|
|
return array[index]; |
645 |
|
|
} else { |
646 |
|
|
return INT_MIN; |
647 |
|
|
} |
648 |
|
|
} |
649 |
|
|
|
650 |
|
|
/* Set an element */ |
651 |
|
|
|
652 |
|
|
static int int_set(int *array, int index, int value) { |
653 |
|
|
if (array) { |
654 |
|
|
return (array[index] = value); |
655 |
|
|
} else { |
656 |
|
|
return INT_MIN; |
657 |
|
|
} |
658 |
|
|
} |
659 |
|
|
|
660 |
|
|
|
661 |
|
|
#include <float.h> |
662 |
|
|
|
663 |
|
|
/* Create a new float array */ |
664 |
|
|
|
665 |
|
|
static float *float_array(int size) { |
666 |
|
|
#ifdef __cplusplus |
667 |
|
|
return new float[size]; |
668 |
|
|
#else |
669 |
|
|
return (float *) malloc(size*sizeof(float)); |
670 |
|
|
#endif |
671 |
|
|
} |
672 |
|
|
|
673 |
|
|
/* Destroy an array */ |
674 |
|
|
|
675 |
|
|
static void float_destroy(float *array) { |
676 |
|
|
if (array) { |
677 |
|
|
#ifdef __cplusplus |
678 |
|
|
delete [] array; |
679 |
|
|
#else |
680 |
|
|
free(array); |
681 |
|
|
#endif |
682 |
|
|
} |
683 |
|
|
} |
684 |
|
|
|
685 |
|
|
/* Return an element */ |
686 |
|
|
|
687 |
|
|
static float float_get(float *array, int index) { |
688 |
|
|
if (array) { |
689 |
|
|
return array[index]; |
690 |
|
|
} else { |
691 |
|
|
return FLT_MIN; |
692 |
|
|
} |
693 |
|
|
} |
694 |
|
|
|
695 |
|
|
/* Set an element */ |
696 |
|
|
|
697 |
|
|
static float float_set(float *array, int index, float value) { |
698 |
|
|
if (array) { |
699 |
|
|
return (array[index] = value); |
700 |
|
|
} else { |
701 |
|
|
return FLT_MIN; |
702 |
|
|
} |
703 |
|
|
} |
704 |
|
|
|
705 |
|
|
/* Create a new double array */ |
706 |
|
|
|
707 |
|
|
static double *double_array(int size) { |
708 |
|
|
#ifdef __cplusplus |
709 |
|
|
return new double[size]; |
710 |
|
|
#else |
711 |
|
|
return (double *) malloc(size*sizeof(double)); |
712 |
|
|
#endif |
713 |
|
|
} |
714 |
|
|
|
715 |
|
|
/* Destroy an array */ |
716 |
|
|
|
717 |
|
|
static void double_destroy(double *array) { |
718 |
|
|
if (array) { |
719 |
|
|
#ifdef __cplusplus |
720 |
|
|
delete [] array; |
721 |
|
|
#else |
722 |
|
|
free(array); |
723 |
|
|
#endif |
724 |
|
|
} |
725 |
|
|
} |
726 |
|
|
|
727 |
|
|
/* Return an element */ |
728 |
|
|
|
729 |
|
|
static double double_get(double *array, int index) { |
730 |
|
|
if (array) { |
731 |
|
|
return array[index]; |
732 |
|
|
} else { |
733 |
|
|
return FLT_MIN; |
734 |
|
|
} |
735 |
|
|
} |
736 |
|
|
|
737 |
|
|
/* Set an element */ |
738 |
|
|
|
739 |
|
|
static double double_set(double *array, int index, double value) { |
740 |
|
|
if (array) { |
741 |
|
|
return (array[index] = value); |
742 |
|
|
} else { |
743 |
|
|
return FLT_MIN; |
744 |
|
|
} |
745 |
|
|
} |
746 |
|
|
|
747 |
|
|
|
748 |
|
|
/* Create character string arrays */ |
749 |
|
|
|
750 |
|
|
static char **string_array(int size) { |
751 |
|
|
char **a; |
752 |
|
|
int i; |
753 |
|
|
#ifdef __cplusplus |
754 |
|
|
a = new char *[size]; |
755 |
|
|
#else |
756 |
|
|
a = (char **) malloc(size*sizeof(char *)); |
757 |
|
|
#endif |
758 |
|
|
for (i = 0; i < size; i++) |
759 |
|
|
a[i] = 0; |
760 |
|
|
return a; |
761 |
|
|
} |
762 |
|
|
|
763 |
|
|
/* Destroy a string array */ |
764 |
|
|
|
765 |
|
|
static void string_destroy(char **array) { |
766 |
|
|
int i = 0; |
767 |
|
|
if (array) { |
768 |
|
|
while (array[i]) { |
769 |
|
|
#ifdef __cplusplus |
770 |
|
|
delete array[i]; |
771 |
|
|
#else |
772 |
|
|
free(array[i]); |
773 |
|
|
#endif |
774 |
|
|
i++; |
775 |
|
|
} |
776 |
|
|
#ifdef __cplusplus |
777 |
|
|
delete [] array; |
778 |
|
|
#else |
779 |
|
|
free(array); |
780 |
|
|
#endif |
781 |
|
|
} |
782 |
|
|
} |
783 |
|
|
|
784 |
|
|
/* Get an element */ |
785 |
|
|
|
786 |
|
|
static char *string_get(char **array_string, int index) { |
787 |
|
|
if (array_string) |
788 |
|
|
if (array_string[index]) return (array_string[index]); |
789 |
|
|
else return ""; |
790 |
|
|
else |
791 |
|
|
return ""; |
792 |
|
|
} |
793 |
|
|
|
794 |
|
|
/* Set an element */ |
795 |
|
|
|
796 |
|
|
static char *string_set(char **array_string, int index, char * val) { |
797 |
|
|
if (array_string) { |
798 |
|
|
if (array_string[index]) { |
799 |
|
|
#ifdef __cplusplus |
800 |
|
|
delete array_string[index]; |
801 |
|
|
#else |
802 |
|
|
free(array_string[index]); |
803 |
|
|
#endif |
804 |
|
|
} |
805 |
|
|
if (strlen(val) > 0) { |
806 |
|
|
#ifdef __cplusplus |
807 |
|
|
array_string[index] = new char[strlen(val)+1]; |
808 |
|
|
#else |
809 |
|
|
array_string[index] = (char *) malloc(strlen(val)+1); |
810 |
|
|
#endif |
811 |
|
|
strcpy(array_string[index],val); |
812 |
|
|
return array_string[index]; |
813 |
|
|
} else { |
814 |
|
|
array_string[index] = 0; |
815 |
|
|
return val; |
816 |
|
|
} |
817 |
|
|
} else return val; |
818 |
|
|
} |
819 |
|
|
|
820 |
|
|
|
821 |
|
|
// Make a brand new projection |
822 |
|
|
Projection *new_Projection(char **argv, Units units) { |
823 |
|
|
int argc = 0; |
824 |
|
|
char **p; |
825 |
|
|
PJ *proj; |
826 |
|
|
Projection *pj = NULL; |
827 |
|
|
|
828 |
|
|
for(p = argv; p != NULL && *p != NULL; p++) argc++; |
829 |
|
|
proj = pj_init(argc, argv); |
830 |
|
|
if(proj != NULL) { |
831 |
|
|
pj = (Projection *) malloc(sizeof(Projection)); |
832 |
|
|
pj->units = units; |
833 |
|
|
pj->proj = proj; |
834 |
|
|
} |
835 |
|
|
return pj; |
836 |
|
|
} |
837 |
|
|
|
838 |
|
|
// Get rid of a projection |
839 |
|
|
void delete_Projection(Projection *self) { |
840 |
|
|
if(self != NULL) { |
841 |
|
|
if(self->proj != NULL) |
842 |
|
|
pj_free(self->proj); |
843 |
|
|
free(self); |
844 |
|
|
} |
845 |
|
|
} |
846 |
|
|
|
847 |
|
|
// Do a forward (lat/lon --> world) translation |
848 |
|
|
void Projection_Forward(Projection *self, double lat, double lon, double *u, double *v) { |
849 |
|
|
projUV latlon, result; |
850 |
|
|
latlon.u = lat; |
851 |
|
|
latlon.v = lon; |
852 |
|
|
if(self->units == DEGREES) { |
853 |
|
|
latlon.u *= DEG_TO_RAD; |
854 |
|
|
latlon.v *= DEG_TO_RAD; |
855 |
|
|
} |
856 |
|
|
result = pj_fwd(latlon, self->proj); |
857 |
|
|
*u = result.u; |
858 |
|
|
*v = result.v; |
859 |
|
|
} |
860 |
|
|
|
861 |
|
|
// Do a reverse (world --> lat/lon) translation |
862 |
|
|
void Projection_Inverse(Projection *self, double u, double v, double *lat, double *lon) { |
863 |
|
|
projUV world, result; |
864 |
|
|
world.u = u; |
865 |
|
|
world.v = v; |
866 |
|
|
result = pj_inv(world, self->proj); |
867 |
|
|
if(self->units == DEGREES) { |
868 |
|
|
result.u *= RAD_TO_DEG; |
869 |
|
|
result.v *= RAD_TO_DEG; |
870 |
|
|
} |
871 |
|
|
*lat = result.u; |
872 |
|
|
*lon = result.v; |
873 |
|
|
} |
874 |
|
|
#ifdef __cplusplus |
875 |
|
|
extern "C" { |
876 |
|
|
#endif |
877 |
|
|
static PyObject *_wrap_int_array(PyObject *self, PyObject *args) { |
878 |
|
|
PyObject *resultobj; |
879 |
|
|
int arg0 ; |
880 |
|
|
int *result ; |
881 |
|
|
|
882 |
|
|
if(!PyArg_ParseTuple(args,"i:int_array",&arg0)) return NULL; |
883 |
|
|
result = (int *)int_array(arg0); |
884 |
|
|
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_int); |
885 |
|
|
{ |
886 |
|
|
if (!result) { |
887 |
|
|
SWIG_exception(SWIG_MemoryError,"Out of memory."); |
888 |
|
|
} |
889 |
|
|
} |
890 |
|
|
return resultobj; |
891 |
|
|
} |
892 |
|
|
|
893 |
|
|
|
894 |
|
|
static PyObject *_wrap_int_destroy(PyObject *self, PyObject *args) { |
895 |
|
|
PyObject *resultobj; |
896 |
|
|
int *arg0 ; |
897 |
|
|
PyObject * argo0 =0 ; |
898 |
|
|
|
899 |
|
|
if(!PyArg_ParseTuple(args,"O:int_destroy",&argo0)) return NULL; |
900 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_int,1)) == -1) return NULL; |
901 |
|
|
{ |
902 |
|
|
if (!arg0) { |
903 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
904 |
|
|
} |
905 |
|
|
} |
906 |
|
|
int_destroy(arg0); |
907 |
|
|
Py_INCREF(Py_None); |
908 |
|
|
resultobj = Py_None; |
909 |
|
|
return resultobj; |
910 |
|
|
} |
911 |
|
|
|
912 |
|
|
|
913 |
|
|
static PyObject *_wrap_int_get(PyObject *self, PyObject *args) { |
914 |
|
|
PyObject *resultobj; |
915 |
|
|
int *arg0 ; |
916 |
|
|
int arg1 ; |
917 |
|
|
PyObject * argo0 =0 ; |
918 |
|
|
int result ; |
919 |
|
|
|
920 |
|
|
if(!PyArg_ParseTuple(args,"Oi:int_get",&argo0,&arg1)) return NULL; |
921 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_int,1)) == -1) return NULL; |
922 |
|
|
{ |
923 |
|
|
if (!arg0) { |
924 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
925 |
|
|
} |
926 |
|
|
} |
927 |
|
|
result = (int )int_get(arg0,arg1); |
928 |
|
|
resultobj = PyInt_FromLong((long)result); |
929 |
|
|
return resultobj; |
930 |
|
|
} |
931 |
|
|
|
932 |
|
|
|
933 |
|
|
static PyObject *_wrap_int_set(PyObject *self, PyObject *args) { |
934 |
|
|
PyObject *resultobj; |
935 |
|
|
int *arg0 ; |
936 |
|
|
int arg1 ; |
937 |
|
|
int arg2 ; |
938 |
|
|
PyObject * argo0 =0 ; |
939 |
|
|
int result ; |
940 |
|
|
|
941 |
|
|
if(!PyArg_ParseTuple(args,"Oii:int_set",&argo0,&arg1,&arg2)) return NULL; |
942 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_int,1)) == -1) return NULL; |
943 |
|
|
{ |
944 |
|
|
if (!arg0) { |
945 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
946 |
|
|
} |
947 |
|
|
} |
948 |
|
|
result = (int )int_set(arg0,arg1,arg2); |
949 |
|
|
resultobj = PyInt_FromLong((long)result); |
950 |
|
|
return resultobj; |
951 |
|
|
} |
952 |
|
|
|
953 |
|
|
|
954 |
|
|
static PyObject *_wrap_double_array(PyObject *self, PyObject *args) { |
955 |
|
|
PyObject *resultobj; |
956 |
|
|
int arg0 ; |
957 |
|
|
double *result ; |
958 |
|
|
|
959 |
|
|
if(!PyArg_ParseTuple(args,"i:double_array",&arg0)) return NULL; |
960 |
|
|
result = (double *)double_array(arg0); |
961 |
|
|
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_double); |
962 |
|
|
{ |
963 |
|
|
if (!result) { |
964 |
|
|
SWIG_exception(SWIG_MemoryError,"Out of memory."); |
965 |
|
|
} |
966 |
|
|
} |
967 |
|
|
return resultobj; |
968 |
|
|
} |
969 |
|
|
|
970 |
|
|
|
971 |
|
|
static PyObject *_wrap_double_destroy(PyObject *self, PyObject *args) { |
972 |
|
|
PyObject *resultobj; |
973 |
|
|
double *arg0 ; |
974 |
|
|
PyObject * argo0 =0 ; |
975 |
|
|
|
976 |
|
|
if(!PyArg_ParseTuple(args,"O:double_destroy",&argo0)) return NULL; |
977 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_double,1)) == -1) return NULL; |
978 |
|
|
{ |
979 |
|
|
if (!arg0) { |
980 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
981 |
|
|
} |
982 |
|
|
} |
983 |
|
|
double_destroy(arg0); |
984 |
|
|
Py_INCREF(Py_None); |
985 |
|
|
resultobj = Py_None; |
986 |
|
|
return resultobj; |
987 |
|
|
} |
988 |
|
|
|
989 |
|
|
|
990 |
|
|
static PyObject *_wrap_double_get(PyObject *self, PyObject *args) { |
991 |
|
|
PyObject *resultobj; |
992 |
|
|
double *arg0 ; |
993 |
|
|
int arg1 ; |
994 |
|
|
PyObject * argo0 =0 ; |
995 |
|
|
double result ; |
996 |
|
|
|
997 |
|
|
if(!PyArg_ParseTuple(args,"Oi:double_get",&argo0,&arg1)) return NULL; |
998 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_double,1)) == -1) return NULL; |
999 |
|
|
{ |
1000 |
|
|
if (!arg0) { |
1001 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1002 |
|
|
} |
1003 |
|
|
} |
1004 |
|
|
result = (double )double_get(arg0,arg1); |
1005 |
|
|
resultobj = PyFloat_FromDouble(result); |
1006 |
|
|
return resultobj; |
1007 |
|
|
} |
1008 |
|
|
|
1009 |
|
|
|
1010 |
|
|
static PyObject *_wrap_double_set(PyObject *self, PyObject *args) { |
1011 |
|
|
PyObject *resultobj; |
1012 |
|
|
double *arg0 ; |
1013 |
|
|
int arg1 ; |
1014 |
|
|
double arg2 ; |
1015 |
|
|
PyObject * argo0 =0 ; |
1016 |
|
|
double result ; |
1017 |
|
|
|
1018 |
|
|
if(!PyArg_ParseTuple(args,"Oid:double_set",&argo0,&arg1,&arg2)) return NULL; |
1019 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_double,1)) == -1) return NULL; |
1020 |
|
|
{ |
1021 |
|
|
if (!arg0) { |
1022 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1023 |
|
|
} |
1024 |
|
|
} |
1025 |
|
|
result = (double )double_set(arg0,arg1,arg2); |
1026 |
|
|
resultobj = PyFloat_FromDouble(result); |
1027 |
|
|
return resultobj; |
1028 |
|
|
} |
1029 |
|
|
|
1030 |
|
|
|
1031 |
|
|
static PyObject *_wrap_float_array(PyObject *self, PyObject *args) { |
1032 |
|
|
PyObject *resultobj; |
1033 |
|
|
int arg0 ; |
1034 |
|
|
float *result ; |
1035 |
|
|
|
1036 |
|
|
if(!PyArg_ParseTuple(args,"i:float_array",&arg0)) return NULL; |
1037 |
|
|
result = (float *)float_array(arg0); |
1038 |
|
|
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_float); |
1039 |
|
|
{ |
1040 |
|
|
if (!result) { |
1041 |
|
|
SWIG_exception(SWIG_MemoryError,"Out of memory."); |
1042 |
|
|
} |
1043 |
|
|
} |
1044 |
|
|
return resultobj; |
1045 |
|
|
} |
1046 |
|
|
|
1047 |
|
|
|
1048 |
|
|
static PyObject *_wrap_float_destroy(PyObject *self, PyObject *args) { |
1049 |
|
|
PyObject *resultobj; |
1050 |
|
|
float *arg0 ; |
1051 |
|
|
PyObject * argo0 =0 ; |
1052 |
|
|
|
1053 |
|
|
if(!PyArg_ParseTuple(args,"O:float_destroy",&argo0)) return NULL; |
1054 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_float,1)) == -1) return NULL; |
1055 |
|
|
{ |
1056 |
|
|
if (!arg0) { |
1057 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1058 |
|
|
} |
1059 |
|
|
} |
1060 |
|
|
float_destroy(arg0); |
1061 |
|
|
Py_INCREF(Py_None); |
1062 |
|
|
resultobj = Py_None; |
1063 |
|
|
return resultobj; |
1064 |
|
|
} |
1065 |
|
|
|
1066 |
|
|
|
1067 |
|
|
static PyObject *_wrap_float_get(PyObject *self, PyObject *args) { |
1068 |
|
|
PyObject *resultobj; |
1069 |
|
|
float *arg0 ; |
1070 |
|
|
int arg1 ; |
1071 |
|
|
PyObject * argo0 =0 ; |
1072 |
|
|
float result ; |
1073 |
|
|
|
1074 |
|
|
if(!PyArg_ParseTuple(args,"Oi:float_get",&argo0,&arg1)) return NULL; |
1075 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_float,1)) == -1) return NULL; |
1076 |
|
|
{ |
1077 |
|
|
if (!arg0) { |
1078 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1079 |
|
|
} |
1080 |
|
|
} |
1081 |
|
|
result = (float )float_get(arg0,arg1); |
1082 |
|
|
resultobj = PyFloat_FromDouble(result); |
1083 |
|
|
return resultobj; |
1084 |
|
|
} |
1085 |
|
|
|
1086 |
|
|
|
1087 |
|
|
static PyObject *_wrap_float_set(PyObject *self, PyObject *args) { |
1088 |
|
|
PyObject *resultobj; |
1089 |
|
|
float *arg0 ; |
1090 |
|
|
int arg1 ; |
1091 |
|
|
float arg2 ; |
1092 |
|
|
PyObject * argo0 =0 ; |
1093 |
|
|
float result ; |
1094 |
|
|
|
1095 |
|
|
if(!PyArg_ParseTuple(args,"Oif:float_set",&argo0,&arg1,&arg2)) return NULL; |
1096 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_float,1)) == -1) return NULL; |
1097 |
|
|
{ |
1098 |
|
|
if (!arg0) { |
1099 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1100 |
|
|
} |
1101 |
|
|
} |
1102 |
|
|
result = (float )float_set(arg0,arg1,arg2); |
1103 |
|
|
resultobj = PyFloat_FromDouble(result); |
1104 |
|
|
return resultobj; |
1105 |
|
|
} |
1106 |
|
|
|
1107 |
|
|
|
1108 |
|
|
static PyObject *_wrap_string_array(PyObject *self, PyObject *args) { |
1109 |
|
|
PyObject *resultobj; |
1110 |
|
|
int arg0 ; |
1111 |
|
|
char **result ; |
1112 |
|
|
|
1113 |
|
|
if(!PyArg_ParseTuple(args,"i:string_array",&arg0)) return NULL; |
1114 |
|
|
result = (char **)string_array(arg0); |
1115 |
|
|
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_p_char); |
1116 |
|
|
{ |
1117 |
|
|
if (!result) { |
1118 |
|
|
SWIG_exception(SWIG_MemoryError,"Out of memory."); |
1119 |
|
|
} |
1120 |
|
|
} |
1121 |
|
|
return resultobj; |
1122 |
|
|
} |
1123 |
|
|
|
1124 |
|
|
|
1125 |
|
|
static PyObject *_wrap_string_destroy(PyObject *self, PyObject *args) { |
1126 |
|
|
PyObject *resultobj; |
1127 |
|
|
char **arg0 ; |
1128 |
|
|
PyObject * argo0 =0 ; |
1129 |
|
|
|
1130 |
|
|
if(!PyArg_ParseTuple(args,"O:string_destroy",&argo0)) return NULL; |
1131 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_p_char,1)) == -1) return NULL; |
1132 |
|
|
{ |
1133 |
|
|
if (!arg0) { |
1134 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1135 |
|
|
} |
1136 |
|
|
} |
1137 |
|
|
string_destroy(arg0); |
1138 |
|
|
Py_INCREF(Py_None); |
1139 |
|
|
resultobj = Py_None; |
1140 |
|
|
return resultobj; |
1141 |
|
|
} |
1142 |
|
|
|
1143 |
|
|
|
1144 |
|
|
static PyObject *_wrap_string_get(PyObject *self, PyObject *args) { |
1145 |
|
|
PyObject *resultobj; |
1146 |
|
|
char **arg0 ; |
1147 |
|
|
int arg1 ; |
1148 |
|
|
PyObject * argo0 =0 ; |
1149 |
|
|
char *result ; |
1150 |
|
|
|
1151 |
|
|
if(!PyArg_ParseTuple(args,"Oi:string_get",&argo0,&arg1)) return NULL; |
1152 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_p_char,1)) == -1) return NULL; |
1153 |
|
|
{ |
1154 |
|
|
if (!arg0) { |
1155 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1156 |
|
|
} |
1157 |
|
|
} |
1158 |
|
|
result = (char *)string_get(arg0,arg1); |
1159 |
|
|
resultobj = PyString_FromString(result); |
1160 |
|
|
return resultobj; |
1161 |
|
|
} |
1162 |
|
|
|
1163 |
|
|
|
1164 |
|
|
static PyObject *_wrap_string_set(PyObject *self, PyObject *args) { |
1165 |
|
|
PyObject *resultobj; |
1166 |
|
|
char **arg0 ; |
1167 |
|
|
int arg1 ; |
1168 |
|
|
char *arg2 ; |
1169 |
|
|
PyObject * argo0 =0 ; |
1170 |
|
|
char *result ; |
1171 |
|
|
|
1172 |
|
|
if(!PyArg_ParseTuple(args,"Ois:string_set",&argo0,&arg1,&arg2)) return NULL; |
1173 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_p_char,1)) == -1) return NULL; |
1174 |
|
|
{ |
1175 |
|
|
if (!arg0) { |
1176 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1177 |
|
|
} |
1178 |
|
|
} |
1179 |
|
|
result = (char *)string_set(arg0,arg1,arg2); |
1180 |
|
|
resultobj = PyString_FromString(result); |
1181 |
|
|
return resultobj; |
1182 |
|
|
} |
1183 |
|
|
|
1184 |
|
|
|
1185 |
|
|
static PyObject *_wrap_Projection_units_set(PyObject *self, PyObject *args) { |
1186 |
|
|
PyObject *resultobj; |
1187 |
|
|
Projection *arg0 ; |
1188 |
|
|
int arg1 ; |
1189 |
|
|
PyObject * argo0 =0 ; |
1190 |
|
|
|
1191 |
|
|
if(!PyArg_ParseTuple(args,"Oi:Projection_units_set",&argo0,&arg1)) return NULL; |
1192 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_Projection,1)) == -1) return NULL; |
1193 |
|
|
arg0->units = (Units )arg1; |
1194 |
|
|
Py_INCREF(Py_None); |
1195 |
|
|
resultobj = Py_None; |
1196 |
|
|
return resultobj; |
1197 |
|
|
} |
1198 |
|
|
|
1199 |
|
|
|
1200 |
|
|
static PyObject *_wrap_Projection_units_get(PyObject *self, PyObject *args) { |
1201 |
|
|
PyObject *resultobj; |
1202 |
|
|
Projection *arg0 ; |
1203 |
|
|
PyObject * argo0 =0 ; |
1204 |
|
|
int result ; |
1205 |
|
|
|
1206 |
|
|
if(!PyArg_ParseTuple(args,"O:Projection_units_get",&argo0)) return NULL; |
1207 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_Projection,1)) == -1) return NULL; |
1208 |
|
|
result = (int ) (arg0->units); |
1209 |
|
|
resultobj = PyInt_FromLong((long)result); |
1210 |
|
|
return resultobj; |
1211 |
|
|
} |
1212 |
|
|
|
1213 |
|
|
|
1214 |
|
|
static PyObject *_wrap_Projection_proj_set(PyObject *self, PyObject *args) { |
1215 |
|
|
PyObject *resultobj; |
1216 |
|
|
Projection *arg0 ; |
1217 |
|
|
PJ *arg1 ; |
1218 |
|
|
PyObject * argo0 =0 ; |
1219 |
|
|
PyObject * argo1 =0 ; |
1220 |
|
|
|
1221 |
|
|
if(!PyArg_ParseTuple(args,"OO:Projection_proj_set",&argo0,&argo1)) return NULL; |
1222 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_Projection,1)) == -1) return NULL; |
1223 |
|
|
if ((SWIG_ConvertPtr(argo1,(void **) &arg1,SWIGTYPE_p_PJ,1)) == -1) return NULL; |
1224 |
|
|
arg0->proj = arg1; |
1225 |
|
|
Py_INCREF(Py_None); |
1226 |
|
|
resultobj = Py_None; |
1227 |
|
|
return resultobj; |
1228 |
|
|
} |
1229 |
|
|
|
1230 |
|
|
|
1231 |
|
|
static PyObject *_wrap_Projection_proj_get(PyObject *self, PyObject *args) { |
1232 |
|
|
PyObject *resultobj; |
1233 |
|
|
Projection *arg0 ; |
1234 |
|
|
PyObject * argo0 =0 ; |
1235 |
|
|
PJ *result ; |
1236 |
|
|
|
1237 |
|
|
if(!PyArg_ParseTuple(args,"O:Projection_proj_get",&argo0)) return NULL; |
1238 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_Projection,1)) == -1) return NULL; |
1239 |
|
|
result = (PJ *) (arg0->proj); |
1240 |
|
|
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_PJ); |
1241 |
|
|
return resultobj; |
1242 |
|
|
} |
1243 |
|
|
|
1244 |
|
|
|
1245 |
|
|
static PyObject *_wrap_new_Projection(PyObject *self, PyObject *args) { |
1246 |
|
|
PyObject *resultobj; |
1247 |
|
|
char **arg0 ; |
1248 |
|
|
int arg1 = DEGREES ; |
1249 |
|
|
PyObject * obj0 = 0 ; |
1250 |
|
|
Projection *result ; |
1251 |
|
|
|
1252 |
|
|
if(!PyArg_ParseTuple(args,"O|i:new_Projection",&obj0,&arg1)) return NULL; |
1253 |
|
|
{ |
1254 |
|
|
/* Check if is a list */ |
1255 |
|
|
if (PyList_Check(obj0)) { |
1256 |
|
|
int size = PyList_Size(obj0); |
1257 |
|
|
int i = 0; |
1258 |
|
|
arg0 = (char **) malloc((size+1)*sizeof(char *)); |
1259 |
|
|
for (i = 0; i < size; i++) { |
1260 |
|
|
PyObject *o = PyList_GetItem(obj0,i); |
1261 |
|
|
if (PyString_Check(o)) |
1262 |
|
|
arg0[i] = PyString_AsString(PyList_GetItem(obj0,i)); |
1263 |
|
|
else { |
1264 |
|
|
PyErr_SetString(PyExc_TypeError,"list must contain strings"); |
1265 |
|
|
free(arg0); |
1266 |
|
|
return NULL; |
1267 |
|
|
} |
1268 |
|
|
} |
1269 |
|
|
arg0[i] = 0; |
1270 |
|
|
}else { |
1271 |
|
|
PyErr_SetString(PyExc_TypeError,"not a list"); return NULL; |
1272 |
|
|
} |
1273 |
|
|
} |
1274 |
|
|
{ |
1275 |
|
|
if (!arg0) { |
1276 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1277 |
|
|
} |
1278 |
|
|
} |
1279 |
|
|
{ |
1280 |
|
|
result = (Projection *)new_Projection(arg0,(Units )arg1); |
1281 |
|
|
; |
1282 |
|
|
if (!result) |
1283 |
|
|
{ |
1284 |
|
|
SWIG_exception(SWIG_IOError, pj_strerrno(pj_errno)); |
1285 |
|
|
} |
1286 |
|
|
}resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_Projection); |
1287 |
|
|
{ |
1288 |
|
|
free((char *) arg0); |
1289 |
|
|
} |
1290 |
|
|
return resultobj; |
1291 |
|
|
} |
1292 |
|
|
|
1293 |
|
|
|
1294 |
|
|
static PyObject *_wrap_delete_Projection(PyObject *self, PyObject *args) { |
1295 |
|
|
PyObject *resultobj; |
1296 |
|
|
Projection *arg0 ; |
1297 |
|
|
PyObject * argo0 =0 ; |
1298 |
|
|
|
1299 |
|
|
if(!PyArg_ParseTuple(args,"O:delete_Projection",&argo0)) return NULL; |
1300 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_Projection,1)) == -1) return NULL; |
1301 |
|
|
delete_Projection(arg0); |
1302 |
|
|
Py_INCREF(Py_None); |
1303 |
|
|
resultobj = Py_None; |
1304 |
|
|
return resultobj; |
1305 |
|
|
} |
1306 |
|
|
|
1307 |
|
|
|
1308 |
|
|
static PyObject *_wrap_Projection_Forward(PyObject *self, PyObject *args) { |
1309 |
|
|
PyObject *resultobj; |
1310 |
|
|
Projection *arg0 ; |
1311 |
|
|
double arg1 ; |
1312 |
|
|
double arg2 ; |
1313 |
|
|
double *arg3 ; |
1314 |
|
|
double *arg4 ; |
1315 |
|
|
double temp ; |
1316 |
|
|
double temp0 ; |
1317 |
|
|
PyObject * argo0 =0 ; |
1318 |
|
|
|
1319 |
|
|
{ |
1320 |
|
|
arg3 = &temp; |
1321 |
|
|
} |
1322 |
|
|
{ |
1323 |
|
|
arg4 = &temp0; |
1324 |
|
|
} |
1325 |
|
|
if(!PyArg_ParseTuple(args,"Odd:Projection_Forward",&argo0,&arg1,&arg2)) return NULL; |
1326 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_Projection,1)) == -1) return NULL; |
1327 |
|
|
{ |
1328 |
|
|
if (!arg3) { |
1329 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1330 |
|
|
} |
1331 |
|
|
} |
1332 |
|
|
{ |
1333 |
|
|
if (!arg4) { |
1334 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1335 |
|
|
} |
1336 |
|
|
} |
1337 |
|
|
Projection_Forward(arg0,arg1,arg2,arg3,arg4); |
1338 |
|
|
Py_INCREF(Py_None); |
1339 |
|
|
resultobj = Py_None; |
1340 |
|
|
{ |
1341 |
|
|
PyObject *o; |
1342 |
|
|
o = PyFloat_FromDouble(*arg3); |
1343 |
|
|
if ((!resultobj) || (resultobj == Py_None)) { |
1344 |
|
|
resultobj = o; |
1345 |
|
|
}else { |
1346 |
|
|
if (!PyList_Check(resultobj)) { |
1347 |
|
|
PyObject *o2 = resultobj; |
1348 |
|
|
resultobj = PyList_New(0); |
1349 |
|
|
PyList_Append(resultobj,o2); |
1350 |
|
|
Py_XDECREF(o2); |
1351 |
|
|
} |
1352 |
|
|
PyList_Append(resultobj,o); |
1353 |
|
|
Py_XDECREF(o); |
1354 |
|
|
} |
1355 |
|
|
} |
1356 |
|
|
{ |
1357 |
|
|
PyObject *o; |
1358 |
|
|
o = PyFloat_FromDouble(*arg4); |
1359 |
|
|
if ((!resultobj) || (resultobj == Py_None)) { |
1360 |
|
|
resultobj = o; |
1361 |
|
|
}else { |
1362 |
|
|
if (!PyList_Check(resultobj)) { |
1363 |
|
|
PyObject *o2 = resultobj; |
1364 |
|
|
resultobj = PyList_New(0); |
1365 |
|
|
PyList_Append(resultobj,o2); |
1366 |
|
|
Py_XDECREF(o2); |
1367 |
|
|
} |
1368 |
|
|
PyList_Append(resultobj,o); |
1369 |
|
|
Py_XDECREF(o); |
1370 |
|
|
} |
1371 |
|
|
} |
1372 |
|
|
return resultobj; |
1373 |
|
|
} |
1374 |
|
|
|
1375 |
|
|
|
1376 |
|
|
static PyObject *_wrap_Projection_Inverse(PyObject *self, PyObject *args) { |
1377 |
|
|
PyObject *resultobj; |
1378 |
|
|
Projection *arg0 ; |
1379 |
|
|
double arg1 ; |
1380 |
|
|
double arg2 ; |
1381 |
|
|
double *arg3 ; |
1382 |
|
|
double *arg4 ; |
1383 |
|
|
double temp ; |
1384 |
|
|
double temp0 ; |
1385 |
|
|
PyObject * argo0 =0 ; |
1386 |
|
|
|
1387 |
|
|
{ |
1388 |
|
|
arg3 = &temp; |
1389 |
|
|
} |
1390 |
|
|
{ |
1391 |
|
|
arg4 = &temp0; |
1392 |
|
|
} |
1393 |
|
|
if(!PyArg_ParseTuple(args,"Odd:Projection_Inverse",&argo0,&arg1,&arg2)) return NULL; |
1394 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_Projection,1)) == -1) return NULL; |
1395 |
|
|
{ |
1396 |
|
|
if (!arg3) { |
1397 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1398 |
|
|
} |
1399 |
|
|
} |
1400 |
|
|
{ |
1401 |
|
|
if (!arg4) { |
1402 |
|
|
SWIG_exception(SWIG_ValueError,"Received a NULL Pointer"); |
1403 |
|
|
} |
1404 |
|
|
} |
1405 |
|
|
Projection_Inverse(arg0,arg1,arg2,arg3,arg4); |
1406 |
|
|
Py_INCREF(Py_None); |
1407 |
|
|
resultobj = Py_None; |
1408 |
|
|
{ |
1409 |
|
|
PyObject *o; |
1410 |
|
|
o = PyFloat_FromDouble(*arg3); |
1411 |
|
|
if ((!resultobj) || (resultobj == Py_None)) { |
1412 |
|
|
resultobj = o; |
1413 |
|
|
}else { |
1414 |
|
|
if (!PyList_Check(resultobj)) { |
1415 |
|
|
PyObject *o2 = resultobj; |
1416 |
|
|
resultobj = PyList_New(0); |
1417 |
|
|
PyList_Append(resultobj,o2); |
1418 |
|
|
Py_XDECREF(o2); |
1419 |
|
|
} |
1420 |
|
|
PyList_Append(resultobj,o); |
1421 |
|
|
Py_XDECREF(o); |
1422 |
|
|
} |
1423 |
|
|
} |
1424 |
|
|
{ |
1425 |
|
|
PyObject *o; |
1426 |
|
|
o = PyFloat_FromDouble(*arg4); |
1427 |
|
|
if ((!resultobj) || (resultobj == Py_None)) { |
1428 |
|
|
resultobj = o; |
1429 |
|
|
}else { |
1430 |
|
|
if (!PyList_Check(resultobj)) { |
1431 |
|
|
PyObject *o2 = resultobj; |
1432 |
|
|
resultobj = PyList_New(0); |
1433 |
|
|
PyList_Append(resultobj,o2); |
1434 |
|
|
Py_XDECREF(o2); |
1435 |
|
|
} |
1436 |
|
|
PyList_Append(resultobj,o); |
1437 |
|
|
Py_XDECREF(o); |
1438 |
|
|
} |
1439 |
|
|
} |
1440 |
|
|
return resultobj; |
1441 |
|
|
} |
1442 |
|
|
|
1443 |
|
|
|
1444 |
|
|
PyObject * Projection_cobject(Projection *self) { |
1445 |
|
|
{ |
1446 |
|
|
return PyCObject_FromVoidPtr(self->proj, NULL); |
1447 |
|
|
} |
1448 |
|
|
} |
1449 |
|
|
|
1450 |
|
|
|
1451 |
|
|
static PyObject *_wrap_Projection_cobject(PyObject *self, PyObject *args) { |
1452 |
|
|
PyObject *resultobj; |
1453 |
|
|
Projection *arg0 ; |
1454 |
|
|
PyObject * argo0 =0 ; |
1455 |
|
|
PyObject *result ; |
1456 |
|
|
|
1457 |
|
|
if(!PyArg_ParseTuple(args,"O:Projection_cobject",&argo0)) return NULL; |
1458 |
|
|
if ((SWIG_ConvertPtr(argo0,(void **) &arg0,SWIGTYPE_p_Projection,1)) == -1) return NULL; |
1459 |
|
|
result = (PyObject *)Projection_cobject(arg0); |
1460 |
|
|
{ |
1461 |
|
|
resultobj = result; |
1462 |
|
|
} |
1463 |
|
|
return resultobj; |
1464 |
|
|
} |
1465 |
|
|
|
1466 |
|
|
|
1467 |
|
|
static PyMethodDef ProjectioncMethods[] = { |
1468 |
|
|
{ "int_array", _wrap_int_array, METH_VARARGS }, |
1469 |
|
|
{ "int_destroy", _wrap_int_destroy, METH_VARARGS }, |
1470 |
|
|
{ "int_get", _wrap_int_get, METH_VARARGS }, |
1471 |
|
|
{ "int_set", _wrap_int_set, METH_VARARGS }, |
1472 |
|
|
{ "double_array", _wrap_double_array, METH_VARARGS }, |
1473 |
|
|
{ "double_destroy", _wrap_double_destroy, METH_VARARGS }, |
1474 |
|
|
{ "double_get", _wrap_double_get, METH_VARARGS }, |
1475 |
|
|
{ "double_set", _wrap_double_set, METH_VARARGS }, |
1476 |
|
|
{ "float_array", _wrap_float_array, METH_VARARGS }, |
1477 |
|
|
{ "float_destroy", _wrap_float_destroy, METH_VARARGS }, |
1478 |
|
|
{ "float_get", _wrap_float_get, METH_VARARGS }, |
1479 |
|
|
{ "float_set", _wrap_float_set, METH_VARARGS }, |
1480 |
|
|
{ "string_array", _wrap_string_array, METH_VARARGS }, |
1481 |
|
|
{ "string_destroy", _wrap_string_destroy, METH_VARARGS }, |
1482 |
|
|
{ "string_get", _wrap_string_get, METH_VARARGS }, |
1483 |
|
|
{ "string_set", _wrap_string_set, METH_VARARGS }, |
1484 |
|
|
{ "Projection_units_set", _wrap_Projection_units_set, METH_VARARGS }, |
1485 |
|
|
{ "Projection_units_get", _wrap_Projection_units_get, METH_VARARGS }, |
1486 |
|
|
{ "Projection_proj_set", _wrap_Projection_proj_set, METH_VARARGS }, |
1487 |
|
|
{ "Projection_proj_get", _wrap_Projection_proj_get, METH_VARARGS }, |
1488 |
|
|
{ "new_Projection", _wrap_new_Projection, METH_VARARGS }, |
1489 |
|
|
{ "delete_Projection", _wrap_delete_Projection, METH_VARARGS }, |
1490 |
|
|
{ "Projection_Forward", _wrap_Projection_Forward, METH_VARARGS }, |
1491 |
|
|
{ "Projection_Inverse", _wrap_Projection_Inverse, METH_VARARGS }, |
1492 |
|
|
{ "Projection_cobject", _wrap_Projection_cobject, METH_VARARGS }, |
1493 |
|
|
{ NULL, NULL } |
1494 |
|
|
}; |
1495 |
|
|
|
1496 |
|
|
#ifdef __cplusplus |
1497 |
|
|
} |
1498 |
|
|
#endif |
1499 |
|
|
|
1500 |
|
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ |
1501 |
|
|
|
1502 |
|
|
static swig_type_info _swigt__p_float[] = {{"_p_float", 0, "float *"},{"_p_float"},{0}}; |
1503 |
|
|
static swig_type_info _swigt__p_double[] = {{"_p_double", 0, "double *"},{"_p_double"},{0}}; |
1504 |
|
|
static swig_type_info _swigt__p_p_char[] = {{"_p_p_char", 0, "char **"},{"_p_p_char"},{0}}; |
1505 |
|
|
static swig_type_info _swigt__p_PJ[] = {{"_p_PJ", 0, "PJ *"},{"_p_PJ"},{0}}; |
1506 |
|
|
static swig_type_info _swigt__p_int[] = {{"_p_int", 0, "int *"},{"_p_int"},{0}}; |
1507 |
|
|
static swig_type_info _swigt__p_Projection[] = {{"_p_Projection", 0, "Projection *"},{"_p_Projection"},{0}}; |
1508 |
|
|
|
1509 |
|
|
static swig_type_info *swig_types_initial[] = { |
1510 |
|
|
_swigt__p_float, |
1511 |
|
|
_swigt__p_double, |
1512 |
|
|
_swigt__p_p_char, |
1513 |
|
|
_swigt__p_PJ, |
1514 |
|
|
_swigt__p_int, |
1515 |
|
|
_swigt__p_Projection, |
1516 |
|
|
0 |
1517 |
|
|
}; |
1518 |
|
|
|
1519 |
|
|
|
1520 |
|
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ |
1521 |
|
|
|
1522 |
|
|
static swig_const_info swig_const_table[] = { |
1523 |
|
|
{ SWIG_PY_INT, "DEGREES", (long) DEGREES, 0, 0, 0}, |
1524 |
|
|
{ SWIG_PY_INT, "RADIANS", (long) RADIANS, 0, 0, 0}, |
1525 |
|
|
{0}}; |
1526 |
|
|
|
1527 |
|
|
static PyObject *SWIG_globals; |
1528 |
|
|
#ifdef __cplusplus |
1529 |
|
|
extern "C" |
1530 |
|
|
#endif |
1531 |
|
|
SWIGEXPORT(void) initProjectionc(void) { |
1532 |
|
|
PyObject *m, *d; |
1533 |
|
|
int i; |
1534 |
|
|
SWIG_globals = SWIG_newvarlink(); |
1535 |
|
|
m = Py_InitModule("Projectionc", ProjectioncMethods); |
1536 |
|
|
d = PyModule_GetDict(m); |
1537 |
|
|
for (i = 0; swig_types_initial[i]; i++) { |
1538 |
|
|
swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); |
1539 |
|
|
} |
1540 |
|
|
SWIG_InstallConstants(d,swig_const_table); |
1541 |
|
|
} |
1542 |
|
|
|