Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
maxGimeno committed Oct 5, 2018
1 parent 8282e7f commit dfd5d38
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Triangulation/examples/Triangulation/convex_hull.cpp
Expand Up @@ -4,8 +4,10 @@
#include <CGAL/algorithm.h>
#include <CGAL/Timer.h>
#include <CGAL/assertions.h>
#include <CGAL/NewKernel_d/Wrapper/Point_d.h>

#include <iostream>
#include <fstream>
#include <iterator>
#include <vector>

Expand Down Expand Up @@ -58,5 +60,17 @@ int main(int argc, char **argv)
}

std::cout << c << " points were actually inserted.\n";
std::ofstream ofs("/home/gimeno/test.txt");
//CGAL::set_binary_mode(ofs);
ofs << t;
ofs.close();
T t2(D);
std::ifstream ifs("/home/gimeno/test.txt");
//CGAL::set_binary_mode(ifs);
ifs >> t2;
ifs.close();
if(t.number_of_vertices() != t2.number_of_vertices())
return 1;

return 0;
}
11 changes: 9 additions & 2 deletions Triangulation/include/CGAL/Triangulation.h
Expand Up @@ -1408,12 +1408,19 @@ operator<<(std::ostream & os, const Triangulation<TT, TDS> & tr)

// infinite vertex has index 0 (among all the vertices)
index_of_vertex[tr.infinite_vertex()] = i++;
os << *tr.infinite_vertex() <<"\n";
if(is_ascii(os))
os << *tr.infinite_vertex() <<"\n";
else
write(os, *tr.infinite_vertex(), io_Read_write());

for( Vertex_iterator it = tr.vertices_begin(); it != tr.vertices_end(); ++it )
{
if( tr.is_infinite(it) )
continue;
os << *it <<"\n"; // write the vertex
if(is_ascii(os))
os << *it <<"\n"; // write the vertex
else
write(os, *it, io_Read_write());
index_of_vertex[it] = i++;
}
CGAL_assertion( i == n+1 );
Expand Down

0 comments on commit dfd5d38

Please sign in to comment.