fix info type and set default value

This commit is contained in:
Sébastien Loriot 2022-01-26 19:07:34 +01:00
parent 9eee1f19cb
commit 9ecb90c315
3 changed files with 13 additions and 17 deletions

View File

@ -23,17 +23,16 @@
namespace CGAL {
template < typename Info_, typename GT,
template < typename GT,
typename Fb = Triangulation_ds_face_base_2< > >
class Convex_hull_face_base_2
: public Fb
{
Info_ _info;
int _info = 0;
public:
typedef typename Fb::Vertex_handle Vertex_handle;
typedef typename Fb::Face_handle Face_handle;
typedef Info_ Info;
typename std::list<Face_handle>::iterator it;
std::list<typename GT::Point_3> points;
@ -41,7 +40,7 @@ public:
template < typename TDS2 >
struct Rebind_TDS {
typedef typename Fb::template Rebind_TDS<TDS2>::Other Fb2;
typedef Convex_hull_face_base_2<Info, GT, Fb2> Other;
typedef Convex_hull_face_base_2<GT, Fb2> Other;
};
Convex_hull_face_base_2()
@ -60,8 +59,8 @@ public:
Face_handle n2 )
: Fb(v0, v1, v2, n0, n1, n2), _info(0) {}
const Info& info() const { return _info; }
Info& info() { return _info; }
const int& info() const { return _info; }
int& info() { return _info; }
static int ccw(int i) {return Triangulation_cw_ccw_2::ccw(i);}
static int cw(int i) {return Triangulation_cw_ccw_2::cw(i);}

View File

@ -23,20 +23,19 @@
namespace CGAL {
template < typename Info_, typename GT,
template < typename GT,
typename Vb = Triangulation_ds_vertex_base_2< > >
class Convex_hull_vertex_base_2
: public Vb
{
public:
typedef Info_ Info;
typedef typename GT::Point_2 Point;
typedef typename Vb::Face_handle Face_handle;
typedef typename Vb::Face_handle Face_handle;
typedef typename Vb::Vertex_handle Vertex_handle;
private:
Info _info;
int _info = 0;
Point _p;
public:
@ -44,7 +43,7 @@ public:
struct Rebind_TDS
{
typedef typename Vb::template Rebind_TDS<TDS2>::Other Vb2;
typedef Convex_hull_vertex_base_2<Info, GT, Vb2> Other;
typedef Convex_hull_vertex_base_2<GT, Vb2> Other;
};
Convex_hull_vertex_base_2()
@ -63,8 +62,8 @@ public:
const Point& point() const { return _p; }
Point& point() { return _p; }
const Info& info() const { return _info; }
Info& info() { return _info; }
const int& info() const { return _info; }
int& info() { return _info; }
};
template <typename GT, typename Vb>

View File

@ -702,7 +702,6 @@ ch_quickhull_3_scan(TDS_2& tds,
}
Vertex_handle vh = tds.star_hole(edges.begin(), edges.end(), visible_set.begin(), visible_set.end());
vh->point() = farthest_pt;
vh->info() = 0;
// now partition the set of outside set points among the new facets.
@ -774,8 +773,8 @@ ch_quickhull_face_graph(std::list<typename Traits::Point_3>& points,
typedef typename std::list<Point_3>::iterator P3_iterator;
typedef Triangulation_data_structure_2<
Convex_hull_vertex_base_2<int, GT3_for_CH3<Traits> >,
Convex_hull_face_base_2<int, Traits> > Tds;
Convex_hull_vertex_base_2<GT3_for_CH3<Traits> >,
Convex_hull_face_base_2<Traits> > Tds;
typedef typename Tds::Vertex_handle Vertex_handle;
typedef typename Tds::Face_handle Face_handle;
@ -821,7 +820,6 @@ ch_quickhull_face_graph(std::list<typename Traits::Point_3>& points,
Vertex_handle v2 = tds.create_vertex(); v2->set_point(*point3_it);
Vertex_handle v3 = tds.create_vertex(); v3->set_point(*max_it);
v0->info() = v1->info() = v2->info() = v3->info() = 0;
Face_handle f0 = tds.create_face(v0,v1,v2);
Face_handle f1 = tds.create_face(v3,v1,v0);
Face_handle f2 = tds.create_face(v3,v2,v1);