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
;
28
struct
active_edge
*
active
;
29
};
30
31
struct
polygon
{
32
struct
vertex
*
start
, *
finish
;
33
};
34
35
struct
intersection
{
36
struct
vertex
*
firstv
, *
secondv
;
37
struct
polygon
*
firstp
, *
secondp
;
38
double
x
,
y
;
39
};
40
41
typedef
LIST
(
struct
intersection
) intersections_t;
42
43
struct
active_edge
{
44
struct
vertex
*
name
;
45
};
46
47
void
find_ints
(
struct
vertex
vertex_list[],
size_t
nvertices,
48
intersections_t *ilist);
49
51
void
find_intersection
(
struct
vertex
*l,
struct
vertex
*m,
52
intersections_t *ilist);
list.h
type-generic dynamically expanding list
LIST
#define LIST(type)
Definition
list.h:55
find_intersection
void find_intersection(struct vertex *l, struct vertex *m, intersections_t *ilist)
detect whether lines l and m intersect
Definition
intersect.c:155
find_ints
void find_ints(struct vertex vertex_list[], size_t nvertices, intersections_t *ilist)
Definition
find_ints.c:20
active_edge
Definition
simple.h:43
active_edge::name
struct vertex * name
Definition
simple.h:44
intersection
Definition
simple.h:35
intersection::firstv
struct vertex * firstv
Definition
simple.h:36
intersection::y
double y
Definition
simple.h:38
intersection::firstp
struct polygon * firstp
Definition
simple.h:37
intersection::secondv
struct vertex * secondv
Definition
simple.h:36
intersection::x
double x
Definition
simple.h:38
intersection::secondp
struct polygon * secondp
Definition
simple.h:37
polygon
Definition
legal.c:38
polygon::finish
struct vertex * finish
Definition
simple.h:32
polygon::start
vertex * start
Definition
legal.c:39
position
Definition
simple.h:20
position::x
double x
Definition
simple.h:21
position::y
double y
Definition
simple.h:21
vertex
Definition
legal.c:32
vertex::pos
pointf pos
Definition
legal.c:33
vertex::active
struct active_edge * active
Definition
simple.h:28
vertex::poly
struct polygon * poly
Definition
simple.h:27
tclpkg
tclpathplan
simple.h
Generated by
1.9.8