Graphviz 14.0.2~dev.20251008.0253
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#include <util/list.h>
13
14#define SLOPE(p,q) ( ( ( p.y ) - ( q.y ) ) / ( ( p.x ) - ( q.x ) ) )
15#define MAX(a,b) ( ( a ) > ( b ) ? ( a ) : ( b ) )
16
17#define after(v) (((v)==((v)->poly->finish))?((v)->poly->start):((v)+1))
18#define prior(v) (((v)==((v)->poly->start))?((v)->poly->finish):((v)-1))
19
20 struct position {
21 double x, y;
22 };
23
24
25 struct vertex {
26 struct position pos;
27 struct polygon *poly;
29 };
30
31 struct polygon {
32 struct vertex *start, *finish;
33 };
34
35 struct intersection {
38 double x, y;
39 };
40
41typedef LIST(struct intersection) intersections_t;
42
43 struct active_edge {
44 struct vertex *name;
45 };
46
47void find_ints(struct vertex vertex_list[], size_t nvertices,
48 intersections_t *ilist);
49
51void find_intersection(struct vertex *l, struct vertex *m,
52 intersections_t *ilist);
type-generic dynamically expanding list
#define LIST(type)
Definition list.h:55
void find_intersection(struct vertex *l, struct vertex *m, intersections_t *ilist)
detect whether lines l and m intersect
Definition intersect.c:155
void find_ints(struct vertex vertex_list[], size_t nvertices, intersections_t *ilist)
Definition find_ints.c:20
struct vertex * name
Definition simple.h:44
struct vertex * firstv
Definition simple.h:36
double y
Definition simple.h:38
struct polygon * firstp
Definition simple.h:37
struct vertex * secondv
Definition simple.h:36
double x
Definition simple.h:38
struct polygon * secondp
Definition simple.h:37
struct vertex * finish
Definition simple.h:32
vertex * start
Definition legal.c:39
double x
Definition simple.h:21
double y
Definition simple.h:21
Definition legal.c:32
pointf pos
Definition legal.c:33
struct active_edge * active
Definition simple.h:28
struct polygon * poly
Definition simple.h:27