* @brief Write this data to a .ply file. * * @param filename The file to write to. * @param format The format to use (binary or ascii?) */
| 1351 | * @param format The format to use (binary or ascii?) |
| 1352 | */ |
| 1353 | void write(const std::string& filename, DataFormat format = DataFormat::ASCII) { |
| 1354 | outputDataFormat = format; |
| 1355 | |
| 1356 | validate(); |
| 1357 | |
| 1358 | // Open stream for writing |
| 1359 | std::ofstream outStream(filename, std::ios::out | std::ios::binary); |
| 1360 | if (!outStream.good()) { |
| 1361 | throw std::runtime_error("Ply writer: Could not open output file " + filename + " for writing"); |
| 1362 | } |
| 1363 | |
| 1364 | writePLY(outStream); |
| 1365 | } |
| 1366 | |
| 1367 | /** |
| 1368 | * @brief Write this data to an output stream |
no outgoing calls
no test coverage detected