mirror of https://github.com/CGAL/cgal
changes made in Dagstuhl to comply to MSVC++
includes : include codes of operators * and -> in class definition of Tds iterators Change the power_test Change names for representation in traits
This commit is contained in:
parent
309042e236
commit
110d91c077
|
|
@ -75,62 +75,145 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
#ifdef CGAL_CARTESIAN_H
|
||||
template < class FT, class Weight >
|
||||
// #ifdef CGAL_CARTESIAN_H
|
||||
// template < class FT, class Weight >
|
||||
// inline
|
||||
// Oriented_side
|
||||
// power_test(const Weighted_point<Point_2<Cartesian<FT> >, Weight> &p,
|
||||
// const Weighted_point<Point_2<Cartesian<FT> >, Weight> &q,
|
||||
// const Weighted_point<Point_2<Cartesian<FT> >, Weight> &r,
|
||||
// const Weighted_point<Point_2<Cartesian<FT> >, Weight> &t)
|
||||
// {
|
||||
// return power_testC2(p.x(), p.y(), FT(p.weight()),
|
||||
// q.x(), q.y(), FT(q.weight()),
|
||||
// r.x(), r.y(), FT(r.weight()),
|
||||
// t.x(), t.y(), FT(t.weight()));
|
||||
// }
|
||||
|
||||
// template < class FT, class Weight >
|
||||
// inline
|
||||
// Oriented_side
|
||||
// power_test(const Weighted_point<Point_2<Cartesian<FT> >, Weight> &p,
|
||||
// const Weighted_point<Point_2<Cartesian<FT> >, Weight> &q,
|
||||
// const Weighted_point<Point_2<Cartesian<FT> >, Weight> &t)
|
||||
// {
|
||||
// return power_testC2(p.x(), p.y(), FT(p.weight()),
|
||||
// q.x(), q.y(), FT(q.weight()),
|
||||
// t.x(), t.y(), FT(t.weight()));
|
||||
// }
|
||||
// #endif // CGAL_CARTESIAN_H
|
||||
|
||||
// #ifdef CGAL_HOMOGENEOUS_H
|
||||
// template < class RT, class Weight >
|
||||
// inline
|
||||
// Oriented_side
|
||||
// power_test(const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &p,
|
||||
// const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &q,
|
||||
// const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &r,
|
||||
// const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &t)
|
||||
// {
|
||||
// return power_testH2(p.hx(), p.hy(), p.hw(), RT(p.weight()),
|
||||
// q.hx(), q.hy(), q.hw(), RT(q.weight()),
|
||||
// r.hx(), r.hy(), r.hw(), RT(r.weight()),
|
||||
// t.hx(), t.hy(), t.hw(), RT(t.weight()));
|
||||
// }
|
||||
|
||||
// template < class RT, class Weight >
|
||||
// inline
|
||||
// Oriented_side
|
||||
// power_test(const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &p,
|
||||
// const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &q,
|
||||
// const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &t)
|
||||
// {
|
||||
// return power_testH2(p.hx(), p.hy(), p.hw(), RT(p.weight()),
|
||||
// q.hx(), q.hy(), q.hw(), RT(q.weight()),
|
||||
// t.hx(), t.hy(), t.hw(), RT(t.weight()));
|
||||
// }
|
||||
// #endif // CGAL_HOMOGENEOUS_H
|
||||
|
||||
template < class Point, class Weight >
|
||||
inline
|
||||
Oriented_side
|
||||
power_test(const Weighted_point<Point_2<Cartesian<FT> >, Weight> &p,
|
||||
const Weighted_point<Point_2<Cartesian<FT> >, Weight> &q,
|
||||
const Weighted_point<Point_2<Cartesian<FT> >, Weight> &r,
|
||||
const Weighted_point<Point_2<Cartesian<FT> >, Weight> &t)
|
||||
power_test(const Weighted_point<Point, Weight> &p,
|
||||
const Weighted_point<Point, Weight> &q,
|
||||
const Weighted_point<Point, Weight> &r,
|
||||
const Weighted_point<Point, Weight> &t,
|
||||
Cartesian_tag )
|
||||
{
|
||||
return power_testC2(p.x(), p.y(), FT(p.weight()),
|
||||
q.x(), q.y(), FT(q.weight()),
|
||||
r.x(), r.y(), FT(r.weight()),
|
||||
t.x(), t.y(), FT(t.weight()));
|
||||
typedef typename Point::FT FT;
|
||||
return power_testC2(p.x(), p.y(), FT(p.weight()),
|
||||
q.x(), q.y(), FT(q.weight()),
|
||||
r.x(), r.y(), FT(r.weight()),
|
||||
t.x(), t.y(), FT(t.weight()));
|
||||
}
|
||||
|
||||
template < class FT, class Weight >
|
||||
template < class Point, class Weight >
|
||||
inline
|
||||
Oriented_side
|
||||
power_test(const Weighted_point<Point_2<Cartesian<FT> >, Weight> &p,
|
||||
const Weighted_point<Point_2<Cartesian<FT> >, Weight> &q,
|
||||
const Weighted_point<Point_2<Cartesian<FT> >, Weight> &t)
|
||||
power_test(const Weighted_point<Point, Weight> &p,
|
||||
const Weighted_point<Point, Weight> &q,
|
||||
const Weighted_point<Point, Weight> &r,
|
||||
const Weighted_point<Point, Weight> &t,
|
||||
Homogeneous_tag )
|
||||
{
|
||||
typedef typename Point::RT RT;
|
||||
return power_testH2(p.hx(), p.hy(), p.hw(), RT(p.weight()),
|
||||
q.hx(), q.hy(), q.hw(), RT(q.weight()),
|
||||
r.hx(), r.hy(), r.hw(), RT(r.weight()),
|
||||
t.hx(), t.hy(), t.hw(), RT(t.weight()));
|
||||
}
|
||||
|
||||
template < class Point, class Weight >
|
||||
inline
|
||||
Oriented_side
|
||||
power_test(const Weighted_point<Point, Weight> &p,
|
||||
const Weighted_point<Point, Weight> &q,
|
||||
const Weighted_point<Point, Weight> &r,
|
||||
const Weighted_point<Point, Weight> &t)
|
||||
{
|
||||
typedef typename Point::R::Rep_tag Tag;
|
||||
return power_test(p, q, r, t, Tag());
|
||||
}
|
||||
|
||||
template < class Point, class Weight >
|
||||
inline
|
||||
Oriented_side
|
||||
power_test(const Weighted_point<Point, Weight> &p,
|
||||
const Weighted_point<Point, Weight> &q,
|
||||
const Weighted_point<Point, Weight> &t,
|
||||
Cartesian_tag )
|
||||
{
|
||||
typedef typename Point::FT FT;
|
||||
return power_testC2(p.x(), p.y(), FT(p.weight()),
|
||||
q.x(), q.y(), FT(q.weight()),
|
||||
t.x(), t.y(), FT(t.weight()));
|
||||
}
|
||||
#endif // CGAL_CARTESIAN_H
|
||||
|
||||
#ifdef CGAL_HOMOGENEOUS_H
|
||||
template < class RT, class Weight >
|
||||
|
||||
template < class Point, class Weight >
|
||||
inline
|
||||
Oriented_side
|
||||
power_test(const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &p,
|
||||
const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &q,
|
||||
const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &r,
|
||||
const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &t)
|
||||
{
|
||||
return power_testH2(p.hx(), p.hy(), p.hw(), RT(p.weight()),
|
||||
q.hx(), q.hy(), q.hw(), RT(q.weight()),
|
||||
r.hx(), r.hy(), r.hw(), RT(r.weight()),
|
||||
t.hx(), t.hy(), t.hw(), RT(t.weight()));
|
||||
}
|
||||
|
||||
template < class RT, class Weight >
|
||||
inline
|
||||
Oriented_side
|
||||
power_test(const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &p,
|
||||
const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &q,
|
||||
const Weighted_point<Point_2<Homogeneous<RT> >, Weight> &t)
|
||||
power_test(const Weighted_point<Point, Weight> &p,
|
||||
const Weighted_point<Point, Weight> &q,
|
||||
const Weighted_point<Point, Weight> &t,
|
||||
Homogeneous_tag )
|
||||
{
|
||||
typedef typename Point::RT RT;
|
||||
return power_testH2(p.hx(), p.hy(), p.hw(), RT(p.weight()),
|
||||
q.hx(), q.hy(), q.hw(), RT(q.weight()),
|
||||
t.hx(), t.hy(), t.hw(), RT(t.weight()));
|
||||
}
|
||||
#endif // CGAL_HOMOGENEOUS_H
|
||||
|
||||
template < class Point, class Weight >
|
||||
inline
|
||||
Oriented_side
|
||||
power_test(const Weighted_point<Point, Weight> &p,
|
||||
const Weighted_point<Point, Weight> &q,
|
||||
const Weighted_point<Point, Weight> &t)
|
||||
{
|
||||
typedef typename Point::R::Rep_tag Tag;
|
||||
return power_test(p, q, t, Tag());
|
||||
}
|
||||
CGAL_END_NAMESPACE
|
||||
|
||||
#endif // CGAL_REGULAR_TRIANGULATION_EUCLIDEAN_TRAITS_2_H
|
||||
|
|
|
|||
|
|
@ -874,8 +874,8 @@ copy_tds(const Tds &tds, const Vertex* v)
|
|||
|
||||
if(tds.number_of_vertices() == 0){return static_cast<Vertex*>(NULL);}
|
||||
|
||||
std::map< const void*, void*, less<const void*> > V;
|
||||
std::map< const void*, void*, less<const void*> > F;
|
||||
std::map< const void*, void*, std::less<const void*> > V;
|
||||
std::map< const void*, void*, std::less<const void*> > F;
|
||||
|
||||
Vertex* v2,* v_inf;
|
||||
Face* f2;
|
||||
|
|
@ -1003,8 +1003,8 @@ file_output( std::ostream& os, Vertex* v, bool skip_first) const
|
|||
else os << n << m << dimension();
|
||||
if (n==0) return;
|
||||
|
||||
std::map< void*, int, less<void*> > V;
|
||||
std::map< void*, int, less<void*> > F;
|
||||
std::map< void*, int, std::less<void*> > V;
|
||||
std::map< void*, int, std::less<void*> > F;
|
||||
|
||||
// first vertex
|
||||
int inum = 0;
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ index(const Face* n) const
|
|||
template < class Vb, class Fb >
|
||||
bool
|
||||
Triangulation_ds_face_2<Vb,Fb>::
|
||||
is_valid(bool verbose = false, int level = 0) const
|
||||
is_valid(bool verbose, int level) const
|
||||
{
|
||||
bool result = Fb::is_valid(verbose, level);
|
||||
for(int i = 0; i <= dimension(); i++) {
|
||||
|
|
|
|||
|
|
@ -97,8 +97,19 @@ public:
|
|||
Iterator_base& operator--();
|
||||
Iterator_base operator++(int);
|
||||
Iterator_base operator--(int);
|
||||
Face& operator*() const;
|
||||
Face* operator->() const;
|
||||
|
||||
Face& operator*() const
|
||||
{
|
||||
CGAL_triangulation_precondition(pos != NULL);
|
||||
return const_cast<Face&>(*pos);
|
||||
}
|
||||
|
||||
Face* operator->() const
|
||||
{
|
||||
CGAL_triangulation_precondition(pos != NULL);
|
||||
return const_cast<Face*>(pos);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -171,9 +182,25 @@ public:
|
|||
Vertex_iterator operator--(int);
|
||||
bool operator==(const Vertex_iterator& fi) const;
|
||||
bool operator!=(const Vertex_iterator& fi) const;
|
||||
Vertex& operator*() const ;
|
||||
Vertex* operator->() const ;
|
||||
|
||||
|
||||
Vertex& operator*() const
|
||||
{
|
||||
CGAL_triangulation_assertion( pos != NULL);
|
||||
if (pos == (Face*)1) {// only one vertex;
|
||||
return *(_tds->infinite_vertex());
|
||||
}
|
||||
return *(pos->vertex(index));
|
||||
}
|
||||
|
||||
Vertex* operator->() const
|
||||
{
|
||||
CGAL_triangulation_assertion( pos != NULL);
|
||||
if (pos == (Face*)1) {// only one vertex;
|
||||
return _tds->infinite_vertex();
|
||||
}
|
||||
return pos->vertex(index);
|
||||
}
|
||||
|
||||
private:
|
||||
void increment();
|
||||
void decrement() ;
|
||||
|
|
@ -220,7 +247,9 @@ public:
|
|||
Edge_iterator& operator--();
|
||||
Edge_iterator operator++(int);
|
||||
Edge_iterator operator--(int);
|
||||
Edge operator*() const;
|
||||
|
||||
Edge operator*() const
|
||||
{return make_pair(const_cast<Face*>(pos), index);}
|
||||
|
||||
private:
|
||||
void increment();
|
||||
|
|
@ -431,25 +460,25 @@ operator--(int)
|
|||
return tmp;
|
||||
}
|
||||
|
||||
template<class Tds>
|
||||
inline
|
||||
typename Tds::Face&
|
||||
Triangulation_ds_iterator_base_2<Tds> ::
|
||||
operator*() const
|
||||
{
|
||||
CGAL_triangulation_precondition(pos != NULL);
|
||||
return const_cast<Face&>(*pos);
|
||||
}
|
||||
// template<class Tds>
|
||||
// inline
|
||||
// typename Tds::Face&
|
||||
// Triangulation_ds_iterator_base_2<Tds> ::
|
||||
// operator*() const
|
||||
// {
|
||||
// CGAL_triangulation_precondition(pos != NULL);
|
||||
// return const_cast<Face&>(*pos);
|
||||
// }
|
||||
|
||||
template<class Tds>
|
||||
inline
|
||||
typename Tds::Face*
|
||||
Triangulation_ds_iterator_base_2<Tds> ::
|
||||
operator->() const
|
||||
{
|
||||
CGAL_triangulation_precondition(pos != NULL);
|
||||
return const_cast<Face*>(pos);
|
||||
}
|
||||
// template<class Tds>
|
||||
// inline
|
||||
// typename Tds::Face*
|
||||
// Triangulation_ds_iterator_base_2<Tds> ::
|
||||
// operator->() const
|
||||
// {
|
||||
// CGAL_triangulation_precondition(pos != NULL);
|
||||
// return const_cast<Face*>(pos);
|
||||
// }
|
||||
|
||||
// Face iterator implementation
|
||||
template<class Tds>
|
||||
|
|
@ -626,31 +655,31 @@ operator!=(const Vertex_iterator& fi) const
|
|||
return !(*this == fi);
|
||||
}
|
||||
|
||||
template<class Tds>
|
||||
inline
|
||||
typename Tds::Vertex&
|
||||
Triangulation_ds_vertex_iterator_2<Tds> ::
|
||||
operator*() const
|
||||
{
|
||||
CGAL_triangulation_assertion( pos != NULL);
|
||||
if (pos == (Face*)1) {// only one vertex;
|
||||
return *(_tds->infinite_vertex());
|
||||
}
|
||||
return *(pos->vertex(index));
|
||||
}
|
||||
// template<class Tds>
|
||||
// inline
|
||||
// typename Tds::Vertex&
|
||||
// Triangulation_ds_vertex_iterator_2<Tds> ::
|
||||
// operator*() const
|
||||
// {
|
||||
// CGAL_triangulation_assertion( pos != NULL);
|
||||
// if (pos == (Face*)1) {// only one vertex;
|
||||
// return *(_tds->infinite_vertex());
|
||||
// }
|
||||
// return *(pos->vertex(index));
|
||||
// }
|
||||
|
||||
template<class Tds>
|
||||
inline
|
||||
typename Tds::Vertex*
|
||||
Triangulation_ds_vertex_iterator_2<Tds> ::
|
||||
operator->() const
|
||||
{
|
||||
CGAL_triangulation_assertion( pos != NULL);
|
||||
if (pos == (Face*)1) {// only one vertex;
|
||||
return _tds->infinite_vertex();
|
||||
}
|
||||
return pos->vertex(index);
|
||||
}
|
||||
// template<class Tds>
|
||||
// inline
|
||||
// typename Tds::Vertex*
|
||||
// Triangulation_ds_vertex_iterator_2<Tds> ::
|
||||
// operator->() const
|
||||
// {
|
||||
// CGAL_triangulation_assertion( pos != NULL);
|
||||
// if (pos == (Face*)1) {// only one vertex;
|
||||
// return _tds->infinite_vertex();
|
||||
// }
|
||||
// return pos->vertex(index);
|
||||
// }
|
||||
|
||||
|
||||
// Edge iterator implementation
|
||||
|
|
@ -720,7 +749,7 @@ Triangulation_ds_edge_iterator_2<Tds> ::
|
|||
associated_edge()
|
||||
{
|
||||
if (_tds->dimension() == 1) {return true;}
|
||||
return less<const Face*>()(pos, pos->neighbor(index));
|
||||
return std::less<const Face*>()(pos, pos->neighbor(index));
|
||||
}
|
||||
|
||||
template<class Tds>
|
||||
|
|
@ -773,13 +802,13 @@ operator--(int)
|
|||
return tmp;
|
||||
}
|
||||
|
||||
template<class Tds>
|
||||
typename Tds::Edge
|
||||
Triangulation_ds_edge_iterator_2<Tds> ::
|
||||
operator*() const
|
||||
{
|
||||
return make_pair(const_cast<Face*>(pos), index);
|
||||
}
|
||||
// template<class Tds>
|
||||
// typename Tds::Edge
|
||||
// Triangulation_ds_edge_iterator_2<Tds> ::
|
||||
// operator*() const
|
||||
// {
|
||||
// return make_pair(const_cast<Face*>(pos), index);
|
||||
// }
|
||||
|
||||
|
||||
CGAL_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ incident_edges(const Face* f) const
|
|||
template <class Vb, class Fb >
|
||||
bool
|
||||
Triangulation_ds_vertex_2<Vb,Fb> ::
|
||||
is_valid(bool verbose = false, int level = 0) const
|
||||
is_valid(bool verbose, int level) const
|
||||
{
|
||||
bool result = Vb::is_valid(verbose, level);
|
||||
CGAL_triangulation_assertion(result);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ template < class R >
|
|||
class Triangulation_euclidean_traits_xy_3 {
|
||||
public:
|
||||
typedef Triangulation_euclidean_traits_xy_3<R> Traits;
|
||||
typedef R Rep;
|
||||
typedef R Rp;
|
||||
typedef Point_3<R> Point;
|
||||
typedef Segment_3<R> Segment;
|
||||
typedef Triangle_3<R> Triangle;
|
||||
|
|
@ -59,8 +59,8 @@ public:
|
|||
|
||||
|
||||
|
||||
typename Rep::FT x(const Point &p) const { return p.x(); }
|
||||
typename Rep::FT y(const Point &p) const { return p.y(); }
|
||||
typename Rp::FT x(const Point &p) const { return p.x(); }
|
||||
typename Rp::FT y(const Point &p) const { return p.y(); }
|
||||
|
||||
Comparison_result compare_x(const Point &p, const Point &q) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ template < class R >
|
|||
class Triangulation_euclidean_traits_xz_3 {
|
||||
public:
|
||||
typedef Triangulation_euclidean_traits_xz_3<R> Traits;
|
||||
typedef R Rep;
|
||||
typedef R Rp;
|
||||
typedef Point_3<R> Point;
|
||||
typedef Segment_3<R> Segment;
|
||||
typedef Triangle_3<R> Triangle;
|
||||
|
|
@ -56,8 +56,8 @@ public:
|
|||
Triangulation_euclidean_traits_xz_3 &operator=(
|
||||
const Triangulation_euclidean_traits_xz_3& et){return *this;}
|
||||
|
||||
typename Rep::FT x(const Point &p) const { return p.x(); }
|
||||
typename Rep::FT y(const Point &p) const { return p.z(); }
|
||||
typename Rp::FT x(const Point &p) const { return p.x(); }
|
||||
typename Rp::FT y(const Point &p) const { return p.z(); }
|
||||
|
||||
Comparison_result compare_x(const Point &p, const Point &q) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ template < class R >
|
|||
class Triangulation_euclidean_traits_yz_3 {
|
||||
public:
|
||||
typedef Triangulation_euclidean_traits_yz_3<R> Traits;
|
||||
typedef R Rep;
|
||||
typedef R Rp;
|
||||
typedef Point_3<R> Point;
|
||||
typedef Segment_3<R> Segment;
|
||||
typedef Triangle_3<R> Triangle;
|
||||
|
|
@ -53,8 +53,8 @@ public:
|
|||
Triangulation_euclidean_traits_yz_3 &operator=(
|
||||
const Triangulation_euclidean_traits_yz_3& et){return *this;}
|
||||
|
||||
typename Rep::FT x(const Point &p) const { return p.y(); }
|
||||
typename Rep::FT y(const Point &p) const { return p.z(); }
|
||||
typename Rp::FT x(const Point &p) const { return p.y(); }
|
||||
typename Rp::FT y(const Point &p) const { return p.z(); }
|
||||
|
||||
Comparison_result compare_x(const Point &p, const Point &q) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
istream &operator>>(istream &is, Triangulation_test_point &p)
|
||||
std::istream &operator>>(std::istream &is, Triangulation_test_point &p)
|
||||
{
|
||||
Triangulation_test_point::TESTFT x,y;
|
||||
is >> x >> y;
|
||||
|
|
|
|||
Loading…
Reference in New Issue