mirror of https://github.com/CGAL/cgal
Merge pull request #6280 from sloriot/CH3-init_info
Fix info type and set default value
This commit is contained in:
commit
9bb36b0862
|
|
@ -23,17 +23,16 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template < typename Info_, typename GT,
|
template < typename GT,
|
||||||
typename Fb = Triangulation_ds_face_base_2< > >
|
typename Fb = Triangulation_ds_face_base_2< > >
|
||||||
class Convex_hull_face_base_2
|
class Convex_hull_face_base_2
|
||||||
: public Fb
|
: public Fb
|
||||||
{
|
{
|
||||||
Info_ _info;
|
int _info = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef typename Fb::Vertex_handle Vertex_handle;
|
typedef typename Fb::Vertex_handle Vertex_handle;
|
||||||
typedef typename Fb::Face_handle Face_handle;
|
typedef typename Fb::Face_handle Face_handle;
|
||||||
typedef Info_ Info;
|
|
||||||
|
|
||||||
typename std::list<Face_handle>::iterator it;
|
typename std::list<Face_handle>::iterator it;
|
||||||
std::list<typename GT::Point_3> points;
|
std::list<typename GT::Point_3> points;
|
||||||
|
|
@ -41,7 +40,7 @@ public:
|
||||||
template < typename TDS2 >
|
template < typename TDS2 >
|
||||||
struct Rebind_TDS {
|
struct Rebind_TDS {
|
||||||
typedef typename Fb::template Rebind_TDS<TDS2>::Other Fb2;
|
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()
|
Convex_hull_face_base_2()
|
||||||
|
|
@ -60,8 +59,8 @@ public:
|
||||||
Face_handle n2 )
|
Face_handle n2 )
|
||||||
: Fb(v0, v1, v2, n0, n1, n2), _info(0) {}
|
: Fb(v0, v1, v2, n0, n1, n2), _info(0) {}
|
||||||
|
|
||||||
const Info& info() const { return _info; }
|
const int& info() const { return _info; }
|
||||||
Info& info() { return _info; }
|
int& info() { return _info; }
|
||||||
|
|
||||||
static int ccw(int i) {return Triangulation_cw_ccw_2::ccw(i);}
|
static int ccw(int i) {return Triangulation_cw_ccw_2::ccw(i);}
|
||||||
static int cw(int i) {return Triangulation_cw_ccw_2::cw(i);}
|
static int cw(int i) {return Triangulation_cw_ccw_2::cw(i);}
|
||||||
|
|
|
||||||
|
|
@ -23,20 +23,19 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
template < typename Info_, typename GT,
|
template < typename GT,
|
||||||
typename Vb = Triangulation_ds_vertex_base_2< > >
|
typename Vb = Triangulation_ds_vertex_base_2< > >
|
||||||
class Convex_hull_vertex_base_2
|
class Convex_hull_vertex_base_2
|
||||||
: public Vb
|
: public Vb
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Info_ Info;
|
|
||||||
typedef typename GT::Point_2 Point;
|
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;
|
typedef typename Vb::Vertex_handle Vertex_handle;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Info _info;
|
int _info = 0;
|
||||||
Point _p;
|
Point _p;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -44,7 +43,7 @@ public:
|
||||||
struct Rebind_TDS
|
struct Rebind_TDS
|
||||||
{
|
{
|
||||||
typedef typename Vb::template Rebind_TDS<TDS2>::Other Vb2;
|
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()
|
Convex_hull_vertex_base_2()
|
||||||
|
|
@ -63,8 +62,8 @@ public:
|
||||||
const Point& point() const { return _p; }
|
const Point& point() const { return _p; }
|
||||||
Point& point() { return _p; }
|
Point& point() { return _p; }
|
||||||
|
|
||||||
const Info& info() const { return _info; }
|
const int& info() const { return _info; }
|
||||||
Info& info() { return _info; }
|
int& info() { return _info; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename GT, typename Vb>
|
template <typename GT, typename Vb>
|
||||||
|
|
|
||||||
|
|
@ -703,7 +703,6 @@ ch_quickhull_3_scan(TDS_2& tds,
|
||||||
}
|
}
|
||||||
Vertex_handle vh = tds.star_hole(edges.begin(), edges.end(), visible_set.begin(), visible_set.end());
|
Vertex_handle vh = tds.star_hole(edges.begin(), edges.end(), visible_set.begin(), visible_set.end());
|
||||||
vh->point() = farthest_pt;
|
vh->point() = farthest_pt;
|
||||||
vh->info() = 0;
|
|
||||||
|
|
||||||
// now partition the set of outside set points among the new facets.
|
// now partition the set of outside set points among the new facets.
|
||||||
|
|
||||||
|
|
@ -775,8 +774,8 @@ ch_quickhull_face_graph(std::list<typename Traits::Point_3>& points,
|
||||||
typedef typename std::list<Point_3>::iterator P3_iterator;
|
typedef typename std::list<Point_3>::iterator P3_iterator;
|
||||||
|
|
||||||
typedef Triangulation_data_structure_2<
|
typedef Triangulation_data_structure_2<
|
||||||
Convex_hull_vertex_base_2<int, GT3_for_CH3<Traits> >,
|
Convex_hull_vertex_base_2<GT3_for_CH3<Traits> >,
|
||||||
Convex_hull_face_base_2<int, Traits> > Tds;
|
Convex_hull_face_base_2<Traits> > Tds;
|
||||||
|
|
||||||
typedef typename Tds::Vertex_handle Vertex_handle;
|
typedef typename Tds::Vertex_handle Vertex_handle;
|
||||||
typedef typename Tds::Face_handle Face_handle;
|
typedef typename Tds::Face_handle Face_handle;
|
||||||
|
|
@ -822,7 +821,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 v2 = tds.create_vertex(); v2->set_point(*point3_it);
|
||||||
Vertex_handle v3 = tds.create_vertex(); v3->set_point(*max_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 f0 = tds.create_face(v0,v1,v2);
|
||||||
Face_handle f1 = tds.create_face(v3,v1,v0);
|
Face_handle f1 = tds.create_face(v3,v1,v0);
|
||||||
Face_handle f2 = tds.create_face(v3,v2,v1);
|
Face_handle f2 = tds.create_face(v3,v2,v1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue