| 369 | } |
| 370 | |
| 371 | void Cloth::saveToFile(string path) { |
| 372 | if (m_outputDir.empty() || debug == false) |
| 373 | return; |
| 374 | |
| 375 | string filepath = "cloth_nodes.txt"; |
| 376 | |
| 377 | if (path == "") { |
| 378 | filepath = "cloth_nodes.txt"; |
| 379 | } else { |
| 380 | filepath = path; |
| 381 | } |
| 382 | |
| 383 | string outputFileName = pdal::FileUtils::toAbsolutePath(filepath, m_outputDir); |
| 384 | |
| 385 | ofstream f1(outputFileName.c_str()); |
| 386 | |
| 387 | if (!f1) |
| 388 | return; |
| 389 | |
| 390 | for (size_t i = 0; i < particles.size(); i++) { |
| 391 | f1 << fixed << setprecision(8) << particles[i].getPos().f[0] << " "<< particles[i].getPos().f[2] << " "<< -particles[i].getPos().f[1] << endl; |
| 392 | } |
| 393 | |
| 394 | f1.close(); |
| 395 | } |
| 396 | |
| 397 | void Cloth::saveMovableToFile(string path) { |
| 398 | string filepath = "cloth_movable.txt"; |
no test coverage detected