Debian Codegraph @

src/gen/lib/pathplan/triang__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.Macro.UNSUPPORTED;
48 import smetana.core.jmp_buf;
49
50 public class triang__c {
51 //1 baedz5i9est5csw3epz3cv7z
52 // typedef Ppoly_t Ppolyline_t
53
54
55 //1 7pb9zum2n4wlgil34lvh8i0ts
56 // typedef double COORD
57
58
59 //1 540u5gu9i0x1wzoxqqx5n2vwp
60 // static jmp_buf jbuf
61 private static jmp_buf jbuf = new jmp_buf();
62
63
64
65 //3 9l5xg5aowmh2yvhbzseo8ws0i
66 // static int dpd_ccw(Ppoint_t * p1, Ppoint_t * p2, Ppoint_t * p3)
67 public static Object dpd_ccw(Object... arg) {
68 UNSUPPORTED("66u8hjpmzz1u1podxvft7tqbr"); // static int dpd_ccw(Ppoint_t * p1, Ppoint_t * p2, Ppoint_t * p3)
69 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
70 UNSUPPORTED("8l4kygp6iwsssqf4pip9kt8ih"); // double d =
71 UNSUPPORTED("a5i2lyqa3iblrijf5i8d2gc2l"); // ((p1->y - p2->y) * (p3->x - p2->x)) -
72 UNSUPPORTED("8vxxbchvixjdl9bnn73jj0ken"); // ((p3->y - p2->y) * (p1->x - p2->x));
73 UNSUPPORTED("2duek0l6qi5enj1p52uzx935s"); // return (d > 0) ? 2 : ((d < 0) ? 1 : 3);
74 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
75
76 throw new UnsupportedOperationException();
77 }
78
79
80
81
82 //3 3cpm045bql7do4skuvm0gysbz
83 // int Ptriangulate(Ppoly_t * polygon, void (*fn) (void *, Ppoint_t *), void *vc)
84 public static Object Ptriangulate(Object... arg) {
85 UNSUPPORTED("9wq0zzi4wsqf1qmh5lisb5tur"); // int Ptriangulate(Ppoly_t * polygon, void (*fn) (void *, Ppoint_t *),
86 UNSUPPORTED("aiup6hqt7vuonmdnhtadcpyyg"); // void *vc)
87 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
88 UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
89 UNSUPPORTED("79ig2xj5nogd41esx7798m82t"); // int pointn;
90 UNSUPPORTED("vbp57y34yrr1stscac6ij6wl"); // Ppoint_t **pointp;
91 UNSUPPORTED("8i4e5opqy9uomak4ow0vdfkyu"); // pointn = polygon->pn;
92 UNSUPPORTED("c7ts682vzzct8ooh1x4u7zy09"); // pointp = (Ppoint_t **) malloc(pointn * sizeof(Ppoint_t *));
93 UNSUPPORTED("69msjv91b63ali4jnpa1iae96"); // for (i = 0; i < pointn; i++)
94 UNSUPPORTED("66ykefpx20ohahuts3stdhpv4"); // pointp[i] = &(polygon->ps[i]);
95 UNSUPPORTED("ci9r8sj8tbc6yer5c8cebb0cm"); // if (setjmp(jbuf)) {
96 UNSUPPORTED("1hfjyk5uqecl2hrvu9vdplqm9"); // free(pointp);
97 UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
98 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
99 UNSUPPORTED("3epdv4rxh1dblgm1uu3cirnns"); // triangulate(pointp, pointn, fn, vc);
100 UNSUPPORTED("d7eui8n8t6ty33reomekpb4uy"); // free(pointp);
101 UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
102 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
103
104 throw new UnsupportedOperationException();
105 }
106
107
108
109
110 //3 db1gjkgbhdyik8njcwxidnm06
111 // static void triangulate(Ppoint_t ** pointp, int pointn, void (*fn) (void *, Ppoint_t *), void *vc)
112 public static Object triangulate(Object... arg) {
113 UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
114 UNSUPPORTED("cycr5htq0awpt4lysrda94z75"); // triangulate(Ppoint_t ** pointp, int pointn,
115 UNSUPPORTED("b80kmvbhu4qon4ithxw7iqghl"); // void (*fn) (void *, Ppoint_t *), void *vc)
116 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
117 UNSUPPORTED("47im1y8cb3jov8e7vfoq6976"); // int i, ip1, ip2, j;
118 UNSUPPORTED("9vrtuc7i6xtgewghaf5mhcvw7"); // Ppoint_t A[3];
119 UNSUPPORTED("exebh5u9jcrlenwyhvh1q7ydp"); // if (pointn > 3) {
120 UNSUPPORTED("17s2by4i08aiirk34qoufejm1"); // for (i = 0; i < pointn; i++) {
121 UNSUPPORTED("4s8abivdx5zru8lby110pnbr0"); // ip1 = (i + 1) % pointn;
122 UNSUPPORTED("el7eqg9364rd6m2jmmgd1x0w6"); // ip2 = (i + 2) % pointn;
123 UNSUPPORTED("eugvvlona15w69kyxc7uao5rn"); // if (dpd_isdiagonal(i, ip2, pointp, pointn)) {
124 UNSUPPORTED("7jt096yrjcjaka77bxj8ow4ur"); // A[0] = *pointp[i];
125 UNSUPPORTED("798zfru1x3zjftqir7h3184cy"); // A[1] = *pointp[ip1];
126 UNSUPPORTED("5sabp0m6pi8misjllge9rhs6i"); // A[2] = *pointp[ip2];
127 UNSUPPORTED("3tx9m6zu4gpdon7itam4m4zj6"); // fn(vc, A);
128 UNSUPPORTED("cwdl8048erup925vkw9wm50tm"); // j = 0;
129 UNSUPPORTED("b406sjxectwut71daq5renp3v"); // for (i = 0; i < pointn; i++)
130 UNSUPPORTED("17mmkxxi6uyt2rtn26wqpnjq0"); // if (i != ip1)
131 UNSUPPORTED("20nocric7p5rwm1keba2y9u9s"); // pointp[j++] = pointp[i];
132 UNSUPPORTED("f1yvgmqdgpzz2ld9mihtb1ny6"); // triangulate(pointp, pointn - 1, fn, vc);
133 UNSUPPORTED("6bj8inpmr5ulm16jmfxsstjtn"); // return;
134 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
135 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
136 UNSUPPORTED("efu63j23oynz0w42y5x2ccgl"); // longjmp(jbuf,1);
137 UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
138 UNSUPPORTED("du12jp7y7eb3k2lzktkq97ocv"); // A[0] = *pointp[0];
139 UNSUPPORTED("3zxe87agbrkgcdv3ezmeb4e0r"); // A[1] = *pointp[1];
140 UNSUPPORTED("7kqa9p0bujx0a7qu7g0l8u5gf"); // A[2] = *pointp[2];
141 UNSUPPORTED("4a2pon3qy0ncl805797s5a1cg"); // fn(vc, A);
142 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
143 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
144
145 throw new UnsupportedOperationException();
146 }
147
148
149
150
151 //3 6g3z4d4wjf8de2l784sgpmmol
152 // static int dpd_isdiagonal(int i, int ip2, Ppoint_t ** pointp, int pointn)
153 public static Object dpd_isdiagonal(Object... arg) {
154 UNSUPPORTED("6igaattr8mose3ux86cjxqy8f"); // static int dpd_isdiagonal(int i, int ip2, Ppoint_t ** pointp, int pointn)
155 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
156 UNSUPPORTED("i2fy680j9sex9dnpbrntxl4b"); // int ip1, im1, j, jp1, res;
157 UNSUPPORTED("5lvzmrs5o783t9b2alzlkj6uq"); // /* neighborhood test */
158 UNSUPPORTED("9eqc4ewd8x2tb2o7676bqvzbk"); // ip1 = (i + 1) % pointn;
159 UNSUPPORTED("7uaqndtt8y6wd5jenwxduolym"); // im1 = (i + pointn - 1) % pointn;
160 UNSUPPORTED("e4zga3b8zozs44qyy6bccq35q"); // /* If P[i] is a convex vertex [ i+1 left of (i-1,i) ]. */
161 UNSUPPORTED("6rxb1urly3d45lz9xrdat9rjc"); // if (dpd_ccw(pointp[im1], pointp[i], pointp[ip1]) == 1)
162 UNSUPPORTED("1h8m3wqaqis9j4awgexj22ljg"); // res = (dpd_ccw(pointp[i], pointp[ip2], pointp[im1]) == 1) &&
163 UNSUPPORTED("54snmiylw2hrwv7yf250ut7kk"); // (dpd_ccw(pointp[ip2], pointp[i], pointp[ip1]) == 1);
164 UNSUPPORTED("f2vywip5w6wo2ku9n219qyc0t"); // /* Assume (i - 1, i, i + 1) not collinear. */
165 UNSUPPORTED("div10atae09n36x269sl208r1"); // else
166 UNSUPPORTED("8s457vlt2s8q2dv1carkz8jw1"); // res = ((dpd_ccw(pointp[i], pointp[ip2], pointp[ip1]) == 2)
167 UNSUPPORTED("5lgnvc71rkx0ldj6euv5vtcsr"); // );
168 UNSUPPORTED("4v614d3uabme2jyn0anuritbb"); // /*
169 UNSUPPORTED("71hkfc5n8im1y698xlsrhbyp5"); // &&
170 UNSUPPORTED("axkcv4kehdkqwxnlh4284iio4"); // (dpd_ccw (pointp[ip2], pointp[i], pointp[im1]) != ISCW));
171 UNSUPPORTED("bnetqzovnscxile7ao44kc0qd"); // */
172 UNSUPPORTED("6o97tfdzw11zrs51pped6bix"); // if (!res) {
173 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
174 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
175 UNSUPPORTED("bsnnstj5ry3f53yyx6h80if6r"); // /* check against all other edges */
176 UNSUPPORTED("2eknpu2grk40zpq5rvl1rsf0e"); // for (j = 0; j < pointn; j++) {
177 UNSUPPORTED("7j38zwxm4hyg9g5fi62sr5dz6"); // jp1 = (j + 1) % pointn;
178 UNSUPPORTED("7cqino9kvp1bszwsv2z4zllv1"); // if (!((j == i) || (jp1 == i) || (j == ip2) || (jp1 == ip2)))
179 UNSUPPORTED("attqyhhvmboobjbl2qf7l6hk1"); // if (dpd_intersects
180 UNSUPPORTED("43hv90vngw3gvon8vmtn7o3in"); // (pointp[i], pointp[ip2], pointp[j], pointp[jp1])) {
181 UNSUPPORTED("5izxoao5ryte71964f8yjfd5y"); // return 0;
182 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
183 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
184 UNSUPPORTED("2mmsh4mer8e3bkt2jk4gf4cyq"); // return ((!(0)));
185 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
186
187 throw new UnsupportedOperationException();
188 }
189
190
191
192
193 //3 8pjte4rru806nqx2myxn2h8tn
194 // static int dpd_intersects(Ppoint_t * pa, Ppoint_t * pb, Ppoint_t * pc, Ppoint_t * pd)
195 public static Object dpd_intersects(Object... arg) {
196 UNSUPPORTED("b7u1jnesjd68hfofduzpr4qf0"); // static int dpd_intersects(Ppoint_t * pa, Ppoint_t * pb, Ppoint_t * pc,
197 UNSUPPORTED("def51j09bielz8iq0blza86vg"); // Ppoint_t * pd)
198 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
199 UNSUPPORTED("9nscw3h7ol3rzfhy7cmityo7h"); // int ccw1, ccw2, ccw3, ccw4;
200 UNSUPPORTED("98ug1zrydddu1pwy2oplua9u6"); // if (dpd_ccw(pa, pb, pc) == 3 || dpd_ccw(pa, pb, pd) == 3 ||
201 UNSUPPORTED("4cfcl9frsb20o33zdgi2pm67u"); // dpd_ccw(pc, pd, pa) == 3 || dpd_ccw(pc, pd, pb) == 3) {
202 UNSUPPORTED("48qgrwlmwsf461u8tcizu96zg"); // if (dpd_between(pa, pb, pc) || dpd_between(pa, pb, pd) ||
203 UNSUPPORTED("64gna5xeh3ex4eoernwe8f797"); // dpd_between(pc, pd, pa) || dpd_between(pc, pd, pb))
204 UNSUPPORTED("a56gc2zenjhptik6h3r86au9x"); // return ((!(0)));
205 UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
206 UNSUPPORTED("345wiq942wt8egchavxisiate"); // ccw1 = (dpd_ccw(pa, pb, pc) == 1) ? 1 : 0;
207 UNSUPPORTED("8ss56vnafb15h2m5amgdjkdeo"); // ccw2 = (dpd_ccw(pa, pb, pd) == 1) ? 1 : 0;
208 UNSUPPORTED("281uxj8f020cd62tq8wnntaf6"); // ccw3 = (dpd_ccw(pc, pd, pa) == 1) ? 1 : 0;
209 UNSUPPORTED("9u7kvtaa6q6nms4h93wl3llei"); // ccw4 = (dpd_ccw(pc, pd, pb) == 1) ? 1 : 0;
210 UNSUPPORTED("e8shba3pxorddpi51sfeac4ju"); // return (ccw1 ^ ccw2) && (ccw3 ^ ccw4);
211 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
212 UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
213 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
214
215 throw new UnsupportedOperationException();
216 }
217
218
219
220
221 //3 coo3dmcddl2hcgc5gprzj3xtf
222 // static int dpd_between(Ppoint_t * pa, Ppoint_t * pb, Ppoint_t * pc)
223 public static Object dpd_between(Object... arg) {
224 UNSUPPORTED("8i6slq3k2lvso1osulneg0qfd"); // static int dpd_between(Ppoint_t * pa, Ppoint_t * pb, Ppoint_t * pc)
225 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
226 UNSUPPORTED("42b52ogcufv0s2qul8bwyz1mc"); // Ppoint_t pba, pca;
227 UNSUPPORTED("71f5gd0n8v9s3kgph6iiqu4xl"); // pba.x = pb->x - pa->x, pba.y = pb->y - pa->y;
228 UNSUPPORTED("8grh7ovfy0h3pcie2b7bxoxf9"); // pca.x = pc->x - pa->x, pca.y = pc->y - pa->y;
229 UNSUPPORTED("ajkxh6482351n4hst9pf3sajt"); // if (dpd_ccw(pa, pb, pc) != 3)
230 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
231 UNSUPPORTED("e461rpw0ig3rd1xwxn9quym9h"); // return (pca.x * pba.x + pca.y * pba.y >= 0) &&
232 UNSUPPORTED("2nprox8kgwp76fqf186ca4l78"); // (pca.x * pca.x + pca.y * pca.y <= pba.x * pba.x + pba.y * pba.y);
233 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
234
235 throw new UnsupportedOperationException();
236 }
237
238
239 }