00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00021
00022
00023 #include <stdio.h>
00024 #include "pathplan.h"
00025
00026 #define MAXINTS 10000
00027
00028
00029 #define SLOPE(p,q) ( ( ( p.y ) - ( q.y ) ) / ( ( p.x ) - ( q.x ) ) )
00030
00031 #define after(v) (((v)==((v)->poly->finish))?((v)->poly->start):((v)+1))
00032 #define prior(v) (((v)==((v)->poly->start))?((v)->poly->finish):((v)-1))
00033
00034 struct position {
00035 double x, y;
00036 };
00037
00038
00039 struct vertex {
00040 struct position pos;
00041 struct polygon *poly;
00042 struct active_edge *active;
00043 };
00044
00045 struct polygon {
00046 struct vertex *start, *finish;
00047 };
00048
00049 struct intersection {
00050 struct vertex *firstv, *secondv;
00051 struct polygon *firstp, *secondp;
00052 double x, y;
00053 };
00054
00055 struct active_edge {
00056 struct vertex *name;
00057 struct active_edge *next, *last;
00058 };
00059 struct active_edge_list {
00060 struct active_edge *first, *final;
00061 int number;
00062 };
00063 struct data {
00064 int nvertices, npolygons, ninters;
00065 };
00066
00067 #ifdef __cplusplus
00068 }
00069 #endif