| 478 | } |
| 479 | |
| 480 | std::string dllDir() |
| 481 | { |
| 482 | std::string s; |
| 483 | |
| 484 | #ifdef _WIN32 |
| 485 | HMODULE hm = NULL; |
| 486 | |
| 487 | if (GetModuleHandleEx( |
| 488 | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | |
| 489 | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, |
| 490 | (LPCSTR)&dllDir, &hm)) |
| 491 | { |
| 492 | #ifdef PDAL_WIN32_STL |
| 493 | wchar_t path[MAX_PATH]; |
| 494 | DWORD cnt = GetModuleFileNameW(hm, path, sizeof(path)); |
| 495 | #else |
| 496 | char path[MAX_PATH]; |
| 497 | DWORD cnt = GetModuleFileNameA(hm, path, sizeof(path)); |
| 498 | #endif |
| 499 | if (cnt > 0 && cnt < MAX_PATH) |
| 500 | s = FileUtils::fromNative(path); |
| 501 | } |
| 502 | #else |
| 503 | Dl_info info; |
| 504 | if (dladdr((const void *)dllDir, &info)) |
| 505 | s = info.dli_fname; |
| 506 | #endif |
| 507 | return FileUtils::getDirectory(s); |
| 508 | } |
| 509 | |
| 510 | |
| 511 | double computeChamfer(PointViewPtr srcView, PointViewPtr candView) |
no test coverage detected