mirror of https://github.com/CGAL/cgal
Merge pull request #6918 from lcaraffa/Triangulation-is_valid-lc
Triangulation_d: fix invalid triangulation after I/O
This commit is contained in:
commit
002c58ba54
|
|
@ -1364,6 +1364,7 @@ Triangulation_data_structure<Dimen, Vb, Fcb>
|
|||
else
|
||||
read(is, index);
|
||||
s->set_vertex(j, vertices[index]);
|
||||
s->vertex(j)->set_full_cell(s);
|
||||
}
|
||||
// read other non-combinatorial information for the full_cells
|
||||
is >> (*s);
|
||||
|
|
|
|||
|
|
@ -25,8 +25,9 @@ if(TARGET CGAL::Eigen3_support)
|
|||
create_single_source_cgal_program("test_tds.cpp")
|
||||
create_single_source_cgal_program("test_torture.cpp")
|
||||
create_single_source_cgal_program("test_insert_if_in_star.cpp")
|
||||
create_single_source_cgal_program("simple_io_test.cpp")
|
||||
foreach(target test_triangulation test_delaunay test_regular test_tds
|
||||
test_torture test_insert_if_in_star)
|
||||
test_torture test_insert_if_in_star simple_io_test)
|
||||
target_link_libraries(${target} PUBLIC CGAL::Eigen3_support)
|
||||
endforeach()
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
#include <CGAL/Epick_d.h>
|
||||
#include <CGAL/Delaunay_triangulation.h>
|
||||
#include <sstream>
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef CGAL::Delaunay_triangulation<CGAL::Epick_d<CGAL::Dimension_tag<2>>> T;
|
||||
T dt1(2), dt2(2);
|
||||
|
||||
std::vector<T::Point> points;
|
||||
points.emplace_back(1,0);
|
||||
points.emplace_back(0,1);
|
||||
points.emplace_back(2,2);
|
||||
dt1.insert(points.begin(), points.end());
|
||||
|
||||
std::stringstream f;
|
||||
f << dt1 << std::endl;
|
||||
std::cout << f.str();
|
||||
f >> dt2;
|
||||
assert(dt2.is_valid(true));
|
||||
}
|
||||
|
|
@ -104,6 +104,7 @@ void test(const int d, const string & type)
|
|||
CGAL::IO::set_binary_mode(fi);
|
||||
TDS input_tds(d);
|
||||
fi >> input_tds;
|
||||
assert( input_tds.is_valid(true) );
|
||||
fi.close();
|
||||
|
||||
// TEST Copy Constructor
|
||||
|
|
|
|||
Loading…
Reference in New Issue