Fix warnings: CGAL objects use int parameters for operator[]

This commit is contained in:
Simon Giraudot 2021-03-31 09:40:19 +02:00
parent a4ac6061cf
commit 3efe2ec339
9 changed files with 25 additions and 25 deletions

View File

@ -220,10 +220,10 @@ assemble_covariance_matrix_3(InputIterator first,
typedef typename K::FT FT;
typedef typename K::Iso_cuboid_3 Iso_cuboid;
typedef typename K::Triangle_3 Triangle;
auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Triangle
auto converter = [](const Iso_cuboid& c, int idx) -> Triangle
{
// Decomposition of 6 faces of the cuboid into 12 triangles
static constexpr std::array<std::array<std::size_t, 3>, 12 > indices
static constexpr std::array<std::array<int, 3>, 12 > indices
= {{ { 0, 1, 2 }, { 0, 2, 3 }, { 2, 3, 4 }, { 2, 4, 7 },
{ 3, 4, 5 }, { 3, 5, 0 }, { 4, 5, 6 }, { 4, 6, 7 },
{ 5, 6, 1 }, { 5, 1, 0 }, { 6, 7, 2 }, { 6, 2, 1 } }};

View File

@ -31,12 +31,12 @@ public:
using Input_type = typename std::iterator_traits<InputIterator>::value_type;
using Output_type = ValueType;
using Converter = std::function<Output_type(const Input_type&, std::size_t)>;
using Converter = std::function<Output_type(const Input_type&, int)>;
private:
Converter m_converter;
std::size_t m_next_index;
int m_next_index;
InputIterator m_base;
mutable Output_type m_current;

View File

@ -113,7 +113,7 @@ linear_least_squares_fitting_3(InputIterator first,
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Segment
auto converter = [](const Iso_cuboid& c, int idx) -> Segment
{
if (idx < 7)
return Segment (c[idx], c[idx+1]);
@ -148,7 +148,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Point_3 Point;
typedef typename K::Iso_cuboid_3 Iso_cuboid;
auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Point { return c[idx]; };
auto converter = [](const Iso_cuboid& c, int idx) -> Point { return c[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
@ -240,7 +240,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Segment_3 Segment;
typedef typename K::Iso_cuboid_3 Iso_cuboid;
auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Segment
auto converter = [](const Iso_cuboid& c, int idx) -> Segment
{
if (idx < 7)
return Segment (c[idx], c[idx+1]);
@ -279,7 +279,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Point_3 Point;
typedef typename K::Iso_cuboid_3 Iso_cuboid;
auto converter = [](const Iso_cuboid& c, std::size_t idx) -> Point { return c[idx]; };
auto converter = [](const Iso_cuboid& c, int idx) -> Point { return c[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);

View File

@ -158,7 +158,7 @@ linear_least_squares_fitting_2(InputIterator first,
// types
typedef typename K::Iso_rectangle_2 Iso_rectangle;
typedef typename K::Segment_2 Segment_2;
auto converter = [](const Iso_rectangle& r, std::size_t idx) -> Segment_2 { return Segment_2(r[idx], r[(idx+1)%4]); };
auto converter = [](const Iso_rectangle& r, int idx) -> Segment_2 { return Segment_2(r[idx], r[(idx+1)%4]); };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
@ -188,7 +188,7 @@ linear_least_squares_fitting_2(InputIterator first,
// types
typedef typename K::Iso_rectangle_2 Iso_rectangle;
typedef typename K::Point_2 Point_2;
auto converter = [](const Iso_rectangle& r, std::size_t idx) -> Point_2 { return r[idx]; };
auto converter = [](const Iso_rectangle& r, int idx) -> Point_2 { return r[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);

View File

@ -147,7 +147,7 @@ linear_least_squares_fitting_2(InputIterator first,
// types
typedef typename K::Point_2 Point;
typedef typename K::Segment_2 Segment;
auto converter = [](const Segment& s, std::size_t idx) -> Point { return s[idx]; };
auto converter = [](const Segment& s, int idx) -> Point { return s[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);

View File

@ -75,7 +75,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Segment_3 Segment;
typedef typename K::Point_3 Point;
auto converter = [](const Segment& s, std::size_t idx) -> Point { return s[idx]; };
auto converter = [](const Segment& s, int idx) -> Point { return s[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
@ -134,7 +134,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Segment_3 Segment;
typedef typename K::Point_3 Point;
auto converter = [](const Segment& s, std::size_t idx) -> Point { return s[idx]; };
auto converter = [](const Segment& s, int idx) -> Point { return s[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);

View File

@ -76,7 +76,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Tetrahedron_3 Tetrahedron;
typedef typename K::Triangle_3 Triangle;
auto converter = [](const Tetrahedron& t, std::size_t idx) -> Triangle
auto converter = [](const Tetrahedron& t, int idx) -> Triangle
{ return Triangle(t[idx], t[(idx+1)%4], t[(idx+2)%4]); };
// precondition: at least one element in the container.
@ -105,7 +105,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Tetrahedron_3 Tetrahedron;
typedef typename K::Segment_3 Segment;
auto converter = [](const Tetrahedron& t, std::size_t idx) -> Segment
auto converter = [](const Tetrahedron& t, int idx) -> Segment
{
if (idx < 4)
return Segment (t[idx], t[(idx+1)%4]);
@ -139,7 +139,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Tetrahedron_3 Tetrahedron;
typedef typename K::Point_3 Point;
auto converter = [](const Tetrahedron& t, std::size_t idx) -> Point { return t[idx]; };
auto converter = [](const Tetrahedron& t, int idx) -> Point { return t[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
@ -198,7 +198,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Tetrahedron_3 Tetrahedron;
typedef typename K::Triangle_3 Triangle;
auto converter = [](const Tetrahedron& t, std::size_t idx) -> Triangle
auto converter = [](const Tetrahedron& t, int idx) -> Triangle
{ return Triangle(t[idx], t[(idx+1)%4], t[(idx+2)%4]); };
// precondition: at least one element in the container.
@ -227,7 +227,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Tetrahedron_3 Tetrahedron;
typedef typename K::Segment_3 Segment;
auto converter = [](const Tetrahedron& t, std::size_t idx) -> Segment
auto converter = [](const Tetrahedron& t, int idx) -> Segment
{
if (idx < 4)
return Segment (t[idx], t[(idx+1)%4]);
@ -260,7 +260,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Tetrahedron_3 Tetrahedron;
typedef typename K::Point_3 Point;
auto converter = [](const Tetrahedron& t, std::size_t idx) -> Point { return t[idx]; };
auto converter = [](const Tetrahedron& t, int idx) -> Point { return t[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);

View File

@ -159,7 +159,7 @@ linear_least_squares_fitting_2(InputIterator first,
// types
typedef typename Kernel::Triangle_2 Triangle;
typedef typename Kernel::Segment_2 Segment;
auto converter = [](const Triangle& t, std::size_t idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); };
auto converter = [](const Triangle& t, int idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
@ -189,7 +189,7 @@ linear_least_squares_fitting_2(InputIterator first,
typedef typename Kernel::Triangle_2 Triangle;
typedef typename Kernel::Point_2 Point;
auto converter = [](const Triangle& t, std::size_t idx) -> Point { return t[idx]; };
auto converter = [](const Triangle& t, int idx) -> Point { return t[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);

View File

@ -74,7 +74,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Triangle_3 Triangle;
typedef typename K::Segment_3 Segment;
auto converter = [](const Triangle& t, std::size_t idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); };
auto converter = [](const Triangle& t, int idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
@ -103,7 +103,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Triangle_3 Triangle;
typedef typename K::Point_3 Point;
auto converter = [](const Triangle& t, std::size_t idx) -> Point { return t[idx]; };
auto converter = [](const Triangle& t, int idx) -> Point { return t[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
@ -163,7 +163,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Triangle_3 Triangle;
typedef typename K::Segment_3 Segment;
auto converter = [](const Triangle& t, std::size_t idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); };
auto converter = [](const Triangle& t, int idx) -> Segment { return Segment(t[idx], t[(idx+1)%3]); };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);
@ -191,7 +191,7 @@ linear_least_squares_fitting_3(InputIterator first,
{
typedef typename K::Triangle_3 Triangle;
typedef typename K::Point_3 Point;
auto converter = [](const Triangle& t, std::size_t idx) -> Point { return t[idx]; };
auto converter = [](const Triangle& t, int idx) -> Point { return t[idx]; };
// precondition: at least one element in the container.
CGAL_precondition(first != beyond);