diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 3f799b6e9c1..44a8eaf6bd4 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -67,7 +67,7 @@ public: */ Implicit_mesh_domain_3(const Function& f, const Sphere_3& bounding_sphere, - CGAL::Random& rng = CGAL::Random(0), + const CGAL::Random& rng = CGAL::Random(0), const FT& error_bound = FT(1e-3)) : Base(Wrapper(f), bounding_sphere, rng, error_bound) {} diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index a3648aae56f..82dafc41eab 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -56,7 +56,7 @@ public: /// Constructor Labeled_image_mesh_domain_3(const Image& image, - CGAL::Random& rng = CGAL::Random(0), + const CGAL::Random& rng = CGAL::Random(0), const FT& error_bound = FT(1e-3)) : Base(Wrapper(image), compute_bounding_box(image), 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 5c942135fb1..d07ea91421f 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 @@ -96,12 +96,12 @@ public: */ Labeled_mesh_domain_3(const Function& f, const Sphere_3& bounding_sphere, - CGAL::Random& rng = CGAL::Random(0), + const CGAL::Random& rng = CGAL::Random(0), const FT& error_bound = FT(1e-3)); Labeled_mesh_domain_3(const Function& f, const Bbox_3& bbox, - CGAL::Random& rng = CGAL::Random(0), + const CGAL::Random& rng = CGAL::Random(0), const FT& error_bound = FT(1e-3)); /// Destructor @@ -466,7 +466,7 @@ private: /// The bounding box const Iso_cuboid_3 bbox_; /// The random number generator used by Construct_initial_points - CGAL::Random& rng_; + mutable CGAL::Random rng_; /// Error bound relative to sphere radius FT squared_error_bound_; @@ -489,7 +489,7 @@ template Labeled_mesh_domain_3::Labeled_mesh_domain_3( const F& f, const Sphere_3& bounding_sphere, - CGAL::Random& rng, + const CGAL::Random& rng, const FT& error_bound ) : function_(f) , bbox_(iso_cuboid(bounding_sphere.bbox())) @@ -503,7 +503,7 @@ template Labeled_mesh_domain_3::Labeled_mesh_domain_3( const F& f, const Bbox_3& bbox, - CGAL::Random& rng, + const CGAL::Random& rng, const FT& error_bound ) : function_(f) , bbox_(iso_cuboid(bbox)) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 3eb4559f80e..fb8ae907a1b 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -215,7 +215,7 @@ public: * @param polyhedron the polyhedron describing the polyhedral surface */ Polyhedral_mesh_domain_3(const Polyhedron& p, - CGAL::Random& rng = CGAL::Random(0)) + const CGAL::Random& rng = CGAL::Random(0)) : tree_(TriangleAccessor().triangles_begin(p), TriangleAccessor().triangles_end(p)), bounding_tree_(&tree_) // the bounding tree is tree_ @@ -230,7 +230,7 @@ public: Polyhedral_mesh_domain_3(const Polyhedron& p, const Polyhedron& bounding_polyhedron, - CGAL::Random& rng = CGAL::Random(0)) + const CGAL::Random& rng = CGAL::Random(0)) : tree_(TriangleAccessor().triangles_begin(p), TriangleAccessor().triangles_end(p)) , bounding_tree_(new AABB_tree_(TriangleAccessor().triangles_begin(bounding_polyhedron), @@ -259,7 +259,7 @@ public: Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin, InputPolyhedraPtrIterator end, const Polyhedron& bounding_polyhedron, - CGAL::Random& rng = CGAL::Random(0)) + const CGAL::Random& rng = CGAL::Random(0)) : has_cache(false) , rng_(rng) { @@ -296,7 +296,7 @@ public: template Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin, InputPolyhedraPtrIterator end, - CGAL::Random& rng = CGAL::Random(0)) + const CGAL::Random& rng = CGAL::Random(0)) : has_cache(false) , rng_(rng) { @@ -609,7 +609,7 @@ private: mutable AABB_primitive_id cached_primitive_id; //random number generator for Construct_initial_points - CGAL::Random& rng_; + mutable CGAL::Random rng_; public: @@ -627,7 +627,7 @@ public: return has_cache && (cached_query == Cached_query(q)); } - void set_random_generator(CGAL::Random& rng) + void set_random_generator(const CGAL::Random& rng) { rng_ = rng; } diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index 859b280ec86..67a62cd7cfb 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -95,13 +95,10 @@ public: /// Constructors Polyhedral_mesh_domain_with_features_3(const Polyhedron& p, - CGAL::Random& rng = CGAL::Random(0)); + const CGAL::Random& rng = CGAL::Random(0)); Polyhedral_mesh_domain_with_features_3(const std::string& filename, - CGAL::Random& rng = CGAL::Random(0)); + const CGAL::Random& rng = CGAL::Random(0)); - template - Polyhedral_mesh_domain_with_features_3(const T1& a, const T2& b) - : Base(a, b) {} template Polyhedral_mesh_domain_with_features_3(const T1& a, const T2& b, const T3& c) @@ -132,7 +129,7 @@ template < typename GT_, typename P_, typename TA_, typename Tag_, typename E_tag_> Polyhedral_mesh_domain_with_features_3:: Polyhedral_mesh_domain_with_features_3(const Polyhedron& p, - CGAL::Random& rng) + const CGAL::Random& rng) : Base() , polyhedron_(p) { @@ -144,7 +141,7 @@ template < typename GT_, typename P_, typename TA_, typename Tag_, typename E_tag_> Polyhedral_mesh_domain_with_features_3:: Polyhedral_mesh_domain_with_features_3(const std::string& filename, - CGAL::Random& rng) + const CGAL::Random& rng) : Base() , polyhedron_() {