GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <grass/Vect.h>
#include <grass/gis.h>
#include "dgraph.h"
#include "e_intersect.h"
Go to the source code of this file.
Data Structures | |
struct | intersection_point |
struct | seg_intersection |
struct | seg_intersection_list |
struct | seg_intersections |
Macros | |
#define | LENGTH(DX, DY) (sqrt((DX*DX)+(DY*DY))) |
#define | MIN(X, Y) ((X<Y)?X:Y) |
#define | MAX(X, Y) ((X>Y)?X:Y) |
#define | PI M_PI |
Functions | |
struct seg_intersections * | create_si_struct (int segments_count) |
void | destroy_si_struct (struct seg_intersections *si) |
void | add_ipoint1 (struct seg_intersection_list *il, int with, double dist, int ip) |
void | add_ipoint (struct line_pnts *Points, int first_seg, int second_seg, double x, double y, struct seg_intersections *si) |
void | sort_intersection_list (struct seg_intersection_list *il) |
double | get_epsilon (struct line_pnts *Points) |
struct seg_intersections * | find_all_intersections (struct line_pnts *Points) |
struct planar_graph * | pg_create_struct (int n, int e) |
void | pg_destroy_struct (struct planar_graph *pg) |
int | pg_existsedge (struct planar_graph *pg, int v1, int v2) |
void | pg_addedge1 (struct pg_vertex *v, struct pg_edge *e) |
void | pg_addedge (struct planar_graph *pg, int v1, int v2) |
struct planar_graph * | pg_create (struct line_pnts *Points) |
#define LENGTH | ( | DX, | |
DY | |||
) | (sqrt((DX*DX)+(DY*DY))) |
Definition at line 9 of file dgraph.c.
Referenced by add_ipoint().
Definition at line 14 of file dgraph.c.
Referenced by get_epsilon(), and pg_create_struct().
void add_ipoint | ( | struct line_pnts * | Points, |
int | first_seg, | ||
int | second_seg, | ||
double | x, | ||
double | y, | ||
struct seg_intersections * | si | ||
) |
Definition at line 105 of file dgraph.c.
References add_ipoint1(), G_debug(), intersection_point::group, seg_intersections::il, seg_intersections::ip, seg_intersections::ipallocated, seg_intersections::ipcount, LENGTH, intersection_point::x, intersection_point::y, and y.
Referenced by find_all_intersections().
void add_ipoint1 | ( | struct seg_intersection_list * | il, |
int | with, | ||
double | dist, | ||
int | ip | ||
) |
Definition at line 84 of file dgraph.c.
References seg_intersection_list::a, seg_intersection_list::allocated, seg_intersection_list::count, seg_intersection::dist, seg_intersection::ip, dialogs::s, and seg_intersection::with.
Referenced by add_ipoint().
struct seg_intersections* create_si_struct | ( | int | segments_count | ) |
Definition at line 49 of file dgraph.c.
References seg_intersection_list::a, seg_intersection_list::allocated, seg_intersection_list::count, seg_intersections::il, seg_intersections::ilcount, seg_intersections::ip, seg_intersections::ipallocated, seg_intersections::ipcount, and NULL.
Referenced by find_all_intersections().
void destroy_si_struct | ( | struct seg_intersections * | si | ) |
Definition at line 70 of file dgraph.c.
References seg_intersection_list::a, G_free(), seg_intersections::il, seg_intersections::ilcount, and seg_intersections::ip.
Referenced by pg_create().
struct seg_intersections* find_all_intersections | ( | struct line_pnts * | Points | ) |
Definition at line 204 of file dgraph.c.
References seg_intersection_list::a, add_ipoint(), seg_intersection_list::allocated, seg_intersection_list::count, create_si_struct(), seg_intersection::dist, EPSILON, FEQUAL, G_debug(), intersection_point::group, seg_intersections::group_count, seg_intersections::il, seg_intersections::ilcount, seg_intersection::ip, seg_intersections::ip, seg_intersections::ipallocated, seg_intersections::ipcount, segment_intersection_2d(), sort_intersection_list(), seg_intersection::with, intersection_point::x, intersection_point::y, and y.
Referenced by pg_create().
double get_epsilon | ( | struct line_pnts * | Points | ) |
void pg_addedge | ( | struct planar_graph * | pg, |
int | v1, | ||
int | v2 | ||
) |
Definition at line 409 of file dgraph.c.
References planar_graph::e, planar_graph::eallocated, planar_graph::ecount, G_debug(), G_fatal_error(), pg_addedge1(), pg_existsedge(), planar_graph::v, pg_edge::v1, pg_edge::v2, planar_graph::vcount, pg_edge::visited_left, pg_edge::visited_right, pg_edge::winding_left, and pg_edge::winding_right.
Referenced by pg_create().
Definition at line 398 of file dgraph.c.
References pg_vertex::eallocated, pg_vertex::ecount, and pg_vertex::edges.
Referenced by pg_addedge().
struct planar_graph* pg_create | ( | struct line_pnts * | Points | ) |
Definition at line 442 of file dgraph.c.
References seg_intersection_list::a, pg_vertex::angles, seg_intersection_list::count, destroy_si_struct(), pg_vertex::ecount, pg_vertex::edges, find_all_intersections(), G_debug(), intersection_point::group, seg_intersections::group_count, seg_intersections::il, seg_intersections::ilcount, seg_intersection::ip, seg_intersections::ip, seg_intersections::ipcount, pg_addedge(), pg_create_struct(), planar_graph::v, pg_edge::v1, pg_edge::v2, planar_graph::vcount, pg_vertex::x, intersection_point::x, pg_vertex::y, and intersection_point::y.
Referenced by Vect_line_buffer2().
struct planar_graph* pg_create_struct | ( | int | n, |
int | e | ||
) |
Definition at line 343 of file dgraph.c.
References planar_graph::e, planar_graph::eallocated, planar_graph::ecount, MAX, n, NULL, planar_graph::v, and planar_graph::vcount.
Referenced by pg_create().
void pg_destroy_struct | ( | struct planar_graph * | pg | ) |
Definition at line 359 of file dgraph.c.
References pg_vertex::angles, planar_graph::e, pg_vertex::edges, G_free(), planar_graph::v, and planar_graph::vcount.
Referenced by Vect_line_buffer2().
int pg_existsedge | ( | struct planar_graph * | pg, |
int | v1, | ||
int | v2 | ||
) |
Definition at line 373 of file dgraph.c.
References pg_vertex::ecount, pg_vertex::edges, planar_graph::v, pg_edge::v1, and pg_edge::v2.
Referenced by pg_addedge().
void sort_intersection_list | ( | struct seg_intersection_list * | il | ) |
Definition at line 136 of file dgraph.c.
References seg_intersection_list::a, seg_intersection_list::count, seg_intersection::dist, G_debug(), min, and n.
Referenced by find_all_intersections().