| 37 | namespace colmap { |
| 38 | |
| 39 | void Sim3d::ToFile(const std::filesystem::path& path) const { |
| 40 | std::ofstream file(path, std::ios::trunc); |
| 41 | THROW_CHECK(file.good()) << path; |
| 42 | file.imbue(std::locale::classic()); |
| 43 | // Ensure that we don't loose any precision by storing in text. |
| 44 | file.precision(17); |
| 45 | file << scale() << " " << rotation().w() << " " << rotation().x() << " " |
| 46 | << rotation().y() << " " << rotation().z() << " " << translation().x() |
| 47 | << " " << translation().y() << " " << translation().z() << '\n'; |
| 48 | } |
| 49 | |
| 50 | Sim3d Sim3d::FromFile(const std::filesystem::path& path) { |
| 51 | std::ifstream file(path); |
no outgoing calls