MCPcopy Create free account
hub / github.com/PDAL/PDAL / saveToFile

Method saveToFile

filters/private/csf/Cloth.cpp:371–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371void 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
397void Cloth::saveMovableToFile(string path) {
398 string filepath = "cloth_movable.txt";

Callers 1

do_filteringMethod · 0.80

Calls 4

toAbsolutePathFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected