remove new template parameter RNG

using CGAL::Random everywhere is simpler and definitely enough
note we are using CGAL::Random& as in Random_generator_base
(see CGAL/generators.h)
This commit is contained in:
Jane Tournois 2014-03-24 12:50:18 +01:00
parent a3341d0ec2
commit 6566c592c2
5 changed files with 42 additions and 49 deletions

View File

@ -46,14 +46,13 @@ namespace CGAL {
*/
template<class Function,
class BGT,
class RNG = CGAL::Random,
class Wrapper = Mesh_3::Implicit_to_labeled_function_wrapper<Function,BGT> >
class Implicit_mesh_domain_3
: public Mesh_3::Labeled_mesh_domain_3<Wrapper, BGT, RNG>
: public Mesh_3::Labeled_mesh_domain_3<Wrapper, BGT>
{
public:
/// Base type
typedef Mesh_3::Labeled_mesh_domain_3<Wrapper, BGT, RNG> Base;
typedef Mesh_3::Labeled_mesh_domain_3<Wrapper, BGT> Base;
/// Public types
typedef typename Base::Sphere_3 Sphere_3;
@ -68,7 +67,7 @@ public:
*/
Implicit_mesh_domain_3(const Function& f,
const Sphere_3& bounding_sphere,
RNG rng = CGAL::Random(0),
CGAL::Random& rng = CGAL::Random(0),
const FT& error_bound = FT(1e-3))
: Base(Wrapper(f), bounding_sphere, rng, error_bound) {}
@ -78,7 +77,7 @@ public:
private:
// Disabled copy constructor & assignment operator
typedef Implicit_mesh_domain_3<Function,BGT,RNG> Self;
typedef Implicit_mesh_domain_3<Function,BGT> Self;
Implicit_mesh_domain_3(const Self& src);
Self& operator=(const Self& src);

View File

@ -41,13 +41,13 @@ namespace CGAL {
*/
template<class Image,
class BGT,
class RNG = CGAL::Random,
class Wrapper = Mesh_3::Image_to_labeled_function_wrapper<Image, BGT> >
class Labeled_image_mesh_domain_3
: public Mesh_3::Labeled_mesh_domain_3<Wrapper, BGT, RNG>
: public Mesh_3::Labeled_mesh_domain_3<Wrapper, BGT>
{
public:
typedef Mesh_3::Labeled_mesh_domain_3<Wrapper, BGT, RNG> Base;
typedef Mesh_3::Labeled_mesh_domain_3<Wrapper, BGT> Base;
typedef typename Base::Sphere_3 Sphere_3;
typedef typename Base::FT FT;
@ -56,7 +56,7 @@ public:
/// Constructor
Labeled_image_mesh_domain_3(const Image& image,
RNG rng = CGAL::Random(0),
CGAL::Random& rng = CGAL::Random(0),
const FT& error_bound = FT(1e-3))
: Base(Wrapper(image),
compute_bounding_box(image),

View File

@ -57,8 +57,7 @@ namespace Mesh_3 {
* Thus, a boundary facet of the domain is labelled <0,b>, where b!=0.
*/
template<class Function,
class BGT,
class RNG = CGAL::Random >
class BGT>
class Labeled_mesh_domain_3
{
public:
@ -97,12 +96,12 @@ public:
*/
Labeled_mesh_domain_3(const Function& f,
const Sphere_3& bounding_sphere,
RNG rng = CGAL::Random(0),
CGAL::Random& rng = CGAL::Random(0),
const FT& error_bound = FT(1e-3));
Labeled_mesh_domain_3(const Function& f,
const Bbox_3& bbox,
RNG rng = CGAL::Random(0),
CGAL::Random& rng = CGAL::Random(0),
const FT& error_bound = FT(1e-3));
/// Destructor
@ -467,14 +466,14 @@ private:
/// The bounding box
const Iso_cuboid_3 bbox_;
/// The random number generator used by Construct_initial_points
RNG& rng_;
CGAL::Random& rng_;
/// Error bound relative to sphere radius
FT squared_error_bound_;
private:
// Disabled copy constructor & assignment operator
typedef Labeled_mesh_domain_3<Function,BGT,RNG> Self;
typedef Labeled_mesh_domain_3<Function,BGT> Self;
Labeled_mesh_domain_3(const Self& src);
Self& operator=(const Self& src);
@ -486,11 +485,11 @@ private:
//-------------------------------------------------------
// Method implementation
//-------------------------------------------------------
template<class F, class BGT, class RNG>
Labeled_mesh_domain_3<F,BGT,RNG>::Labeled_mesh_domain_3(
template<class F, class BGT>
Labeled_mesh_domain_3<F,BGT>::Labeled_mesh_domain_3(
const F& f,
const Sphere_3& bounding_sphere,
RNG rng,
CGAL::Random& rng,
const FT& error_bound )
: function_(f)
, bbox_(iso_cuboid(bounding_sphere.bbox()))
@ -500,11 +499,11 @@ Labeled_mesh_domain_3<F,BGT,RNG>::Labeled_mesh_domain_3(
// TODO : CGAL_ASSERT(0 < f(bounding_sphere.get_center()) ) ?
}
template<class F, class BGT, class RNG>
Labeled_mesh_domain_3<F,BGT,RNG>::Labeled_mesh_domain_3(
template<class F, class BGT>
Labeled_mesh_domain_3<F,BGT>::Labeled_mesh_domain_3(
const F& f,
const Bbox_3& bbox,
RNG rng,
CGAL::Random& rng,
const FT& error_bound )
: function_(f)
, bbox_(iso_cuboid(bbox))
@ -516,10 +515,10 @@ Labeled_mesh_domain_3<F,BGT,RNG>::Labeled_mesh_domain_3(
template<class F, class BGT, class RNG>
template<class F, class BGT>
template<class OutputIterator>
OutputIterator
Labeled_mesh_domain_3<F,BGT,RNG>::Construct_initial_points::operator()(
Labeled_mesh_domain_3<F,BGT>::Construct_initial_points::operator()(
OutputIterator pts,
const int nb_points) const
{

View File

@ -149,7 +149,6 @@ struct IGT_generator<Gt,CGAL::Tag_false>
template<class Polyhedron,
class IGT_,
class TriangleAccessor=Triangle_accessor_3<Polyhedron,IGT_>,
class RNG=CGAL::Random,
class Use_patch_id_tag=Tag_false,
class Use_exact_intersection_construction_tag = CGAL::Tag_true>
class Polyhedral_mesh_domain_3
@ -206,17 +205,15 @@ public:
: tree_()
, bounding_tree_(&tree_)
, has_cache(false)
, rng_(CGAL::default_random)
{
CGAL::default_random = CGAL::Random(0);
}
, rng_(CGAL::Random(0))
{}
/**
* @brief Constructor. Contruction from a polyhedral surface
* @param polyhedron the polyhedron describing the polyhedral surface
*/
Polyhedral_mesh_domain_3(const Polyhedron& p,
RNG rng = CGAL::Random(0))
CGAL::Random& rng = CGAL::Random(0))
: tree_(TriangleAccessor().triangles_begin(p),
TriangleAccessor().triangles_end(p)),
bounding_tree_(&tree_) // the bounding tree is tree_
@ -231,7 +228,7 @@ public:
Polyhedral_mesh_domain_3(const Polyhedron& p,
const Polyhedron& bounding_polyhedron,
RNG rng = CGAL::Random(0))
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),
@ -260,7 +257,7 @@ public:
Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin,
InputPolyhedraPtrIterator end,
const Polyhedron& bounding_polyhedron,
RNG rng = CGAL::Random(0))
CGAL::Random& rng = CGAL::Random(0))
: has_cache(false)
, rng_(rng)
{
@ -297,7 +294,7 @@ public:
template <typename InputPolyhedraPtrIterator>
Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin,
InputPolyhedraPtrIterator end,
RNG rng = CGAL::Random(0))
CGAL::Random& rng = CGAL::Random(0))
: has_cache(false)
, rng_(rng)
{
@ -610,7 +607,7 @@ private:
mutable AABB_primitive_id cached_primitive_id;
//random number generator for Construct_initial_points
RNG& rng_;
CGAL::Random& rng_;
public:
@ -641,10 +638,10 @@ private:
template<typename P_, typename IGT_, typename TA,
typename RNG_, typename Tag, typename E_tag_>
typename Tag, typename E_tag_>
template<class OutputIterator>
OutputIterator
Polyhedral_mesh_domain_3<P_,IGT_,TA,RNG_,Tag,E_tag_>::
Polyhedral_mesh_domain_3<P_,IGT_,TA,Tag,E_tag_>::
Construct_initial_points::operator()(OutputIterator pts,
const int n) const
{
@ -697,9 +694,9 @@ Construct_initial_points::operator()(OutputIterator pts,
template<typename P_, typename IGT_, typename TA,
typename RNG_, typename Tag, typename E_tag_>
typename Polyhedral_mesh_domain_3<P_,IGT_,TA,RNG_,Tag,E_tag_>::Subdomain
Polyhedral_mesh_domain_3<P_,IGT_,TA,RNG_,Tag,E_tag_>::
typename Tag, typename E_tag_>
typename Polyhedral_mesh_domain_3<P_,IGT_,TA,Tag,E_tag_>::Subdomain
Polyhedral_mesh_domain_3<P_,IGT_,TA,Tag,E_tag_>::
Is_in_domain::operator()(const Point_3& p) const
{
if(r_domain_.bounding_tree_ == 0) return Subdomain();

View File

@ -57,7 +57,6 @@ namespace CGAL {
template < class IGT_,
class Polyhedron_ = typename Mesh_polyhedron_3<IGT_>::type,
class TriangleAccessor=Triangle_accessor_3<Polyhedron_,IGT_>,
class RNG=CGAL::Random,
class Use_patch_id_tag = Tag_true,
class Use_exact_intersection_construction_tag = CGAL::Tag_true >
class Polyhedral_mesh_domain_with_features_3
@ -65,13 +64,12 @@ class Polyhedral_mesh_domain_with_features_3
Polyhedral_mesh_domain_3< Polyhedron_,
IGT_,
TriangleAccessor,
RNG,
Use_patch_id_tag,
Use_exact_intersection_construction_tag > >
{
typedef Mesh_domain_with_polyline_features_3<
Polyhedral_mesh_domain_3<
Polyhedron_, IGT_, TriangleAccessor, RNG,
Polyhedron_, IGT_, TriangleAccessor,
Use_patch_id_tag, Use_exact_intersection_construction_tag > > Base;
typedef Polyhedron_ Polyhedron;
@ -128,8 +126,8 @@ private:
template < typename GT_, typename P_, typename TA_,
typename RNG_, typename Tag_, typename E_tag_>
Polyhedral_mesh_domain_with_features_3<GT_,P_,TA_,RNG_,Tag_,E_tag_>::
typename Tag_, typename E_tag_>
Polyhedral_mesh_domain_with_features_3<GT_,P_,TA_,Tag_,E_tag_>::
Polyhedral_mesh_domain_with_features_3(const Polyhedron& p)
: Base()
, polyhedron_(p)
@ -138,8 +136,8 @@ Polyhedral_mesh_domain_with_features_3(const Polyhedron& p)
}
template < typename GT_, typename P_, typename TA_,
typename RNG_, typename Tag_, typename E_tag_>
Polyhedral_mesh_domain_with_features_3<GT_,P_,TA_,RNG_,Tag_,E_tag_>::
typename Tag_, typename E_tag_>
Polyhedral_mesh_domain_with_features_3<GT_,P_,TA_,Tag_,E_tag_>::
Polyhedral_mesh_domain_with_features_3(const std::string& filename)
: Base()
, polyhedron_()
@ -152,9 +150,9 @@ Polyhedral_mesh_domain_with_features_3(const std::string& filename)
template < typename GT_, typename P_, typename TA_,
typename RNG_, typename Tag_, typename E_tag_>
typename Tag_, typename E_tag_>
void
Polyhedral_mesh_domain_with_features_3<GT_,P_,TA_,RNG_,Tag_,E_tag_>::
Polyhedral_mesh_domain_with_features_3<GT_,P_,TA_,Tag_,E_tag_>::
initialize_ts(Polyhedron& p)
{
std::size_t ts = 0;
@ -177,9 +175,9 @@ initialize_ts(Polyhedron& p)
template < typename GT_, typename P_, typename TA_,
typename RNG_, typename Tag_, typename E_tag_>
typename Tag_, typename E_tag_>
void
Polyhedral_mesh_domain_with_features_3<GT_,P_,TA_,RNG_,Tag_,E_tag_>::
Polyhedral_mesh_domain_with_features_3<GT_,P_,TA_,Tag_,E_tag_>::
detect_features(FT angle_in_degree, Polyhedron& p)
{
initialize_ts(p);