Debian Codegraph @

src/gen/lib/pathplan/cvt__c.java

raw symbols SCIP
1 /* ========================================================================
2 * PlantUML : a free UML diagram generator
3 * ========================================================================
4 *
5 * Project Info: http://plantuml.com
6 *
7 * If you like this project or if you find it useful, you can support us at:
8 *
9 * http://plantuml.com/patreon (only 1$ per month!)
10 * http://plantuml.com/paypal
11 *
12 * This file is part of Smetana.
13 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
14 *
15 * (C) Copyright 2009-2020, Arnaud Roques
16 *
17 * This translation is distributed under the same Licence as the original C program:
18 *
19 *************************************************************************
20 * Copyright (c) 2011 AT&T Intellectual Property
21 * All rights reserved. This program and the accompanying materials
22 * are made available under the terms of the Eclipse Public License v1.0
23 * which accompanies this distribution, and is available at
24 * http://www.eclipse.org/legal/epl-v10.html
25 *
26 * Contributors: See CVS logs. Details at http://www.graphviz.org/
27 *************************************************************************
28 *
29 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
30 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
31 *
32 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
33 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
34 *
35 * You may obtain a copy of the License at
36 *
37 * http://www.eclipse.org/legal/epl-v10.html
38 *
39 * Unless required by applicable law or agreed to in writing, software
40 * distributed under the License is distributed on an "AS IS" BASIS,
41 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42 * See the License for the specific language governing permissions and
43 * limitations under the License.
44 *
45 */
46 package gen.lib.pathplan;
47 import static smetana.core.JUtilsDebug.ENTERING;
48 import static smetana.core.JUtilsDebug.LEAVING;
49 import static smetana.core.Macro.UNSUPPORTED;
50 import h.ST_pointf;
51
52 public class cvt__c {
53 //1 baedz5i9est5csw3epz3cv7z
54 // typedef Ppoly_t Ppolyline_t
55
56
57 //1 7pb9zum2n4wlgil34lvh8i0ts
58 // typedef double COORD
59
60
61 //1 e75el5ykqd72ikokwkl7j2epc
62 // typedef COORD **array2
63
64
65 //1 ej0x6pmbhu30xkhld8bcz4gwv
66 // typedef Ppoint_t ilcoord_t
67
68
69
70
71 //3 1xzun807liyzhh33wecbjr36t
72 // static void *mymalloc(size_t newsize)
73 public static Object mymalloc(Object... arg) {
74 UNSUPPORTED("4sbfatyg3fhc2c20h2xhk3mx9"); // static void *mymalloc(size_t newsize)
75 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
76 UNSUPPORTED("5ccnu5m92hidffpixzo964tna"); // void *rv;
77 UNSUPPORTED("bl8qbtd4wj1z7r9hhretdafhi"); // if (newsize > 0)
78 UNSUPPORTED("911ost0j5419vf2t0dcv9syl0"); // rv = malloc(newsize);
79 UNSUPPORTED("div10atae09n36x269sl208r1"); // else
80 UNSUPPORTED("c4gs555ukbqlir0vf7test5fk"); // rv = (void *) 0;
81 UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
82 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
83
84 throw new UnsupportedOperationException();
85 }
86
87
88
89
90 //3 4pfhgk8c796mhpyfqs8fd3fy9
91 // vconfig_t *Pobsopen(Ppoly_t ** obs, int n_obs)
92 public static Object Pobsopen(Object... arg) {
93 UNSUPPORTED("dz610tzpr6mx5ioen71yt9lw2"); // vconfig_t *Pobsopen(Ppoly_t ** obs, int n_obs)
94 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
95 UNSUPPORTED("6h763iz1lhdcesjffuohit038"); // vconfig_t *rv;
96 UNSUPPORTED("6fyedst0dusa16an4rkc8wowr"); // int poly_i, pt_i, i, n;
97 UNSUPPORTED("aa6b5n017in5orglen9ktgs9a"); // int start, end;
98 UNSUPPORTED("2izagha9qm9hfmw2zjtq0yyqy"); // rv = malloc(sizeof(vconfig_t));
99 UNSUPPORTED("3932k5yue8e2mb5g02yh32q3u"); // if (!rv) {
100 UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
101 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
102 UNSUPPORTED("537ma80b4p1qif18ogmioua6f"); // /* get storage */
103 UNSUPPORTED("5479ingjjk6qn2seps3k0btka"); // n = 0;
104 UNSUPPORTED("6pryh49akl0qqyof6t9enjse3"); // for (poly_i = 0; poly_i < n_obs; poly_i++)
105 UNSUPPORTED("7mn5akiq7xlxj3bhbg2hjyw43"); // n = n + obs[poly_i]->pn;
106 UNSUPPORTED("4w0j0xkeflf96a4msrd1djw60"); // rv->P = mymalloc(n * sizeof(Ppoint_t));
107 UNSUPPORTED("d9e6s9bw2zqrvvmjjx99t8om5"); // rv->start = mymalloc((n_obs + 1) * sizeof(int));
108 UNSUPPORTED("cxuszkdst7q9ivsqe8ioe2yrw"); // rv->next = mymalloc(n * sizeof(int));
109 UNSUPPORTED("burxtua12xjppcbmval0ggvxg"); // rv->prev = mymalloc(n * sizeof(int));
110 UNSUPPORTED("b6qs2ihtcpwqt5curgpzssi0t"); // rv->N = n;
111 UNSUPPORTED("y8pzts8dvguxzsn2xoi6o7xr"); // rv->Npoly = n_obs;
112 UNSUPPORTED("85r5n7qhz9w2j71ctswryvhs9"); // /* build arrays */
113 UNSUPPORTED("9z3er49pc4h2rxja5r9grdo0h"); // i = 0;
114 UNSUPPORTED("a9lqcyerwxbnkjv25bsdl8zm4"); // for (poly_i = 0; poly_i < n_obs; poly_i++) {
115 UNSUPPORTED("c9man7k6dcktdn55nx8sc8hu2"); // start = i;
116 UNSUPPORTED("l4rzwhaigo1dmtzc7olyk6y2"); // rv->start[poly_i] = start;
117 UNSUPPORTED("do78yh8gawc61ywbjurslrmc7"); // end = start + obs[poly_i]->pn - 1;
118 UNSUPPORTED("ef97u4pbd8y1vhy459q7r4jlr"); // for (pt_i = 0; pt_i < obs[poly_i]->pn; pt_i++) {
119 UNSUPPORTED("duznt0bepum3jc0h5n1g0j6r1"); // rv->P[i] = obs[poly_i]->ps[pt_i];
120 UNSUPPORTED("cbqnpyguo28y5hi6788clitol"); // rv->next[i] = i + 1;
121 UNSUPPORTED("75iqn38g2hugox3zmrro1eruh"); // rv->prev[i] = i - 1;
122 UNSUPPORTED("1lo0ackow66iudrq1gb15y3ry"); // i++;
123 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
124 UNSUPPORTED("c62cdvr5s10dskbn3g3nv130u"); // rv->next[end] = start;
125 UNSUPPORTED("b77mp3jilxwb6gjveuwuldrvq"); // rv->prev[start] = end;
126 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
127 UNSUPPORTED("1u0umi0jiwt4fdh8n0nr1j8ns"); // rv->start[poly_i] = i;
128 UNSUPPORTED("26uynreqxoitqc5md315okjca"); // visibility(rv);
129 UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
130 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
131
132 throw new UnsupportedOperationException();
133 }
134
135
136
137
138 //3 e4migs6coi22m83vhdmasdpq2
139 // void Pobsclose(vconfig_t * config)
140 public static Object Pobsclose(Object... arg) {
141 UNSUPPORTED("54tyi1oh5fd4a8lh1107ysppi"); // void Pobsclose(vconfig_t * config)
142 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
143 UNSUPPORTED("9i5pewoqi7dxp9hvkbh6p1kcd"); // free(config->P);
144 UNSUPPORTED("dyvruo3b8nwce9o0q2bcycvb6"); // free(config->start);
145 UNSUPPORTED("7at6jri0rjj24yyxd75duo75z"); // free(config->next);
146 UNSUPPORTED("akdd6tfoylim5pdwp1w2o0j20"); // free(config->prev);
147 UNSUPPORTED("e5hnzu51syeuaqx4dgswvpyje"); // if (config->vis) {
148 UNSUPPORTED("8rwcdtu45rfzpyn5z46pkkhl6"); // free(config->vis[0]);
149 UNSUPPORTED("i31zzb5907stuz3hbwbdcbhp"); // free(config->vis);
150 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
151 UNSUPPORTED("61miap7xqs0is8dzf039j57nq"); // free(config);
152 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
153
154 throw new UnsupportedOperationException();
155 }
156
157
158
159
160 //3 8doijz2zl7icgvbs59qtqw2e6
161 // int Pobspath(vconfig_t * config, Ppoint_t p0, int poly0, Ppoint_t p1, int poly1, Ppolyline_t * output_route)
162 public static Object Pobspath(Object... arg) {
163 UNSUPPORTED("es9wttiuk2pkcqinglvdetmxh"); // int Pobspath(vconfig_t * config, Ppoint_t p0, int poly0, Ppoint_t p1,
164 UNSUPPORTED("8waigfzvwmpsy4nk2ybswloiu"); // int poly1, Ppolyline_t * output_route)
165 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
166 UNSUPPORTED("e2p3zngy6gppxlaxnza2atj67"); // int i, j, *dad;
167 UNSUPPORTED("e62ya6atrka5y0vefbxn9gvsd"); // int opn;
168 UNSUPPORTED("eio9tluzd00a9allc8rpk3sn3"); // Ppoint_t *ops;
169 UNSUPPORTED("ekriswamubxah5xbwpyub2glk"); // COORD *ptvis0, *ptvis1;
170 UNSUPPORTED("f3ay7pz98tp6wbnj91hh3kj"); // ptvis0 = ptVis(config, poly0, p0);
171 UNSUPPORTED("9d1jc97ql0y8dloqkw50mmzdj"); // ptvis1 = ptVis(config, poly1, p1);
172 UNSUPPORTED("7qs63rfsr6g17tfm9o33b3su6"); // dad = makePath(p0, poly0, ptvis0, p1, poly1, ptvis1, config);
173 UNSUPPORTED("b26wav438av32fij4hegkkgu6"); // opn = 1;
174 UNSUPPORTED("2vrbfn91t93xoyd85qnu32sy2"); // for (i = dad[config->N]; i != config->N + 1; i = dad[i])
175 UNSUPPORTED("3qey9tefagfie3qnkiki4nf6l"); // opn++;
176 UNSUPPORTED("4196zy1bbqiysbv1glm6f6rs5"); // opn++;
177 UNSUPPORTED("3snkzyfbaaeiotrx64sx9tpni"); // ops = malloc(opn * sizeof(Ppoint_t));
178 UNSUPPORTED("63lio5qjaoeboqhgiam7y7q0q"); // j = opn - 1;
179 UNSUPPORTED("ebor0877uiofxllu68qt0ni85"); // ops[j--] = p1;
180 UNSUPPORTED("2vrbfn91t93xoyd85qnu32sy2"); // for (i = dad[config->N]; i != config->N + 1; i = dad[i])
181 UNSUPPORTED("53win5ovenp62h9g9qdgiu4wq"); // ops[j--] = config->P[i];
182 UNSUPPORTED("2edzhlekn1dh9s7bk2yb2b4sm"); // ops[j] = p0;
183 UNSUPPORTED("7i8zqi2jg8upn1wjzqf5il16o"); // assert(j == 0);
184 UNSUPPORTED("4sudedq08kppbbadyqc21is7x"); // if (ptvis0)
185 UNSUPPORTED("6zdjevsy6rl1dvkniswano9ae"); // free(ptvis0);
186 UNSUPPORTED("1rp1r4ghfa31f1v07hmkoglxl"); // if (ptvis1)
187 UNSUPPORTED("au3lcfls1tf7t5z3skjuvfuv8"); // free(ptvis1);
188 UNSUPPORTED("70yf545lz9a6vp2qw2i0q9mr1"); // output_route->pn = opn;
189 UNSUPPORTED("e9qedm1c6q4ehjjxi6v3u68ms"); // output_route->ps = ops;
190 UNSUPPORTED("6qqkuw5cd4ebshxoji365xfkz"); // free(dad);
191 UNSUPPORTED("2mmsh4mer8e3bkt2jk4gf4cyq"); // return ((!(0)));
192 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
193
194 throw new UnsupportedOperationException();
195 }
196
197
198
199
200 //3 dya1texcjg4i2qyusjnmin7d1
201 // int Pobsbarriers(vconfig_t * config, Pedge_t ** barriers, int *n_barriers)
202 public static Object Pobsbarriers(Object... arg) {
203 UNSUPPORTED("bbaf03fwbv3733qfrsvd4eoom"); // int Pobsbarriers(vconfig_t * config, Pedge_t ** barriers, int *n_barriers)
204 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
205 UNSUPPORTED("dzpsknrwv8qkqq20hjnjpjn68"); // int i, j;
206 UNSUPPORTED("cjg450i3kmtjepexj18lku2oz"); // *barriers = malloc(config->N * sizeof(Pedge_t));
207 UNSUPPORTED("b77jnv231p5441j8pofch6qjp"); // *n_barriers = config->N;
208 UNSUPPORTED("bt2nq7y73jm09gh8xqv1scjog"); // for (i = 0; i < config->N; i++) {
209 UNSUPPORTED("5xul9j0873agp8fm22e0halsf"); // barriers[i]->a.x = config->P[i].x;
210 UNSUPPORTED("ca43a9xp0edjts9sme3eysq0v"); // barriers[i]->a.y = config->P[i].y;
211 UNSUPPORTED("blqt6zbpyfb8cpsh8az3u154y"); // j = config->next[i];
212 UNSUPPORTED("4iqggxhzor4r40emialldaqms"); // barriers[i]->b.x = config->P[j].x;
213 UNSUPPORTED("68b84cgnmyt50bomnqfrw8nau"); // barriers[i]->b.y = config->P[j].y;
214 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
215 UNSUPPORTED("3tcgz4dupb6kw5tdk7n3pca2l"); // return 1;
216 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
217
218 throw new UnsupportedOperationException();
219 }
220
221
222 //1 7jm8pu31yvt3fi0tc6t6go9tr
223 // static Ppoint_t Bezpt[1000]
224
225
226 //1 7h8jm5n1tlklgw1yaxx7dlvsx
227 // static int Bezctr
228
229
230
231
232 //3 oneie60d998qei37slgf3ce4
233 // static void addpt(Ppoint_t p)
234 public static Object addpt(Object... arg) {
235 UNSUPPORTED("3r6t7ceh9f1lplt1ewgna2ynh"); // static void addpt(Ppoint_t p)
236 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
237 UNSUPPORTED("ad7t5k9prp8sma4kc9pwszul3"); // if ((Bezctr == 0) ||
238 UNSUPPORTED("eam5jo5658c75g0tppvkhcu31"); // (Bezpt[Bezctr - 1].x != p.x) || (Bezpt[Bezctr - 1].y != p.y))
239 UNSUPPORTED("a0616m6xy91u5reig6r0gz4pg"); // Bezpt[Bezctr++] = p;
240 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
241
242 throw new UnsupportedOperationException();
243 }
244
245
246
247
248 //3 3xaxtxslceffm0wx9zcpiqjgb
249 // static ilcoord_t Bezier(ilcoord_t * V, int degree, double t, ilcoord_t * Left, ilcoord_t * Right)
250 public static ST_pointf Bezier(ST_pointf V, int degree, double t, ST_pointf Left, ST_pointf Right) {
251 // WARNING!! STRUCT
252 return Bezier_w_(V, degree, t, Left, Right).copy();
253 }
254 private static ST_pointf Bezier_w_(ST_pointf V, int degree, double t, ST_pointf Left, ST_pointf Right) {
255 ENTERING("3xaxtxslceffm0wx9zcpiqjgb","Bezier");
256 try {
257 int i, j; /* Index variables */
258 UNSUPPORTED("3a1zgxysa3t54vyq7k6z62wlj"); // ilcoord_t Vtemp[5 + 1][5 + 1];
259 UNSUPPORTED("byow1e8wyl29b607ktk3oabre"); // /* Copy control points */
260 UNSUPPORTED("88y00f5lc64b0ryy0gup9n4sb"); // for (j = 0; j <= degree; j++) {
261 UNSUPPORTED("41awql5ne79yczmc4ilerplz3"); // Vtemp[0][j] = V[j];
262 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
263 UNSUPPORTED("djq9b7i3h3uq77dr40ha5o1kr"); // /* Triangle computation */
264 UNSUPPORTED("227fs1hi4i0vh0vutu3yqxarc"); // for (i = 1; i <= degree; i++) {
265 UNSUPPORTED("85sv74izli9gqstg0gqk2oznr"); // for (j = 0; j <= degree - i; j++) {
266 UNSUPPORTED("6iowld1ly15t67xtpbyotvond"); // Vtemp[i][j].x =
267 UNSUPPORTED("c9tdp4smiiyeg0r8t5udg667x"); // (1.0 - t) * Vtemp[i - 1][j].x + t * Vtemp[i - 1][j + 1].x;
268 UNSUPPORTED("d7sb593gdk2getmc8zbflz6wq"); // Vtemp[i][j].y =
269 UNSUPPORTED("d3h6zzsk3tsvl81ds9isu6lrl"); // (1.0 - t) * Vtemp[i - 1][j].y + t * Vtemp[i - 1][j + 1].y;
270 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
271 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
272 UNSUPPORTED("7eb3j7c6ls3zjqm1bteyyg8dd"); // if (Left != ((ilcoord_t *)0))
273 UNSUPPORTED("dzkatwg4oc51psd4chd1yao6"); // for (j = 0; j <= degree; j++)
274 UNSUPPORTED("7zwjg663emkibah35euakizmj"); // Left[j] = Vtemp[j][0];
275 UNSUPPORTED("6h28oxt02m95ar9k62xgzs2"); // if (Right != ((ilcoord_t *)0))
276 UNSUPPORTED("dzkatwg4oc51psd4chd1yao6"); // for (j = 0; j <= degree; j++)
277 UNSUPPORTED("1rki0omqbix35s4wfx442v4ty"); // Right[j] = Vtemp[degree - j][j];
278 UNSUPPORTED("b23mms6jm55li1q74etrttq6m"); // return (Vtemp[degree][0]);
279 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
280
281 throw new UnsupportedOperationException();
282 } finally {
283 LEAVING("3xaxtxslceffm0wx9zcpiqjgb","Bezier");
284 }
285 }
286
287
288
289
290 //3 2e1dbsqqgp7k8i5doa7prt6jc
291 // static void append_bezier(Ppoint_t * bezier)
292 public static Object append_bezier(Object... arg) {
293 UNSUPPORTED("5zm80zw3vn3gsj6zre2ynedck"); // static void append_bezier(Ppoint_t * bezier)
294 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
295 UNSUPPORTED("544oxt8zbzz0u06hmg8ivxp3p"); // double a;
296 UNSUPPORTED("2lyetpb097xdkox7xgnw605xd"); // ilcoord_t left[4], right[4];
297 UNSUPPORTED("4c5enrmeixpvwutnq2tbdb7ck"); // a = fabs(area2(bezier[0], bezier[1], bezier[2]))
298 UNSUPPORTED("4fcyo20wfetvf2l99r0pchq0l"); // + fabs(area2(bezier[2], bezier[3], bezier[0]));
299 UNSUPPORTED("3y36bo7zjs0dx2q4g6sl5awol"); // if (a < .5) {
300 UNSUPPORTED("ar7l14fqklgvayi8jwebecz25"); // addpt(bezier[0]);
301 UNSUPPORTED("268jkzt57hijh09gst1b1yl1e"); // addpt(bezier[3]);
302 UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
303 UNSUPPORTED("4k2sg523wku7lp7tcc9l6ggoj"); // (void) Bezier(bezier, 3, .5, left, right);
304 UNSUPPORTED("bct90i183hbs4qhx4mmpnep1i"); // append_bezier(left);
305 UNSUPPORTED("5dcnwocv9fm5psu807c2hpft6"); // append_bezier(right);
306 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
307 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
308
309 throw new UnsupportedOperationException();
310 }
311
312
313 }