| 1 |
|
| #include "EXTERN.h"
|
| 2 |
|
| #include "perl.h"
|
| 3 |
|
| #include "XSUB.h"
|
| 4 |
|
|
|
| 5 |
|
| #include "ppport.h"
|
| 6 |
|
|
|
| 7 |
|
| #include <functions.h>
|
| 8 |
|
|
|
| 9 |
|
|
|
| 10 |
|
| MODULE = Math::Geometry::Planar::GPC::PolygonXS PACKAGE = Math::Geometry::Planar::GPC::PolygonXS
|
| 11 |
|
|
|
| 12 |
|
| SV*
|
| 13 |
|
| new(class)
|
| 14 |
|
| char* class;
|
| 15 |
|
|
|
| 16 |
|
| void add_polygon(obj, pg, hole);
|
| 17 |
|
| SV* obj;
|
| 18 |
|
| SV* pg;
|
| 19 |
|
| int hole;
|
| 20 |
|
|
|
| 21 |
|
|
|
| 22 |
|
| void DESTROY(obj);
|
| 23 |
|
| SV* obj;
|
| 24 |
|
|
|
| 25 |
|
| int from_file(obj, filename, want_hole);
|
| 26 |
|
| SV* obj;
|
| 27 |
|
| char* filename;
|
| 28 |
|
| int want_hole;
|
| 29 |
|
|
|
| 30 |
|
| void to_file(obj, filename, want_hole);
|
| 31 |
|
| SV* obj;
|
| 32 |
|
| char* filename;
|
| 33 |
|
| int want_hole;
|
| 34 |
|
|
|
| 35 |
|
|
|
| 36 |
|
| SV* clip_to(obj, clp, action);
|
| 37 |
|
| SV* obj;
|
| 38 |
|
| SV* clp;
|
| 39 |
|
| char* action
|
| 40 |
|
|
|
| 41 |
|
| void get_polygons(obj);
|
| 42 |
|
| SV* obj
|
| 43 |
|
| INIT:
|
| 44 |
|
| int c;
|
| 45 |
|
| gpc_polygon* p;
|
| 46 |
|
|
|
| 47 |
|
| PPCODE:
|
| 48 |
4 |
| p = (gpc_polygon*) SvIV(SvRV(obj));
|
| 49 |
4 |
▶ | PUSHMARK(SP);
|
Branch: 1 branch
| Branch | True | False | Total |
| PUSHMARK(SP);
|
0 |
4 |
4 |
|
| 50 |
4 |
▶ | if(p->num_contours < 1) {
|
Branch: 1 branch
| Branch | True | False | Total |
| if(p->num_contours < 1) {
|
0 |
4 |
4 |
|
| 51 |
0 |
| PUTBACK;
|
| 52 |
0 |
| return;
|
| 53 |
|
| }
|
| 54 |
14 |
▶ | for(c = 0; c < p->num_contours; c++) {
|
Branch: 1 branch
| Branch | True | False | Total |
| for(c = 0; c < p->num_contours; c++) {
|
10 |
4 |
14 |
|
| 55 |
10 |
▶ | XPUSHs(newRV_noinc((SV*) vertex_list_to_pts(&(p->contour[c]))));
|
Branch: 1 branch
| Branch | True | False | Total |
| XPUSHs(newRV_noinc((SV*) vertex_list_to_pts(&(p->contour[c]))));
|
0 |
10 |
10 |
|
| 56 |
|
| }
|
| 57 |
|
|
|
| 58 |
|
|
|
| 59 |
|
| #void pts_to_vertex_list(pg, vl);
|
| 60 |
|
| #SV* pg;
|
| 61 |
|
| #gpc_vertex_list* vl;
|
| 62 |
|
|
|
| 63 |
|
| #AV* vertex_list_to_pts(vl);
|
| 64 |
|
| #gpc_vertex_list* vl;
|
| 65 |
|
|
|
| 66 |
|
| #void gpc_free_polygon2(p);
|
| 67 |
|
| #gpc_polygon *p;
|
| 68 |
|
|
|
| 69 |
|
|
|