From daf772fb33299469589faf197e7761ead2ea82c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 19 Dec 2017 15:45:22 +0100 Subject: [PATCH] Added a function to get the canonical domain to P3MeshDomain_3 --- .../CGAL/Labeled_periodic_3_mesh_domain_3.h | 6 ++++++ .../Concepts/Periodic_3MeshDomain_3.h | 13 ++++++++++++- .../include/CGAL/Labeled_periodic_3_mesh_domain_3.h | 6 +++--- .../include/CGAL/make_periodic_3_mesh_3.h | 2 +- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Labeled_periodic_3_mesh_domain_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Labeled_periodic_3_mesh_domain_3.h index 287a03d92d3..aa45f706cfc 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Labeled_periodic_3_mesh_domain_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/CGAL/Labeled_periodic_3_mesh_domain_3.h @@ -57,6 +57,7 @@ template class Labeled_periodic_3_mesh_domain_3 { public: + typedef typename BGT::Iso_cuboid_3 Iso_cuboid_3; /// \name Creation /// @{ @@ -75,5 +76,10 @@ Labeled_periodic_3_mesh_domain_3(const LabelingFunction& f, /// @} +/*! + * \brief Return the user-chosen cube that is the canonical instance of the flat torus. +*/ +const Iso_cuboid_3& canonical_periodic_domain(); + }; /* end Labeled_periodic_3_mesh_domain_3 */ } /* end namespace CGAL */ diff --git a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomain_3.h b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomain_3.h index f631a5b0644..ddea4773056 100644 --- a/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomain_3.h +++ b/Periodic_3_mesh_3/doc/Periodic_3_mesh_3/Concepts/Periodic_3MeshDomain_3.h @@ -22,7 +22,18 @@ evaluate queries at the canonical representative a point (see Section \sa `CGAL::refine_periodic_3_mesh_3()` */ -class Periodic_3MeshDomain_3 { +class Periodic_3MeshDomain_3 +{ +public: + /*! + Cuboid type. + */ + typedef unspecified_type Iso_cuboid_3; + + /*! + Return the user-chosen cube that is the canonical instance of the flat torus. + */ + const Iso_cuboid_3& canonical_periodic_domain(); /// @} diff --git a/Periodic_3_mesh_3/include/CGAL/Labeled_periodic_3_mesh_domain_3.h b/Periodic_3_mesh_3/include/CGAL/Labeled_periodic_3_mesh_domain_3.h index 1d5df7314fd..35447b1179b 100644 --- a/Periodic_3_mesh_3/include/CGAL/Labeled_periodic_3_mesh_domain_3.h +++ b/Periodic_3_mesh_3/include/CGAL/Labeled_periodic_3_mesh_domain_3.h @@ -104,7 +104,7 @@ public: pgt(bbox) { } - const Iso_cuboid_3& periodic_bounding_box() const { return Base::bounding_box(); } + const Iso_cuboid_3& canonical_periodic_domain() const { return Base::bounding_box(); } const Periodic_geom_traits& periodic_geom_traits() const { return pgt; } Subdomain_index label(const Point_3& p) const { @@ -155,7 +155,7 @@ public: // This whole canonicalization of offsets process seems useless... Hiding it behind macros. #ifdef CGAL_PERIODIC_CANONICALIZE_DUAL_INTERSECTIONS - Iso_cuboid_3 pbb = r_domain_.periodic_bounding_box(); + Iso_cuboid_3 pbb = r_domain_.canonical_periodic_domain(); FT dimension [3] = { pbb.xmax()-pbb.xmin(), pbb.ymax()-pbb.ymin(), pbb.zmax()-pbb.zmin() }; @@ -308,7 +308,7 @@ public: r_domain_.periodic_geom_traits().construct_midpoint_3_object(); #ifdef CGAL_PERIODIC_CANONICALIZE_DUAL_INTERSECTIONS - Iso_cuboid_3 pbb = r_domain_.periodic_bounding_box(); + Iso_cuboid_3 pbb = r_domain_.canonical_periodic_domain(); FT dimension [3] = { pbb.xmax() - pbb.xmin(), pbb.ymax() - pbb.ymin(), pbb.zmax() - pbb.zmin() }; diff --git a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h index 868dc35137a..687c1065ea4 100644 --- a/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h +++ b/Periodic_3_mesh_3/include/CGAL/make_periodic_3_mesh_3.h @@ -98,7 +98,7 @@ struct C3t3_initializer_base bool nonlinear = false, const int nb_initial_points = -1) { - c3t3.triangulation().set_domain(domain.periodic_bounding_box()); + c3t3.triangulation().set_domain(domain.canonical_periodic_domain()); c3t3.triangulation().insert_dummy_points(); mark_dummy_points(c3t3);