mirror of https://github.com/CGAL/cgal
enable exact serialization of triangulations with EPECK
This commit is contained in:
parent
ddb405a2c2
commit
2251c438fa
|
|
@ -77,7 +77,7 @@ template <typename GT, typename Vb>
|
||||||
std::ostream&
|
std::ostream&
|
||||||
operator<<(std::ostream &os, const Convex_hull_vertex_base_2<GT, Vb>& v)
|
operator<<(std::ostream &os, const Convex_hull_vertex_base_2<GT, Vb>& v)
|
||||||
{
|
{
|
||||||
return os << static_cast<const Vb&>(v) << v.point();
|
return os << static_cast<const Vb&>(v) << IO::serialize(v.point());
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -698,6 +698,25 @@ inline const char* mode_name( IO::Mode m )
|
||||||
return names[m];
|
return names[m];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
|
template <class P> constexpr auto has_exact(int) -> decltype(exact(P()), bool()) { return true; }
|
||||||
|
template <class P> constexpr bool has_exact(...) { return false; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class P>
|
||||||
|
auto
|
||||||
|
serialize(const P& p) {
|
||||||
|
if constexpr (internal::has_exact<P>(0)) {
|
||||||
|
return exact(p);
|
||||||
|
} else {
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // IO namespace
|
} // IO namespace
|
||||||
|
|
||||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ operator<<(std::ostream &os,
|
||||||
const Regular_triangulation_vertex_base_2<GT, Vb> &v)
|
const Regular_triangulation_vertex_base_2<GT, Vb> &v)
|
||||||
// non combinatorial information. Default = point
|
// non combinatorial information. Default = point
|
||||||
{
|
{
|
||||||
return os << static_cast<const Vb&>(v) << v.point();
|
return os << static_cast<const Vb&>(v) << IO::serialize(v.point());
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ std::ostream&
|
||||||
operator<<(std::ostream &os, const Triangulation_vertex_base_2<GT, Vb> &v)
|
operator<<(std::ostream &os, const Triangulation_vertex_base_2<GT, Vb> &v)
|
||||||
// non combinatorial information. Default = point
|
// non combinatorial information. Default = point
|
||||||
{
|
{
|
||||||
return os << static_cast<const Vb&>(v) << v.point();
|
return os << static_cast<const Vb&>(v) << IO::serialize(v.point());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ std::ostream&
|
||||||
operator<<(std::ostream &os, const Regular_triangulation_vertex_base_3<GT, DSVb> &v)
|
operator<<(std::ostream &os, const Regular_triangulation_vertex_base_3<GT, DSVb> &v)
|
||||||
// non combinatorial information. Default = point
|
// non combinatorial information. Default = point
|
||||||
{
|
{
|
||||||
return os << static_cast<const DSVb&>(v) << v.point();
|
return os << static_cast<const DSVb&>(v) << IO::serialize(v.point());
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ private:
|
||||||
Point _p;
|
Point _p;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template < class GT, class DSVb >
|
template < class GT, class DSVb >
|
||||||
std::istream&
|
std::istream&
|
||||||
operator>>(std::istream &is, Triangulation_vertex_base_3<GT, DSVb> &v)
|
operator>>(std::istream &is, Triangulation_vertex_base_3<GT, DSVb> &v)
|
||||||
|
|
@ -74,7 +75,7 @@ std::ostream&
|
||||||
operator<<(std::ostream &os, const Triangulation_vertex_base_3<GT, DSVb> &v)
|
operator<<(std::ostream &os, const Triangulation_vertex_base_3<GT, DSVb> &v)
|
||||||
// non combinatorial information. Default = point
|
// non combinatorial information. Default = point
|
||||||
{
|
{
|
||||||
return os << static_cast<const DSVb&>(v) << v.point();
|
return os << static_cast<const DSVb&>(v) << IO::serialize(v.point());
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ create_single_source_cgal_program("test_segment_simplex_traverser_3.cpp" )
|
||||||
create_single_source_cgal_program("test_static_filters.cpp")
|
create_single_source_cgal_program("test_static_filters.cpp")
|
||||||
create_single_source_cgal_program("test_triangulation_3.cpp")
|
create_single_source_cgal_program("test_triangulation_3.cpp")
|
||||||
create_single_source_cgal_program("test_io_triangulation_3.cpp")
|
create_single_source_cgal_program("test_io_triangulation_3.cpp")
|
||||||
|
create_single_source_cgal_program("test_triangulation_serialization_3.cpp")
|
||||||
|
|
||||||
if(TARGET CGAL::TBB_support)
|
if(TARGET CGAL::TBB_support)
|
||||||
message(STATUS "Found TBB")
|
message(STATUS "Found TBB")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue