summaryrefslogtreecommitdiff
path: root/src/h/ST_Agnodeinfo_t.java
blob: 4f2104a5e3c0cbe865c9346ebc03e7e022442b78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
/* ========================================================================
 * PlantUML : a free UML diagram generator
 * ========================================================================
 *
 * Project Info:  http://plantuml.com
 * 
 * If you like this project or if you find it useful, you can support us at:
 * 
 * http://plantuml.com/patreon (only 1$ per month!)
 * http://plantuml.com/paypal
 * 
 * This file is part of Smetana.
 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
 *
 * (C) Copyright 2009-2020, Arnaud Roques
 *
 * This translation is distributed under the same Licence as the original C program:
 * 
 *************************************************************************
 * Copyright (c) 2011 AT&T Intellectual Property 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors: See CVS logs. Details at http://www.graphviz.org/
 *************************************************************************
 *
 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
 * 
 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
 * 
 * You may obtain a copy of the License at
 * 
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package h;

import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.amiga.StarStruct;

public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr {

	private final StarStruct parent;

	public ST_Agnodeinfo_t() {
		this(null);
	}

	public ST_Agnodeinfo_t(StarStruct parent) {
		this.parent = parent;
	}

	public final ST_Agrec_s hdr = new ST_Agrec_s(this);

	public ST_shape_desc shape;
	public ST_polygon_t shape_info;
	public final ST_pointf coord = new ST_pointf(this);
	public double width, height;

	// "boxf bb",
	public double ht, lw, rw;
	public ST_textlabel_t label;
	public ST_textlabel_t xlabel;
	// "void *alg",
	public ST_Agedge_s alg = null;
	// "char state",
	// "unsigned char gui_state",
	// "boolean clustnode",
	// "unsigned char pinned",
	public int id, heapindex, hops;
	// "double *pos, dist",
	public int showboxes;

	public boolean has_port;
	// "node_t* rep",
	// "node_t *set",
	public int node_type, mark, onstack;
	public int ranktype, weight_class;
	public ST_Agnode_s next;
	public ST_Agnode_s prev;
	// "elist in, out, flat_out, flat_in, other",
	public final ST_elist in = new ST_elist(this);
	public final ST_elist out = new ST_elist(this);
	public final ST_elist flat_out = new ST_elist(this);
	public final ST_elist flat_in = new ST_elist(this);
	public final ST_elist other = new ST_elist(this);
	public ST_Agraph_s clust;
	public int UF_size;

	public ST_Agnode_s UF_parent;

	public ST_Agnode_s inleaf, outleaf;
	public int rank, order;
	public double mval;
	public final ST_elist save_in = new ST_elist(this);
	public final ST_elist save_out = new ST_elist(this);
	public final ST_elist tree_in = new ST_elist(this);
	public final ST_elist tree_out = new ST_elist(this);
	public ST_Agedge_s par;
	public int low, lim;
	public int priority;

	// "double pad[1]",
	// "}",
	// "Agnodeinfo_t");

	@Override
	public __ptr__ castTo(Class dest) {
		if (dest == ST_Agrec_s.class) {
			return hdr;
		}
		return super.castTo(dest);
	}

	@Override
	public void setDouble(String fieldName, double data) {
		if (fieldName.equals("width")) {
			this.width = data;
			return;
		}
		if (fieldName.equals("height")) {
			this.height = data;
			return;
		}
		if (fieldName.equals("ht")) {
			this.ht = data;
			return;
		}
		if (fieldName.equals("lw")) {
			this.lw = data;
			return;
		}
		if (fieldName.equals("rw")) {
			this.rw = data;
			return;
		}
		if (fieldName.equals("mval")) {
			this.mval = data;
			return;
		}
		super.setDouble(fieldName, data);
	}

	@Override
	public void setInt(String fieldName, int data) {
		if (fieldName.equals("showboxes")) {
			this.showboxes = data;
			return;
		}
		if (fieldName.equals("UF_size")) {
			this.UF_size = data;
			return;
		}
		if (fieldName.equals("mark")) {
			this.mark = data;
			return;
		}
		if (fieldName.equals("onstack")) {
			this.onstack = data;
			return;
		}
		if (fieldName.equals("priority")) {
			this.priority = data;
			return;
		}
		if (fieldName.equals("node_type")) {
			this.node_type = data;
			return;
		}
		if (fieldName.equals("rank")) {
			this.rank = data;
			return;
		}
		if (fieldName.equals("order")) {
			this.order = data;
			return;
		}
		if (fieldName.equals("ranktype")) {
			this.ranktype = data;
			return;
		}
		if (fieldName.equals("low")) {
			this.low = data;
			return;
		}
		if (fieldName.equals("lim")) {
			this.lim = data;
			return;
		}
		if (fieldName.equals("weight_class")) {
			this.weight_class = data;
			return;
		}
		super.setInt(fieldName, data);
	}

	@Override
	public __ptr__ setPtr(String fieldName, __ptr__ newData) {
		if (fieldName.equals("shape")) {
			this.shape = (ST_shape_desc) newData;
			return shape;
		}
		if (fieldName.equals("shape_info")) {
			this.shape_info = (ST_polygon_t) newData;
			return shape_info;
		}
		if (fieldName.equals("label")) {
			this.label = (ST_textlabel_t) newData;
			return label;
		}
		if (fieldName.equals("clust")) {
				this.clust = (ST_Agraph_s) newData;
			return clust;
		}
		if (fieldName.equals("next")) {
			this.next = (ST_Agnode_s) newData;
			return next;
		}
		if (fieldName.equals("prev")) {
				this.prev = (ST_Agnode_s) newData;
			return prev;
		}
		if (fieldName.equals("UF_parent")) {
			this.UF_parent = (ST_Agnode_s) newData;
			return UF_parent;
		}
		if (fieldName.equals("par")) {
			this.par = (ST_Agedge_s) newData;
			return par;
		}
		if (fieldName.equals("alg")) {
			this.alg = (ST_Agedge_s) alg;
			return alg;
		}
		return super.setPtr(fieldName, newData);
	}



	@Override
	public void setStruct(String fieldName, __struct__ newData) {
		if (fieldName.equals("save_in")) {
			save_in.copyDataFrom(newData);
			return;
		}
		if (fieldName.equals("save_out")) {
			save_out.copyDataFrom(newData);
			return;
		}
		if (fieldName.equals("out")) {
			out.copyDataFrom(newData);
			return;
		}
		if (fieldName.equals("in")) {
			in.copyDataFrom(newData);
			return;
		}
		super.setStruct(fieldName, newData);
	}
}

// typedef struct Agnodeinfo_t {
// Agrec_t hdr;
// shape_desc *shape;
// void *shape_info;
// pointf coord;
// double width, height; /* inches */
// boxf bb;
// double ht, lw, rw;
// textlabel_t *label;
// textlabel_t *xlabel;
// void *alg;
// char state;
// unsigned char gui_state; /* Node state for GUI ops */
// boolean clustnode;
//
//
// unsigned char pinned;
// int id, heapindex, hops;
// double *pos, dist;
//
//
// unsigned char showboxes;
// boolean has_port;
// node_t* rep;
// node_t *set;
//
// /* fast graph */
// char node_type, mark, onstack;
// char ranktype, weight_class;
// node_t *next, *prev;
// elist in, out, flat_out, flat_in, other;
// graph_t *clust;
//
// /* for union-find and collapsing nodes */
// int UF_size;
// node_t *UF_parent;
// node_t *inleaf, *outleaf;
//
// /* for placing nodes */
// int rank, order; /* initially, order = 1 for ordered edges */
// double mval;
// elist save_in, save_out;
//
// /* for network-simplex */
// elist tree_in, tree_out;
// edge_t *par;
// int low, lim;
// int priority;
//
// double pad[1];
//
//
// } Agnodeinfo_t;