Debian Codegraph @

lib/ortho/structures.h

raw
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 #pragma once
12
13 #include "types.h"
14 #include "cgraph.h"
15 #include <ortho/rawgraph.h>
16 #include <stdbool.h>
17 #include <stddef.h>
18 #include <util/list.h>
19
20 typedef struct {
21 double p1, p2;
22 } paird;
23
24 typedef struct {
25 int a,b;
26 } pair;
27
28 typedef struct {
29 pair t1, t2;
30 } pair2;
31
32 typedef enum {B_NODE, B_UP, B_LEFT, B_DOWN, B_RIGHT} bend;
33
34 /* Example : segment connecting maze point (3,2)
35 * and (3,8) has isVert = 1, common coordinate = 3, p1 = 2, p2 = 8
36 */
37 typedef struct segment {
38 bool isVert;
39 double comm_coord; /* the common coordinate */
40 paird p; /* end points */
41 bend l1, l2;
42 size_t ind_no; ///< index number of this segment in its channel
43 int track_no; /* track number assigned in the channel */
44 struct segment* prev;
45 struct segment* next;
46 } segment;
47
48 typedef struct {
49 size_t n;
50 segment* segs;
51 } route;
52
53 typedef LIST(segment *) seg_list_t;
54
55 typedef struct {
56 Dtlink_t link;
57 paird p; /* extrema of channel */
58 seg_list_t seg_list; ///< segment pointers
59 rawgraph* G;
60 struct cell* cp;
61 } channel;
62
63 #define N_DAD(n) (n)->n_dad