Write to file in given format
| 423 | |
| 424 | // Write to file in given format |
| 425 | void Foam::triSurface::write |
| 426 | ( |
| 427 | const fileName& name, |
| 428 | const word& ext, |
| 429 | const bool sort |
| 430 | ) const |
| 431 | { |
| 432 | if (ext == "ftr") |
| 433 | { |
| 434 | return write(OFstream(name)()); |
| 435 | } |
| 436 | else if (ext == "stl") |
| 437 | { |
| 438 | return writeSTLASCII(sort, OFstream(name)()); |
| 439 | } |
| 440 | else if (ext == "stlb") |
| 441 | { |
| 442 | ofstream outFile(name.c_str(), std::ios::binary); |
| 443 | |
| 444 | writeSTLBINARY(outFile); |
| 445 | } |
| 446 | else if (ext == "gts") |
| 447 | { |
| 448 | return writeGTS(sort, OFstream(name)()); |
| 449 | } |
| 450 | else if (ext == "obj") |
| 451 | { |
| 452 | writeOBJ(sort, OFstream(name)()); |
| 453 | } |
| 454 | else if (ext == "off") |
| 455 | { |
| 456 | writeOFF(sort, OFstream(name)()); |
| 457 | } |
| 458 | else if (ext == "vtk") |
| 459 | { |
| 460 | writeVTK(sort, OFstream(name)()); |
| 461 | } |
| 462 | else if (ext == "tri") |
| 463 | { |
| 464 | writeTRI(sort, OFstream(name)()); |
| 465 | } |
| 466 | else if (ext == "dx") |
| 467 | { |
| 468 | writeDX(sort, OFstream(name)()); |
| 469 | } |
| 470 | else if (ext == "ac") |
| 471 | { |
| 472 | writeAC(OFstream(name)()); |
| 473 | } |
| 474 | else if (ext == "smesh") |
| 475 | { |
| 476 | writeSMESH(sort, OFstream(name)()); |
| 477 | } |
| 478 | else |
| 479 | { |
| 480 | FatalErrorInFunction |
| 481 | << "unknown file extension " << ext |
| 482 | << " for file " << name |
no test coverage detected