mirror of https://github.com/CGAL/cgal
Merge pull request #918 from afabri/HDS-hash-GF
Add hash_value for edge_descriptor of HDS
This commit is contained in:
commit
fceba01368
|
|
@ -135,6 +135,10 @@ struct HDS_edge {
|
|||
HDS_edge
|
||||
opposite_prev() { return HDS_edge(halfedge_->opposite()->prev()); }
|
||||
|
||||
friend std::size_t hash_value(const HDS_edge& i)
|
||||
{
|
||||
return hash_value(i.halfedge());
|
||||
}
|
||||
|
||||
private:
|
||||
Halfedge_handle halfedge_;
|
||||
|
|
@ -235,7 +239,6 @@ namespace std {
|
|||
struct hash<CGAL::internal::HDS_edge<H> > {
|
||||
std::size_t operator()(const CGAL::internal::HDS_edge<H>& e) const
|
||||
{
|
||||
std::cerr << "HDS_edge HashFct" << std::endl;
|
||||
std::hash<H> fct;
|
||||
return fct(e.halfedge());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,18 +32,16 @@ typedef CGAL::Delaunay_triangulation_3<Kernel, Tds> Triangulation_3;
|
|||
typedef CGAL::Linear_cell_complex<3, 3> Linear_cell_complex_3;
|
||||
|
||||
|
||||
template <typename P>
|
||||
template <typename P,typename Descriptor>
|
||||
void
|
||||
fct(const P& )
|
||||
{
|
||||
typedef typename boost::graph_traits<P>::vertex_descriptor vertex_descriptor;
|
||||
std::map<Descriptor,int> M;
|
||||
Descriptor d;
|
||||
M.find(d);
|
||||
|
||||
std::map<vertex_descriptor,int> M;
|
||||
vertex_descriptor vd;
|
||||
M.find(vd);
|
||||
|
||||
boost::unordered_map<vertex_descriptor, int> U;
|
||||
U[vd] = 12;
|
||||
boost::unordered_map<Descriptor, int> U;
|
||||
U[d] = 12;
|
||||
}
|
||||
|
||||
void fct2()
|
||||
|
|
@ -82,19 +80,30 @@ fct3(const P& )
|
|||
U[vd] = 12;
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void
|
||||
fct4(const P& p)
|
||||
{
|
||||
fct<P, typename boost::graph_traits<P>::vertex_descriptor>(p);
|
||||
fct<P, typename boost::graph_traits<P>::halfedge_descriptor>(p);
|
||||
fct<P, typename boost::graph_traits<P>::edge_descriptor>(p);
|
||||
fct<P, typename boost::graph_traits<P>::face_descriptor>(p);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
Arrangement_2 A;
|
||||
fct(A);
|
||||
fct<Arrangement_2, boost::graph_traits<Arrangement_2>::vertex_descriptor>(A);
|
||||
fct<Arrangement_2, boost::graph_traits<Arrangement_2>::edge_descriptor>(A);
|
||||
|
||||
Polyhedron P;
|
||||
fct(P);
|
||||
fct4(P);
|
||||
|
||||
Surface_mesh S;
|
||||
fct(S);
|
||||
fct4(S);
|
||||
|
||||
Triangulation_2 T;
|
||||
fct(T);
|
||||
fct4(T);
|
||||
|
||||
fct2();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue