1/* $Id$Revision: */
2/* vim:set shiftwidth=4 ts=8: */
3
4/*************************************************************************
5 * Copyright (c) 2011 AT&T Intellectual Property
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 * Contributors: See CVS logs. Details at http://www.graphviz.org/
12 *************************************************************************/
13
14#ifndef STRUCTURES_H
15#define STRUCTURES_H
16
17#include "types.h"
18#include "cgraph.h"
19#include "rawgraph.h"
20
21typedef struct {
22 double p1, p2;
23} paird;
24
25typedef struct {
26 int a,b;
27} pair;
28
29typedef struct {
30 pair t1, t2;
31} pair2;
32
33typedef enum {B_NODE, B_UP, B_LEFT, B_DOWN, B_RIGHT} bend;
34
35/* Example : segment connecting maze point (3,2)
36 * and (3,8) has isVert = 1, common coordinate = 3, p1 = 2, p2 = 8
37 */
38typedef struct segment {
39 boolean isVert;
40 boolean flipped;
41 double comm_coord; /* the common coordinate */
42 paird p; /* end points */
43 bend l1, l2;
44 int ind_no; /* index number of this segment in its channel */
45 int track_no; /* track number assigned in the channel */
46 struct segment* prev;
47 struct segment* next;
48} segment;
49
50typedef struct {
51 int n;
52 segment* segs;
53} route;
54
55typedef struct {
56 Dtlink_t link;
57 paird p; /* extrema of channel */
58 int cnt; /* number of segments */
59 segment** seg_list; /* array of segment pointers */
60 rawgraph* G;
61 struct cell* cp;
62} channel;
63
64#if 0
65typedef struct {
66 int i1, i2, j;
67 int cnt;
68 int* seg_list; /* list of indices of the segment list */
69
70 rawgraph* G;
71} hor_channel;
72
73typedef struct {
74 hor_channel* hs;
75 int cnt;
76} vhor_channel;
77
78typedef struct {
79 int i, j1, j2;
80 int cnt;
81 int* seg_list; /* list of indices of the segment list */
82
83 rawgraph* G;
84} vert_channel;
85
86typedef struct {
87 vert_channel* vs;
88 int cnt;
89} vvert_channel;
90#endif
91
92#define N_DAD(n) (n)->n_dad
93
94#endif
95