| 1386 | // code from https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html |
| 1387 | template <typename T> |
| 1388 | static int pnpoly(int nvert, T *vertx, T *verty, T testx, T testy) { |
| 1389 | int i, j, c = 0; |
| 1390 | for (i = 0, j = nvert - 1; i < nvert; j = i++) { |
| 1391 | if (((verty[i] > testy) != (verty[j] > testy)) && |
| 1392 | (testx < |
| 1393 | (vertx[j] - vertx[i]) * (testy - verty[i]) / (verty[j] - verty[i]) + |
| 1394 | vertx[i])) |
| 1395 | c = !c; |
| 1396 | } |
| 1397 | return c; |
| 1398 | } |
| 1399 | |
| 1400 | // TODO(syoyo): refactor function. |
| 1401 | static bool exportGroupsToShape(shape_t *shape, const PrimGroup &prim_group, |
no outgoing calls
no test coverage detected