converted to new manual style

This commit is contained in:
Susan Hert 2002-03-21 19:24:32 +00:00
parent 298adadd86
commit 95d5929e9d
5 changed files with 23 additions and 38 deletions

View File

@ -1,6 +1,9 @@
Generator Package: Release changes:
---------------------------------------------------------------------
2.53 (20 Mar 2002)
2.54 (21 Mar 2002)
- converted to new manual style
2.53 (21 Mar 2002)
- changed demo to use double instead of int in point creator to get
rid of warning

View File

@ -24,8 +24,8 @@ int main() {
// Create 125 points from a 5 x 5 x 5 grid. Note that the double
// arithmetic _is_ sufficient to produce exact integer grid points.
CGAL::points_on_square_grid_3(10, 125, std::back_inserter(points),
Creator());
CGAL::points_on_cube_grid_3(10, 125, std::back_inserter(points),
Creator());
// Check that we have really created 1000 points.
assert( points.size() == 125);

View File

@ -145,7 +145,7 @@ generate_point() {
template <class OutputIterator, class Creator>
OutputIterator
points_on_square_grid_3( double a, std::size_t n,
points_on_cube_grid_3( double a, std::size_t n,
OutputIterator o, Creator creator)
{
if (n == 0)
@ -189,7 +189,7 @@ points_on_square_grid_3( double a, std::size_t n,
template <class OutputIterator>
OutputIterator
points_on_square_grid_3( double a, std::size_t n, OutputIterator o)
points_on_cube_grid_3( double a, std::size_t n, OutputIterator o)
{
typedef std::iterator_traits<OutputIterator> ITraits;
typedef typename ITraits::value_type P;

View File

@ -32,6 +32,7 @@
#include <vector>
#include <assert.h>
#include <CGAL/Random_polygon_2_sweep.h>
#include <CGAL/Kernel_traits.h>
namespace CGAL {
@ -80,18 +81,10 @@ OutputIterator random_polygon_2( int n, OutputIterator result,
const PointGenerator& pg )
{
typedef typename std::iterator_traits<PointGenerator>::value_type Point_2;
return _random_polygon_2(n, result, pg, reinterpret_cast<Point_2*>(0));
typedef typename Kernel_traits<Point_2>::Kernel K;
return random_polygon_2(n, result, pg, K());
}
template <class PointGenerator, class OutputIterator, class R>
inline
OutputIterator _random_polygon_2( int n, OutputIterator result,
const PointGenerator& pg, Point_2<R>*)
{
return random_polygon_2(n, result, pg, R());
}
template <class ForwardIterator, class Traits>
bool duplicate_points(ForwardIterator first, ForwardIterator beyond,
const Traits& )
@ -109,15 +102,10 @@ template <class ForwardIterator>
bool duplicate_points(ForwardIterator first, ForwardIterator beyond)
{
typedef typename std::iterator_traits<ForwardIterator>::value_type Point_2;
return _duplicate_points(first, beyond, reinterpret_cast<Point_2*>(0));
typedef typename Kernel_traits<Point_2>::Kernel K;
return duplicate_points(first, beyond, K());
}
template <class ForwardIterator, class R>
bool _duplicate_points(ForwardIterator first, ForwardIterator beyond,
Point_2<R>*)
{
return duplicate_points(first, beyond, R());
}
// Copies the first n points from the input iterator to the output iterator,
// removing any duplicates. Thus fewer than n points may be inserted into
@ -150,16 +138,10 @@ OutputIterator copy_n_unique(InputIterator first, Size n,
OutputIterator result)
{
typedef typename std::iterator_traits<InputIterator>::value_type Point_2;
return _copy_n_unique(first, n, result, reinterpret_cast<Point_2*>(0));
typedef typename Kernel_traits<Point_2>::Kernel K;
return copy_n_unique(first, n, result, K());
}
template <class InputIterator, class Size, class OutputIterator, class R>
inline
OutputIterator _copy_n_unique(InputIterator first, Size n,
OutputIterator result, Point_2<R>*)
{
return copy_n_unique(first, n, result, R());
}
} // namespace CGAL

View File

@ -115,14 +115,14 @@ void test_point_generators_3() {
Random_points_in_cube_3<Point_3,Creator> g3( 100.0);
CGAL::copy_n( g2, 100, std::back_inserter(points));
CGAL::copy_n( g3, 100, std::back_inserter(points));
points_on_square_grid_3( 50.0, (std::size_t)1,
std::back_inserter(points), Creator());
points_on_square_grid_3( 50.0, (std::size_t)2,
std::back_inserter(points), Creator());
points_on_square_grid_3( 50.0, (std::size_t)3,
std::back_inserter(points), Creator());
points_on_square_grid_3( 50.0, (std::size_t)94,
std::back_inserter(points), Creator());
points_on_cube_grid_3( 50.0, (std::size_t)1,
std::back_inserter(points), Creator());
points_on_cube_grid_3( 50.0, (std::size_t)2,
std::back_inserter(points), Creator());
points_on_cube_grid_3( 50.0, (std::size_t)3,
std::back_inserter(points), Creator());
points_on_cube_grid_3( 50.0, (std::size_t)94,
std::back_inserter(points), Creator());
random_selection( points.begin(), points.end(), 100,
std::back_inserter(points));