CGAL 6.2 - Geometric Object Generators
Loading...
Searching...
No Matches
CGAL::Random_points_in_triangle_soup_3< PointRange, TriangleRange, Creator > Struct Template Reference

#include <CGAL/point_generators_3.h>

Definition

template<class PointRange, class TriangleRange, typename Creator = Creator_uniform_3< typename Kernel_traits< typename PointRange::value_type >::Kernel::RT, typename PointRange::value_type>>
struct CGAL::Random_points_in_triangle_soup_3< PointRange, TriangleRange, Creator >

The class Random_points_in_triangle_soup_3 is an input iterator creating points uniformly distributed inside a range of Triangle_3.

The triangle range must be valid and unchanged while the iterator is used. Triangle are triple of indices refering to position of points in the input point range.

Template Parameters
PointRangea model of the concepts RandomAccessContainer with value type begin a point from a CGAL kernel
TriangleRangea model of the concept RandomAccessContainer, with value_type being a model of RandomAccessContainer with std::size_t as value_type.
Is model of
InputIterator
PointGenerator
See also
CGAL::Random_points_in_cube_3<Point_3, Creator>
CGAL::Random_points_in_triangle_3<Point_3, Creator>
CGAL::Random_points_in_tetrahedron_3<Point_3, 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_2<Point_2>

Types

typedef std::input_iterator_tag iterator_category
 
typedef Point_3 value_type
 
typedef std::ptrdiff_t difference_type
 
typedef const Point_3pointer
 
typedef const Point_3reference
 

Functions

 Random_points_in_triangle_soup_3 (const PointRange &points, const TriangleRange &triangles, Random &rnd=get_default_random())
 creates an input iterator g generating points of type Point_3 uniformly distributed between the triangles of the range.
 
std::size_t last_item_picked () const
 returns the id in the input range of the triangle containing the last point generated.
 

Constructor & Destructor Documentation

◆ Random_points_in_triangle_soup_3()

template<class PointRange , class TriangleRange , typename Creator = Creator_uniform_3< typename Kernel_traits< typename PointRange::value_type >::Kernel::RT, typename PointRange::value_type>>
CGAL::Random_points_in_triangle_soup_3< PointRange, TriangleRange, Creator >::Random_points_in_triangle_soup_3 ( const PointRange &  points,
const TriangleRange &  triangles,
Random rnd = get_default_random() 
)

creates an input iterator g generating points of type Point_3 uniformly distributed between the triangles of the range.

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

Member Function Documentation

◆ last_item_picked()

template<class PointRange , class TriangleRange , typename Creator = Creator_uniform_3< typename Kernel_traits< typename PointRange::value_type >::Kernel::RT, typename PointRange::value_type>>
std::size_t CGAL::Random_points_in_triangle_soup_3< PointRange, TriangleRange, Creator >::last_item_picked ( ) const

returns the id in the input range of the triangle containing the last point generated.

Precondition
a point must have been generated before calling the function