mirror of https://github.com/CGAL/cgal
commit
1c75dff41f
|
|
@ -95,8 +95,11 @@ int main()
|
||||||
else {
|
else {
|
||||||
const std::string& output_file = "data/building_result-0.05.off";
|
const std::string& output_file = "data/building_result-0.05.off";
|
||||||
std::ofstream output_stream(output_file.c_str());
|
std::ofstream output_stream(output_file.c_str());
|
||||||
if (output_stream && CGAL::write_off(output_stream, model))
|
if (output_stream && CGAL::write_off(output_stream, model)) {
|
||||||
|
// flush the buffer
|
||||||
|
output_stream << std::flush;
|
||||||
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << " Failed saving file." << std::endl;
|
std::cerr << " Failed saving file." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
@ -113,8 +116,11 @@ int main()
|
||||||
else {
|
else {
|
||||||
const std::string& output_file = "data/building_result-0.5.off";
|
const std::string& output_file = "data/building_result-0.5.off";
|
||||||
std::ofstream output_stream(output_file.c_str());
|
std::ofstream output_stream(output_file.c_str());
|
||||||
if (output_stream && CGAL::write_off(output_stream, model))
|
if (output_stream && CGAL::write_off(output_stream, model)) {
|
||||||
|
// flush the buffer
|
||||||
|
output_stream << std::flush;
|
||||||
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << " Failed saving file." << std::endl;
|
std::cerr << " Failed saving file." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
@ -131,8 +137,11 @@ int main()
|
||||||
else {
|
else {
|
||||||
const std::string& output_file = "data/building_result-0.7.off";
|
const std::string& output_file = "data/building_result-0.7.off";
|
||||||
std::ofstream output_stream(output_file.c_str());
|
std::ofstream output_stream(output_file.c_str());
|
||||||
if (output_stream && CGAL::write_off(output_stream, model))
|
if (output_stream && CGAL::write_off(output_stream, model)) {
|
||||||
|
// flush the buffer
|
||||||
|
output_stream << std::flush;
|
||||||
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << " Failed saving file." << std::endl;
|
std::cerr << " Failed saving file." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,11 @@ int main()
|
||||||
// Saves the mesh model
|
// Saves the mesh model
|
||||||
const std::string& output_file("data/ball_result.off");
|
const std::string& output_file("data/ball_result.off");
|
||||||
std::ofstream output_stream(output_file.c_str());
|
std::ofstream output_stream(output_file.c_str());
|
||||||
if (output_stream && CGAL::write_off(output_stream, model))
|
if (output_stream && CGAL::write_off(output_stream, model)) {
|
||||||
|
// flush the buffer
|
||||||
|
output_stream << std::flush;
|
||||||
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << " Failed saving file." << std::endl;
|
std::cerr << " Failed saving file." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
||||||
|
|
@ -178,8 +178,11 @@ int main()
|
||||||
t.reset();
|
t.reset();
|
||||||
const std::string& output_file("data/cube_result.off");
|
const std::string& output_file("data/cube_result.off");
|
||||||
std::ofstream output_stream(output_file.c_str());
|
std::ofstream output_stream(output_file.c_str());
|
||||||
if (output_stream && CGAL::write_off(output_stream, model))
|
if (output_stream && CGAL::write_off(output_stream, model)) {
|
||||||
|
// flush the buffer
|
||||||
|
output_stream << std::flush;
|
||||||
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << " Failed saving file." << std::endl;
|
std::cerr << " Failed saving file." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,11 @@ int main()
|
||||||
|
|
||||||
const std::string& output_file("data/cube_result.off");
|
const std::string& output_file("data/cube_result.off");
|
||||||
std::ofstream output_stream(output_file.c_str());
|
std::ofstream output_stream(output_file.c_str());
|
||||||
if (output_stream && CGAL::write_off(output_stream, model))
|
if (output_stream && CGAL::write_off(output_stream, model)) {
|
||||||
|
// flush the buffer
|
||||||
|
output_stream << std::flush;
|
||||||
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
std::cout << " Done. Saved to " << output_file << ". Time: " << t.time() << " sec." << std::endl;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << " Failed saving file." << std::endl;
|
std::cerr << " Failed saving file." << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
@ -143,8 +146,11 @@ int main()
|
||||||
algo.output_candidate_faces(candidate_faces);
|
algo.output_candidate_faces(candidate_faces);
|
||||||
const std::string& candidate_faces_file("data/cube_candidate_faces.off");
|
const std::string& candidate_faces_file("data/cube_candidate_faces.off");
|
||||||
std::ofstream candidate_stream(candidate_faces_file.c_str());
|
std::ofstream candidate_stream(candidate_faces_file.c_str());
|
||||||
if (candidate_stream && CGAL::write_off(candidate_stream, candidate_faces))
|
if (candidate_stream && CGAL::write_off(candidate_stream, candidate_faces)) {
|
||||||
|
// flush the buffer
|
||||||
|
output_stream << std::flush;
|
||||||
std::cout << "Candidate faces saved to " << candidate_faces_file << "." << std::endl;
|
std::cout << "Candidate faces saved to " << candidate_faces_file << "." << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue