Graphviz
13.0.0~dev.20241220.2304
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 */
15
16
#define SLOPE(p,q) ( ( ( p.y ) - ( q.y ) ) / ( ( p.x ) - ( q.x ) ) )
17
#define MAX(a,b) ( ( a ) > ( b ) ? ( a ) : ( b ) )
18
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))
21
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
};
36
37
struct
intersection
{
38
struct
vertex
*
firstv
, *
secondv
;
39
struct
polygon
*
firstp
, *
secondp
;
40
float
x
,
y
;
41
};
42
43
struct
active_edge
{
44
struct
vertex
*
name
;
45
struct
active_edge
*
next
, *
last
;
46
};
47
struct
active_edge_list
{
48
struct
active_edge
*
first
, *
final
;
49
int
number
;
50
};
51
struct
data
{
52
size_t
nvertices
;
53
int
ninters
;
54
};
55
56
void
find_ints
(
struct
vertex
vertex_list[],
struct
data
*input,
57
struct
intersection
ilist[]);
58
60
void
find_intersection
(
struct
vertex
*l,
struct
vertex
*m,
61
struct
intersection
ilist[],
struct
data
*input);
find_intersection
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
find_ints
void find_ints(struct vertex vertex_list[], struct data *input, struct intersection ilist[])
Definition
find_ints.c:19
active_edge_list
Definition
legal.c:46
active_edge_list::first
active_edge * first
Definition
legal.c:47
active_edge_list::number
int number
Definition
legal.c:48
active_edge
Definition
legal.c:42
active_edge::name
vertex * name
Definition
legal.c:43
active_edge::next
struct active_edge * next
Definition
legal.c:44
active_edge::last
struct active_edge * last
Definition
legal.c:44
data
Definition
legal.c:50
data::ninters
int ninters
Definition
legal.c:51
data::nvertices
int nvertices
Definition
legal.c:51
intersection
Definition
simple.h:36
intersection::x
float x
Definition
simple.h:39
intersection::firstv
struct vertex * firstv
Definition
simple.h:37
intersection::firstp
struct polygon * firstp
Definition
simple.h:38
intersection::secondv
struct vertex * secondv
Definition
simple.h:37
intersection::y
float y
Definition
simple.h:39
intersection::secondp
struct polygon * secondp
Definition
simple.h:38
polygon
Definition
legal.c:37
polygon::finish
vertex * finish
Definition
legal.c:38
polygon::start
vertex * start
Definition
legal.c:38
position
Definition
simple.h:21
position::x
float x
Definition
simple.h:22
position::y
float y
Definition
simple.h:22
vertex
Definition
legal.c:31
vertex::pos
pointf pos
Definition
legal.c:32
vertex::active
active_edge * active
Definition
legal.c:34
vertex::poly
polygon * poly
Definition
legal.c:33
tclpkg
tclpathplan
simple.h
Generated by
1.9.8