Use boost::array instead of Threetuple

This commit is contained in:
Sylvain Pion 2008-07-25 11:01:57 +00:00
parent a6092e4dc5
commit edaa883845
2 changed files with 12 additions and 12 deletions

View File

@ -24,8 +24,8 @@
#ifndef CGAL_CARTESIAN_TRIANGLE_2_H
#define CGAL_CARTESIAN_TRIANGLE_2_H
#include <CGAL/Threetuple.h>
#include <CGAL/Cartesian/predicates_on_points_2.h>
#include <CGAL/array.h>
CGAL_BEGIN_NAMESPACE
@ -37,7 +37,7 @@ class TriangleC2
typedef typename R_::Vector_2 Vector_2;
typedef typename R_::Triangle_2 Triangle_2;
typedef Threetuple<Point_2> Rep;
typedef boost::array<Point_2, 3> Rep;
typedef typename R_::template Handle<Rep>::type Base;
Base base;
@ -48,7 +48,7 @@ public:
TriangleC2() {}
TriangleC2(const Point_2 &p, const Point_2 &q, const Point_2 &r)
: base(p, q, r) {}
: base(CGALi::make_array(p, q, r)) {}
const Point_2 &
@ -56,9 +56,9 @@ public:
{
if (i>2) i = i%3;
else if (i<0) i = (i%3) + 3;
return (i==0) ? get(base).e0 :
(i==1) ? get(base).e1 :
get(base).e2;
return (i==0) ? get(base)[0] :
(i==1) ? get(base)[1] :
get(base)[2];
}
const Point_2 &

View File

@ -24,8 +24,8 @@
#ifndef CGAL_CARTESIAN_TRIANGLE_3_H
#define CGAL_CARTESIAN_TRIANGLE_3_H
#include <CGAL/Threetuple.h>
#include <CGAL/Handle_for.h>
#include <CGAL/array.h>
CGAL_BEGIN_NAMESPACE
@ -38,7 +38,7 @@ class TriangleC3
typedef typename R_::Plane_3 Plane_3;
typedef typename R_::Triangle_3 Triangle_3;
typedef Threetuple<Point_3> Rep;
typedef boost::array<Point_3, 3> Rep;
typedef typename R_::template Handle<Rep>::type Base;
Base base;
@ -49,7 +49,7 @@ public:
TriangleC3() {}
TriangleC3(const Point_3 &p, const Point_3 &q, const Point_3 &r)
: base(p, q, r) {}
: base(CGALi::make_array(p, q, r)) {}
bool operator==(const TriangleC3 &t) const;
bool operator!=(const TriangleC3 &t) const;
@ -94,9 +94,9 @@ TriangleC3<R>::vertex(int i) const
{
if (i<0) i=(i%3)+3;
else if (i>2) i=i%3;
return (i==0) ? get(base).e0 :
(i==1) ? get(base).e1 :
get(base).e2;
return (i==0) ? get(base)[0] :
(i==1) ? get(base)[1] :
get(base)[2];
}
template < class R >