Replace CGAL::Quadruple by boost::tuple.

This commit is contained in:
Sylvain Pion 2008-07-25 14:28:01 +00:00
parent 2bb1005c3c
commit a5f006da60
1 changed files with 16 additions and 16 deletions

View File

@ -26,8 +26,7 @@
#include <CGAL/Delaunay_triangulation_2.h> #include <CGAL/Delaunay_triangulation_2.h>
#include <queue> #include <queue>
#include <math.h> #include <cmath>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
@ -35,6 +34,8 @@
#include <CGAL/streamlines_assertions.h> #include <CGAL/streamlines_assertions.h>
#include <boost/tuple/tuple.hpp>
CGAL_BEGIN_NAMESPACE CGAL_BEGIN_NAMESPACE
template <class VectorField_2, class Integrator_2> template <class VectorField_2, class Integrator_2>
@ -57,8 +58,7 @@ protected:
typedef typename DT::Face_circulator Face_circulator; typedef typename DT::Face_circulator Face_circulator;
typedef typename DT::Edge_iterator Edge_iterator; typedef typename DT::Edge_iterator Edge_iterator;
typedef std::pair<Point_2,FT> Circle; typedef std::pair<Point_2,FT> Circle;
typedef typedef boost::tuple<Vertex_handle,Vertex_handle,Vertex_handle,Circle> Pq_element;
CGAL::Quadruple<Vertex_handle,Vertex_handle,Vertex_handle,Circle> Pq_element;
Pq_element Biggest_circle; Pq_element Biggest_circle;
FT distance(const Point_2 & p, const Point_2 & q) FT distance(const Point_2 & p, const Point_2 & q)
{ {
@ -87,7 +87,7 @@ protected:
bool operator()(const Pq_element &a1, const Pq_element bool operator()(const Pq_element &a1, const Pq_element
&a2) &a2)
{ {
return a1.fourth.second < a2.fourth.second ; return a1.get<3>().second < a2.get<3>().second ;
} }
}; };
std::priority_queue<Pq_element, std::vector<Pq_element>, C> pq; std::priority_queue<Pq_element, std::vector<Pq_element>, C> pq;
@ -676,10 +676,10 @@ pq_elements(const Vector_field_2 & vector_field_2, Vertex_container_2 stl_vertic
else else
{ {
Pq_next_r = m_Pq_element; Pq_next_r = m_Pq_element;
if (Pq_element_max_r.fourth.second <= Pq_next_r.fourth.second) if (Pq_element_max_r.get<3>().second <= Pq_next_r.get<3>().second)
Pq_element_max_r = Pq_next_r; Pq_element_max_r = Pq_next_r;
if ((Pq_current_r.fourth.second>=Pq_previous_r.fourth.second) if ((Pq_current_r.get<3>().second>=Pq_previous_r.get<3>().second)
&&(Pq_current_r.fourth.second>=Pq_next_r.fourth.second)) &&(Pq_current_r.get<3>().second>=Pq_next_r.get<3>().second))
{ {
pq.push(Pq_current_r); pq.push(Pq_current_r);
} }
@ -714,10 +714,10 @@ pq_elements(const Vector_field_2 & vector_field_2, Vertex_container_2 stl_vertic
else else
{ {
Pq_next_l = m_Pq_element; Pq_next_l = m_Pq_element;
if (Pq_element_max_l.fourth.second <= Pq_next_l.fourth.second) if (Pq_element_max_l.get<3>().second <= Pq_next_l.get<3>().second)
Pq_element_max_l = Pq_next_l; Pq_element_max_l = Pq_next_l;
if ((Pq_current_l.fourth.second>=Pq_previous_l.fourth.second) if ((Pq_current_l.get<3>().second>=Pq_previous_l.get<3>().second)
&&(Pq_current_l.fourth.second>=Pq_next_l.fourth.second)) &&(Pq_current_l.get<3>().second>=Pq_next_l.get<3>().second))
{ {
pq.push(Pq_current_l); pq.push(Pq_current_l);
} }
@ -773,14 +773,14 @@ Stream_lines_2<VectorField_2, Integrator_2>::get_next_seed_point(FT &
do{ do{
CGAL_assertion(!pq.empty()); CGAL_assertion(!pq.empty());
m_Pq_element = pq.top(); m_Pq_element = pq.top();
v0 = m_Pq_element.first; v0 = m_Pq_element.get<0>();
v1 = m_Pq_element.second; v1 = m_Pq_element.get<1>();
v2 = m_Pq_element.third; v2 = m_Pq_element.get<2>();
distance = m_Pq_element.fourth.second; distance = m_Pq_element.get<3>().second;
pq.pop(); pq.pop();
b0 = m_DT.is_face(v0,v1,v2,fr); b0 = m_DT.is_face(v0,v1,v2,fr);
if (b0){ if (b0){
seed_point_ = m_Pq_element.fourth.first;} seed_point_ = m_Pq_element.get<3>().first;}
b = (!pq.empty()); b = (!pq.empty());
}while ((b)&&(!b0)); }while ((b)&&(!b0));
Biggest_circle = m_Pq_element; Biggest_circle = m_Pq_element;