Root/overlap.h

1/*
2 * overlap.h - Test for overlaps
3 *
4 * Written 2009, 2010 by Werner Almesberger
5 * Copyright 2009, 2010 by Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef OVERLAP_H
14#define OVERLAP_H
15
16
17enum allow_overlap {
18    ao_none,
19    ao_touch,
20    ao_any,
21};
22
23
24/*
25 * Avoid inst.h -> layer.h -> overlay.h -> inst.h loop
26 */
27
28struct inst;
29
30
31/*
32 * "inside" returns 1 if "a" is completely enclosed by "b". If "a" == "b",
33 * that also counts as "a" being inside "b".
34 */
35
36int inside(const struct inst *a, const struct inst *b);
37
38/*
39 * "overlap" returns 1 if "a" and "b" have at least one point in common.
40 */
41
42int overlap(const struct inst *a, const struct inst *b,
43    enum allow_overlap allow);
44
45#endif /* !OVERLAP_H */
46

Archive Download this file

Branches:
master



interactive