From 5964ef650f4aa6c6a94dcda3286c3a4cae37be2f Mon Sep 17 00:00:00 2001 From: Aymeric PELLE Date: Tue, 18 Feb 2014 16:42:08 +0100 Subject: [PATCH] Labeled_mesh_domain_3 has a new constructor taking an Iso_cuboid. In periodic cases, we may want to pass an bouding box with exact coordinates. But, this is impossible to do with Bbox_3 which always has double coordinates. --- .../CGAL/Mesh_3/Labeled_mesh_domain_3.h | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Mesh_3/Labeled_mesh_domain_3.h index cb4f6310d00..fd324fadb5c 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Labeled_mesh_domain_3.h @@ -68,6 +68,10 @@ public: typedef typename BGT::Sphere_3 Sphere_3; typedef CGAL::Bbox_3 Bbox_3; +protected: + typedef typename BGT::Iso_cuboid_3 Iso_cuboid_3; + +public: // Kernel_traits compatibility typedef BGT R; @@ -100,6 +104,10 @@ public: const Bbox_3& bbox, const FT& error_bound = FT(1e-3)); + Labeled_mesh_domain_3(const Function& f, + const Iso_cuboid_3& bbox, + const FT& error_bound = FT(1e-3)); + /// Destructor virtual ~Labeled_mesh_domain_3() {} @@ -408,9 +416,6 @@ public: // ----------------------------------- -public: - typedef typename BGT::Iso_cuboid_3 Iso_cuboid_3; - private: /// Returns Surface_patch_index from \c i and \c j Surface_patch_index make_surface_index(const Subdomain_index i, @@ -506,6 +511,18 @@ Labeled_mesh_domain_3::Labeled_mesh_domain_3( // TODO : CGAL_ASSERT(0 < f(bounding_sphere.get_center()) ) ? } +template +Labeled_mesh_domain_3::Labeled_mesh_domain_3( + const F& f, + const Iso_cuboid_3& bbox, + const FT& error_bound ) +: function_(f) +, bbox_(bbox) +, squared_error_bound_(squared_error_bound(bbox_,error_bound)) +{ + // TODO : CGAL_ASSERT(0 < f( bbox.get_center()) ) ? +} + template