// Copyright (c) 2020 GeometryFactory (France) and Telecom Paris (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL: https://github.com/CGAL/cgal/blob/v5.2/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/tetrahedral_remeshing_io.h $ // $Id: tetrahedral_remeshing_io.h 9650869 2020-09-09T10:16:58+02:00 Sébastien Loriot // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial // // // Author(s) : Jane Tournois, Noura Faraj, Jean-Marc Thiery, Tamy Boubekeur #ifndef CGAL_TETRAHEDRAL_REMESHING_IO_H #define CGAL_TETRAHEDRAL_REMESHING_IO_H #include #include #include #include namespace CGAL { template bool load_triangulation(std::istream& is, T3& t3) { std::string s; if (!(is >> s)) return false; bool binary = (s == "binary"); if (binary) { if (!(is >> s)) return false; } if (s != "CGAL" || !(is >> s) || s != "c3t3") return false; std::getline(is, s); if (binary) CGAL::set_binary_mode(is); else CGAL::set_ascii_mode(is); is >> t3; return bool(is); } template bool save_binary_triangulation(std::ostream& os, const T3& t3) { os << "binary CGAL c3t3\n"; CGAL::set_binary_mode(os); return !!(os << t3); } template bool save_ascii_triangulation(std::ostream& os, const T3& t3) { os << "CGAL c3t3\n"; CGAL::set_ascii_mode(os); return !!(os << t3); } } #endif // CGAL_TETRAHEDRAL_REMESHING_IO_H