Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
simple.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include <stddef.h>
12
13#define MAXINTS 10000 /* modify this line to reflect the max no. of
14 intersections you want reported -- 50000 seems to break the program */
16#define SLOPE(p,q) ( ( ( p.y ) - ( q.y ) ) / ( ( p.x ) - ( q.x ) ) )
17#define MAX(a,b) ( ( a ) > ( b ) ? ( a ) : ( b ) )
19#define after(v) (((v)==((v)->poly->finish))?((v)->poly->start):((v)+1))
20#define prior(v) (((v)==((v)->poly->start))?((v)->poly->finish):((v)-1))
22 struct position {
23 float x, y;
24 };
25
26
27 struct vertex {
28 struct position pos;
29 struct polygon *poly;
30 struct active_edge *active;
31 };
32
33 struct polygon {
34 struct vertex *start, *finish;
35 };
37 struct intersection {
40 float x, y;
41 };
42
43 struct active_edge {
44 struct vertex *name;
45 struct active_edge *next, *last;
46 };
48 struct active_edge *first, *final;
49 int number;
50 };
51 struct data {
52 size_t nvertices;
53 int ninters;
54 };
55
56void find_ints(struct vertex vertex_list[], struct data *input,
57 struct intersection ilist[]);
58
60void find_intersection(struct vertex *l, struct vertex *m,
61 struct intersection ilist[], struct data *input);
void find_intersection(struct vertex *l, struct vertex *m, struct intersection ilist[], struct data *input)
detect whether lines l and m intersect
Definition intersect.c:159
void find_ints(struct vertex vertex_list[], struct data *input, struct intersection ilist[])
Definition find_ints.c:19
active_edge * first
Definition legal.c:47
vertex * name
Definition legal.c:43
struct active_edge * next
Definition legal.c:44
struct active_edge * last
Definition legal.c:44
Definition legal.c:50
int ninters
Definition legal.c:51
int nvertices
Definition legal.c:51
float x
Definition simple.h:39
struct vertex * firstv
Definition simple.h:37
struct polygon * firstp
Definition simple.h:38
struct vertex * secondv
Definition simple.h:37
float y
Definition simple.h:39
struct polygon * secondp
Definition simple.h:38
vertex * finish
Definition legal.c:38
vertex * start
Definition legal.c:38
float x
Definition simple.h:22
float y
Definition simple.h:22
Definition legal.c:31
pointf pos
Definition legal.c:32
active_edge * active
Definition legal.c:34
polygon * poly
Definition legal.c:33