\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.13.2 - Geometric Object Generators
CGAL::Random_points_in_triangles_2< Point_2, Triangle_2, Creator > Struct Template Reference

#include <CGAL/point_generators_2.h>

Definition

template<typename Point_2, typename Triangle_2 = typename Kernel_traits<Point_2>::Kernel::Triangle_2, typename Creator = Creator_uniform_2<typename Kernel_traits<Point_2>::Kernel::RT,Point_2>>
struct CGAL::Random_points_in_triangles_2< Point_2, Triangle_2, Creator >

The class Random_points_in_triangles_2 is an input iterator creating points uniformly distributed inside a range of Triangle_2.

The triangle range must be valid and unchanged while the iterator is used.

Is Model Of:

InputIterator

PointGenerator

See also
CGAL::cpp11::copy_n()
CGAL::Counting_iterator
CGAL::Points_on_segment_2<Point_2>
CGAL::Random_points_in_disc_2<Point_2, Creator>
CGAL::Random_points_on_segment_2<Point_2, Creator>
CGAL::Random_points_on_square_2<Point_2, Creator>
CGAL::Random_points_in_cube_3<Point_3, Creator>
CGAL::Random_points_in_triangle_3<Point_2, Creator>
CGAL::Random_points_in_tetrahedron_3<Point_2, Creator>
CGAL::Random_points_in_triangle_mesh_3<Point_3, TriangleMesh>
CGAL::Random_points_in_tetrahedral_mesh_boundary_3<C3T3>
CGAL::Random_points_in_tetrahedral_mesh_3<C3T3>
CGAL::Random_points_in_triangles_3<Point_3>
std::random_shuffle
Examples:
Generator/random_points_in_triangles_2.cpp.

Types

typedef std::input_iterator_tag iterator_category
 
typedef Point_2 value_type
 
typedef std::ptrdiff_t difference_type
 
const typedef Point_2pointer
 
const typedef Point_2reference
 
template<typename TriangleRange >
 Random_points_in_triangles_2 (const TriangleRange &triangles, Random &rnd=get_default_random())
 Creates an input iterator g generating points of type Point_2 uniformly distributed between the triangles of the range. More...
 

Constructor & Destructor Documentation

◆ Random_points_in_triangles_2()

template<typename Point_2, typename Triangle_2 = typename Kernel_traits<Point_2>::Kernel::Triangle_2, typename Creator = Creator_uniform_2<typename Kernel_traits<Point_2>::Kernel::RT,Point_2>>
template<typename TriangleRange >
CGAL::Random_points_in_triangles_2< Point_2, Triangle_2, Creator >::Random_points_in_triangles_2 ( const TriangleRange &  triangles,
Random rnd = get_default_random() 
)

Creates an input iterator g generating points of type Point_2 uniformly distributed between the triangles of the range.

Each triangle has a probability to be chosen to hold the point depending on its area.