navit  0.5.1-trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups
geom.h
Go to the documentation of this file.
1 
19 #ifndef NAVIT_GEOM_H
20 #define NAVIT_GEOM_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include <glib.h>
27 #include "config.h"
28 #include "coord.h"
29 #include "item.h"
30 #include "attr.h"
31 
32 
33 #define sq(x) ((double)(x)*(x))
34 
35 struct rect {struct coord l,h;};
36 
44 
45 };
46 
49  struct coord *first,*last;
50 };
51 /* prototypes */
52 void geom_coord_copy(struct coord *from, struct coord *to, int count, int reverse);
53 void geom_coord_revert(struct coord *c, int count);
54 int geom_line_middle(struct coord *p, int count, struct coord *c);
55 long long geom_poly_area(struct coord *c, int count);
56 int geom_poly_centroid(struct coord *c, int count, struct coord *r);
57 int geom_poly_point_inside(struct coord *cp, int count, struct coord *c);
58 int geom_poly_closest_point(struct coord *pl, int count, struct coord *p, struct coord *c);
59 GList *geom_poly_segments_insert(GList *list, struct geom_poly_segment *first, struct geom_poly_segment *second, struct geom_poly_segment *third);
62 int geom_poly_segment_compatible(struct geom_poly_segment *s1, struct geom_poly_segment *s2, int dir);
65 int geom_clip_line_code(struct coord *p1, struct coord *p2, struct rect *r);
66 int geom_is_inside(struct coord *p, struct rect *r, int edge);
67 void geom_poly_intersection(struct coord *p1, struct coord *p2, struct rect *r, int edge, struct coord *ret);
68 void geom_init(void);
69 /* end of prototypes */
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif
75 
int geom_clip_line_code(struct coord *p1, struct coord *p2, struct rect *r)
Definition: geom.c:377
enum geom_poly_segment_type type
Definition: geom.h:48
GList * geom_poly_segments_remove(GList *list, struct geom_poly_segment *seg)
Definition: geom.c:253
unsigned char p[5]
Definition: mg.h:48
struct coord * last
Definition: geom.h:49
static double s1
Definition: geod_for.c:27
Definition: ch.c:47
Definition: geom.h:38
int geom_poly_segments_point_inside(GList *in, struct coord *c)
Definition: geom.c:331
long long geom_poly_area(struct coord *c, int count)
Definition: geom.c:92
void geom_init(void)
Definition: geom.c:470
int geom_poly_centroid(struct coord *c, int count, struct coord *r)
Definition: geom.c:112
geom_poly_segment_type
Definition: geom.h:37
void geom_coord_revert(struct coord *c, int count)
Definition: geom.c:78
void geom_poly_segment_destroy(struct geom_poly_segment *seg)
Definition: geom.c:246
int geom_line_middle(struct coord *p, int count, struct coord *c)
Definition: geom.c:44
int geom_is_inside(struct coord *p, struct rect *r, int edge)
Definition: geom.c:429
int geom_poly_segment_compatible(struct geom_poly_segment *s1, struct geom_poly_segment *s2, int dir)
Definition: geom.c:263
Definition: geom.h:47
Definition: geom.h:35
GList * geom_poly_segments_insert(GList *list, struct geom_poly_segment *first, struct geom_poly_segment *second, struct geom_poly_segment *third)
Definition: geom.c:209
GList * geom_poly_segments_sort(GList *in, enum geom_poly_segment_type type)
Definition: geom.c:294
struct coord * first
Definition: geom.h:49
char type[3]
Definition: garmin_img.c:130
Definition: coord.h:34
void geom_coord_copy(struct coord *from, struct coord *to, int count, int reverse)
Definition: geom.c:24
int geom_poly_point_inside(struct coord *cp, int count, struct coord *c)
Definition: geom.c:192
void geom_poly_intersection(struct coord *p1, struct coord *p2, struct rect *r, int edge, struct coord *ret)
Definition: geom.c:446
int geom_poly_closest_point(struct coord *pl, int count, struct coord *p, struct coord *c)
Definition: geom.c:149