#include "gpc.h"
#include <stdlib.h>
#include <float.h>
#include <math.h>
Go to the source code of this file.
|
| #define | FALSE 0 |
| #define | TRUE 1 |
| #define | LEFT 0 |
| #define | RIGHT 1 |
| #define | ABOVE 0 |
| #define | BELOW 1 |
| #define | CLIP 0 |
| #define | SUBJ 1 |
| #define | INVERT_TRISTRIPS FALSE |
| #define | EQ(a, b) |
| #define | PREV_INDEX(i, n) |
| #define | NEXT_INDEX(i, n) |
| #define | OPTIMAL(v, i, n) |
| #define | FWD_MIN(v, i, n) |
| #define | NOT_FMAX(v, i, n) |
| #define | REV_MIN(v, i, n) |
| #define | NOT_RMAX(v, i, n) |
| #define | VERTEX(e, p, s, x, y) |
| #define | P_EDGE(d, e, p, i, j) |
| #define | N_EDGE(d, e, p, i, j) |
| #define | MALLOC(p, b, s, t) |
| #define | FREE(p) |
|
| enum | vertex_type {
NUL
, EMX
, ELI
, TED
,
ERI
, RED
, IMM
, IMN
,
EMN
, EMM
, LED
, ILI
,
BED
, IRI
, IMX
, FUL
} |
| enum | h_state { NH
, BH
, TH
} |
| enum | bundle_state { UNBUNDLED
, BUNDLE_HEAD
, BUNDLE_TAIL
} |
|
| void | gpc_free_polygon (gpc_polygon *p) |
| void | gpc_read_polygon (FILE *fp, int read_hole_flags, gpc_polygon *p) |
| void | gpc_write_polygon (FILE *fp, int write_hole_flags, gpc_polygon *p) |
| void | gpc_add_contour (gpc_polygon *p, gpc_vertex_list *new_contour, int hole) |
| void | gpc_polygon_clip (gpc_op op, gpc_polygon *subj, gpc_polygon *clip, gpc_polygon *result) |
| void | gpc_free_tristrip (gpc_tristrip *t) |
| void | gpc_polygon_to_tristrip (gpc_polygon *s, gpc_tristrip *t) |
| void | gpc_tristrip_clip (gpc_op op, gpc_polygon *subj, gpc_polygon *clip, gpc_tristrip *result) |
◆ ABOVE
Definition at line 60 of file gpc.c.
◆ BELOW
Definition at line 61 of file gpc.c.
◆ CLIP
Definition at line 63 of file gpc.c.
◆ EQ
Value:
Definition at line 75 of file gpc.c.
◆ FALSE
Definition at line 53 of file gpc.c.
◆ FREE
Value:{if (p) {free(p); (p)= NULL;}}
Definition at line 109 of file gpc.c.
◆ FWD_MIN
| #define FWD_MIN |
( |
| v, |
|
|
| i, |
|
|
| n ) |
Value: ((v[
PREV_INDEX(i, n)].vertex.y >= v[i].vertex.y) \
&& (v[
NEXT_INDEX(i, n)].vertex.y > v[i].vertex.y))
Definition at line 83 of file gpc.c.
◆ INVERT_TRISTRIPS
| #define INVERT_TRISTRIPS FALSE |
Definition at line 66 of file gpc.c.
◆ LEFT
Definition at line 57 of file gpc.c.
◆ MALLOC
| #define MALLOC |
( |
| p, |
|
|
| b, |
|
|
| s, |
|
|
| t ) |
Value: {if ((b) > 0) { \
p= (t*)malloc(b); if (!(p)) { \
fprintf(stderr, "gpc malloc failure: %s\n", s); \
exit(0);}} else p= NULL;}
Definition at line 104 of file gpc.c.
◆ N_EDGE
| #define N_EDGE |
( |
| d, |
|
|
| e, |
|
|
| p, |
|
|
| i, |
|
|
| j ) |
Value: {(d)= (e); \
do {(d)= (d)->next;} while (!(d)->outp[(p)]); \
(i)= (d)->bot.x + (d)->dx * ((j)-(d)->bot.y);}
Definition at line 100 of file gpc.c.
◆ NEXT_INDEX
| #define NEXT_INDEX |
( |
| i, |
|
|
| n ) |
Value:
Definition at line 78 of file gpc.c.
◆ NOT_FMAX
| #define NOT_FMAX |
( |
| v, |
|
|
| i, |
|
|
| n ) |
Value:
Definition at line 86 of file gpc.c.
◆ NOT_RMAX
| #define NOT_RMAX |
( |
| v, |
|
|
| i, |
|
|
| n ) |
Value:
Definition at line 91 of file gpc.c.
◆ OPTIMAL
| #define OPTIMAL |
( |
| v, |
|
|
| i, |
|
|
| n ) |
Value:
Definition at line 80 of file gpc.c.
◆ P_EDGE
| #define P_EDGE |
( |
| d, |
|
|
| e, |
|
|
| p, |
|
|
| i, |
|
|
| j ) |
Value: {(d)= (e); \
do {(d)= (d)->prev;} while (!(d)->outp[(p)]); \
(i)= (d)->bot.x + (d)->dx * ((j)-(d)->bot.y);}
Definition at line 96 of file gpc.c.
◆ PREV_INDEX
| #define PREV_INDEX |
( |
| i, |
|
|
| n ) |
Value:
Definition at line 77 of file gpc.c.
◆ REV_MIN
| #define REV_MIN |
( |
| v, |
|
|
| i, |
|
|
| n ) |
Value:
&& (v[
NEXT_INDEX(i, n)].vertex.y >= v[i].vertex.y))
Definition at line 88 of file gpc.c.
◆ RIGHT
Definition at line 58 of file gpc.c.
◆ SUBJ
Definition at line 64 of file gpc.c.
◆ TRUE
Definition at line 54 of file gpc.c.
◆ VERTEX
| #define VERTEX |
( |
| e, |
|
|
| p, |
|
|
| s, |
|
|
| x, |
|
|
| y ) |
Value: {add_vertex(&((e)->outp[(p)]->v[(s)]), x, y); \
(e)->outp[(p)]->active++;}
Definition at line 93 of file gpc.c.
◆ bbox
◆ edge_node
◆ it_node
◆ lmt_node
◆ polygon_node
◆ sb_tree
◆ st_node
◆ vertex_node
◆ bundle_state
| Enumerator |
|---|
| UNBUNDLED | |
| BUNDLE_HEAD | |
| BUNDLE_TAIL | |
Definition at line 145 of file gpc.c.
◆ h_state
◆ vertex_type
| Enumerator |
|---|
| NUL | |
| EMX | |
| ELI | |
| TED | |
| ERI | |
| RED | |
| IMM | |
| IMN | |
| EMN | |
| EMM | |
| LED | |
| ILI | |
| BED | |
| IRI | |
| IMX | |
| FUL | |
Definition at line 118 of file gpc.c.
◆ gpc_add_contour()
◆ gpc_free_polygon()
◆ gpc_free_tristrip()
◆ gpc_polygon_clip()
◆ gpc_polygon_to_tristrip()
◆ gpc_read_polygon()
| void gpc_read_polygon |
( |
FILE * | fp, |
|
|
int | read_hole_flags, |
|
|
gpc_polygon * | p ) |
◆ gpc_tristrip_clip()
◆ gpc_write_polygon()
| void gpc_write_polygon |
( |
FILE * | fp, |
|
|
int | write_hole_flags, |
|
|
gpc_polygon * | p ) |
◆ next_h_state
Initial value:
Definition at line 234 of file gpc.c.