minor fixes

This commit is contained in:
Fernando Cacciola 2006-08-30 13:07:00 +00:00
parent 45a676fe4f
commit 3b37d88038
4 changed files with 95 additions and 97 deletions

View File

@ -212,9 +212,9 @@ public:
template < class HDS > template < class HDS >
class HDS_all_halfedges_iterator class HDS_all_halfedges_iterator
: public HDS_all_edges_iterator_base<HDS,typename HDS::Halfdge_iterator,typename HDS::Halfedge_handle> : public HDS_all_edges_iterator_base<HDS,typename HDS::Halfedge_iterator,typename HDS::Halfedge_handle>
{ {
typedef HDS_all_edges_iterator_base<HDS,typename HDS::Halfdge_iterator,typename HDS::Halfedge_handle> Base ; typedef HDS_all_edges_iterator_base<HDS,typename HDS::Halfedge_iterator,typename HDS::Halfedge_handle> Base ;
public: public:

View File

@ -32,7 +32,6 @@
namespace boost namespace boost
{ {
template<class T> struct undirected_graph_traits ;
// //
// Const versions // Const versions
// //
@ -42,11 +41,6 @@ struct graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> const >
: CGAL::HDS_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> const> : CGAL::HDS_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> const>
{}; {};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct undirected_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> const >
: CGAL::HDS_undirected_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> const>
{};
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >::vertices_size_type typename graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >::vertices_size_type
num_vertices(const CGAL::Polyhedron_3<Gt,I,HDS,A>& p) num_vertices(const CGAL::Polyhedron_3<Gt,I,HDS,A>& p)
@ -149,10 +143,6 @@ struct graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >
: CGAL::HDS_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> > : CGAL::HDS_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >
{}; {};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct undirected_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >
: CGAL::HDS_undirected_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >
{};
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
typename graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >::vertex_descriptor typename graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >::vertex_descriptor

View File

@ -30,16 +30,8 @@
CGAL_BEGIN_NAMESPACE CGAL_BEGIN_NAMESPACE
template<class Polyhedron> struct External_polyhedron_access_vertex_ID ;
template<class Polyhedron> struct External_polyhedron_access_edge_ID ;
CGAL_END_NAMESPACE
namespace boost
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
class Polyhedron_edge_weight_map : public put_get_helper<double, Polyhedron_edge_weight_map<Gt, I, HDS, A> > class Polyhedron_edge_weight_map : public boost::put_get_helper<double, Polyhedron_edge_weight_map<Gt, I, HDS, A> >
{ {
private: private:
@ -47,10 +39,10 @@ private:
public: public:
typedef readable_property_map_tag category; typedef boost::readable_property_map_tag category;
typedef double value_type; typedef double value_type;
typedef double reference; typedef double reference;
typedef typename graph_traits<Polyhedron const>::edge_descriptor key_type; typedef typename boost::graph_traits<Polyhedron const>::edge_descriptor key_type;
Polyhedron_edge_weight_map( Polyhedron const& p_) {} Polyhedron_edge_weight_map( Polyhedron const& p_) {}
@ -61,7 +53,7 @@ public:
}; };
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
class Polyhedron_edge_is_border_map : public put_get_helper<bool, Polyhedron_edge_is_border_map<Gt, I, HDS, A> > class Polyhedron_edge_is_border_map : public boost::put_get_helper<bool, Polyhedron_edge_is_border_map<Gt, I, HDS, A> >
{ {
private: private:
@ -69,10 +61,10 @@ private:
public: public:
typedef readable_property_map_tag category; typedef boost::readable_property_map_tag category;
typedef bool value_type; typedef bool value_type;
typedef bool reference; typedef bool reference;
typedef typename graph_traits<Polyhedron const>::edge_descriptor key_type; typedef typename boost::graph_traits<Polyhedron const>::edge_descriptor key_type;
Polyhedron_edge_is_border_map( Polyhedron const& p_) {} Polyhedron_edge_is_border_map( Polyhedron const& p_) {}
@ -83,7 +75,7 @@ public:
}; };
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
class Polyhedron_vertex_is_border_map : public put_get_helper<bool, Polyhedron_vertex_is_border_map<Gt, I, HDS, A> > class Polyhedron_vertex_is_border_map : public boost::put_get_helper<bool, Polyhedron_vertex_is_border_map<Gt, I, HDS, A> >
{ {
private: private:
@ -91,10 +83,10 @@ private:
public: public:
typedef readable_property_map_tag category; typedef boost::readable_property_map_tag category;
typedef bool value_type; typedef bool value_type;
typedef bool reference; typedef bool reference;
typedef typename graph_traits<Polyhedron const>::vertex_descriptor key_type; typedef typename boost::graph_traits<Polyhedron const>::vertex_descriptor key_type;
Polyhedron_vertex_is_border_map( Polyhedron const& p_) {} Polyhedron_vertex_is_border_map( Polyhedron const& p_) {}
@ -116,7 +108,7 @@ public:
}; };
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
class Polyhedron_vertex_point_map : public put_get_helper< typename Gt::Point_3&, Polyhedron_vertex_point_map<Gt, I, HDS, A> > class Polyhedron_vertex_point_map : public boost::put_get_helper< typename Gt::Point_3&, Polyhedron_vertex_point_map<Gt, I, HDS, A> >
{ {
private: private:
@ -126,10 +118,10 @@ public:
typedef typename Gt::Point_3 Point_3 ; typedef typename Gt::Point_3 Point_3 ;
typedef lvalue_property_map_tag category; typedef boost::lvalue_property_map_tag category;
typedef Point_3 value_type; typedef Point_3 value_type;
typedef Point_3& reference; typedef Point_3& reference;
typedef typename graph_traits<Polyhedron>::vertex_descriptor key_type; typedef typename boost::graph_traits<Polyhedron>::vertex_descriptor key_type;
Polyhedron_vertex_point_map( Polyhedron& p_) {} Polyhedron_vertex_point_map( Polyhedron& p_) {}
@ -140,7 +132,7 @@ public:
}; };
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
class Polyhedron_vertex_point_const_map : public put_get_helper< typename Gt::Point_3 const& class Polyhedron_vertex_point_const_map : public boost::put_get_helper< typename Gt::Point_3 const&
, Polyhedron_vertex_point_const_map<Gt, I, HDS, A> , Polyhedron_vertex_point_const_map<Gt, I, HDS, A>
> >
{ {
@ -152,10 +144,10 @@ public:
typedef typename Gt::Point_3 Point_3 ; typedef typename Gt::Point_3 Point_3 ;
typedef readable_property_map_tag category; typedef boost::readable_property_map_tag category;
typedef Point_3 value_type; typedef Point_3 value_type;
typedef Point_3 const& reference; typedef Point_3 const& reference;
typedef typename graph_traits<Polyhedron const>::vertex_descriptor key_type; typedef typename boost::graph_traits<Polyhedron const>::vertex_descriptor key_type;
Polyhedron_vertex_point_const_map( Polyhedron const& p_) {} Polyhedron_vertex_point_const_map( Polyhedron const& p_) {}
@ -169,51 +161,11 @@ struct edge_is_border_t {} ;
struct vertex_is_border_t {} ; struct vertex_is_border_t {} ;
struct vertex_point_t {} ; struct vertex_point_t {} ;
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
Polyhedron_edge_weight_map<Gt,I,HDS,A> get(edge_weight_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
Polyhedron_edge_weight_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
Polyhedron_edge_is_border_map<Gt,I,HDS,A> get(edge_is_border_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
Polyhedron_edge_is_border_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
Polyhedron_vertex_is_border_map<Gt,I,HDS,A> get(vertex_is_border_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
Polyhedron_vertex_is_border_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
Polyhedron_vertex_point_map<Gt,I,HDS,A> get(vertex_point_t, CGAL::Polyhedron_3<Gt,I,HDS,A>& p)
{
Polyhedron_vertex_point_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
Polyhedron_vertex_point_const_map<Gt,I,HDS,A> get(vertex_point_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
Polyhedron_vertex_point_const_map<Gt,I,HDS,A> m(p);
return m;
}
template <class Tag> template <class Tag>
struct Polyhedron_property_map {}; struct Polyhedron_property_map {};
template <> template <>
struct Polyhedron_property_map<edge_weight_t> struct Polyhedron_property_map<boost::edge_weight_t>
{ {
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct bind_ struct bind_
@ -256,11 +208,56 @@ struct Polyhedron_property_map<vertex_point_t>
}; };
}; };
// g++ 'enumeral_type' in template unification not implemented workaround CGAL_END_NAMESPACE
namespace boost
{
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
CGAL::Polyhedron_edge_weight_map<Gt,I,HDS,A> get( edge_weight_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
CGAL::Polyhedron_edge_weight_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
CGAL::Polyhedron_edge_is_border_map<Gt,I,HDS,A> get( CGAL::edge_is_border_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
CGAL::Polyhedron_edge_is_border_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
CGAL::Polyhedron_vertex_is_border_map<Gt,I,HDS,A> get(CGAL::vertex_is_border_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
CGAL::Polyhedron_vertex_is_border_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
CGAL::Polyhedron_vertex_point_map<Gt,I,HDS,A> get(CGAL::vertex_point_t, CGAL::Polyhedron_3<Gt,I,HDS,A>& p)
{
CGAL::Polyhedron_vertex_point_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline
CGAL::Polyhedron_vertex_point_const_map<Gt,I,HDS,A> get(CGAL::vertex_point_t, CGAL::Polyhedron_3<Gt,I,HDS,A> const& p)
{
CGAL::Polyhedron_vertex_point_const_map<Gt,I,HDS,A> m(p);
return m;
}
template<class Gt, class I, CGAL_HDS_PARAM_, class A, class Tag> template<class Gt, class I, CGAL_HDS_PARAM_, class A, class Tag>
struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, Tag> struct property_map<CGAL::Polyhedron_3<Gt,I,HDS,A>, Tag>
{ {
typedef typename Polyhedron_property_map<Tag>::template bind_<Gt,I,HDS,A> map_gen; typedef typename CGAL::Polyhedron_property_map<Tag>::template bind_<Gt,I,HDS,A> map_gen;
typedef typename map_gen::type type; typedef typename map_gen::type type;
typedef typename map_gen::const_type const_type; typedef typename map_gen::const_type const_type;
}; };
@ -301,7 +298,7 @@ struct edge_property_type<CGAL::Polyhedron_3<Gt,I,HDS,A> >
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct vertex_property_type<CGAL::Polyhedron_3<Gt,I,HDS,A> > struct vertex_property_type<CGAL::Polyhedron_3<Gt,I,HDS,A> >
{ {
typedef vertex_point_t type; typedef CGAL::vertex_point_t type;
}; };
} // namespace boost } // namespace boost

View File

@ -22,6 +22,7 @@
#include <CGAL/HalfedgeDS_items_decorator.h> #include <CGAL/HalfedgeDS_items_decorator.h>
#include <CGAL/boost/graph/Polyhedron_BGL.h> #include <CGAL/boost/graph/Polyhedron_BGL.h>
#include <CGAL/boost/graph/Extended_BGL.h>
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM #ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
# define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS # define CGAL_HDS_PARAM_ template < class Traits, class Items, class Alloc> class HDS
@ -41,14 +42,19 @@ num_undirected_edges(const Polyhedron_3<Gt,I,HDS,A>& p)
// //
// Const versions // Const versions
// //
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
struct undirected_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> const >
: CGAL::HDS_undirected_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> const>
{};
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline std::pair<typename boost::undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> const>::edge_iterator inline std::pair<typename undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> const>::edge_iterator
,typename boost::undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> const>::edge_iterator ,typename undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> const>::edge_iterator
> >
undirected_edges( Polyhedron_3<Gt,I,HDS,A> const& p ) undirected_edges( Polyhedron_3<Gt,I,HDS,A> const& p )
{ {
typedef typename boost::undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> const>::edge_iterator Iter; typedef typename undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> const>::edge_iterator Iter;
return std::make_pair( Iter(p.edges_begin()), Iter(p.edges_end()) ); return std::make_pair( Iter(p.edges_begin()), Iter(p.edges_end()) );
} }
@ -124,12 +130,17 @@ in_edge( typename boost::graph_traits< Polyhedron_3<Gt,I,HDS,A> const>::vertex_d
// //
template<class Gt, class I, CGAL_HDS_PARAM_, class A> template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline std::pair<typename boost::undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> >::edge_iterator struct undirected_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >
,typename boost::undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> >::edge_iterator : CGAL::HDS_undirected_graph_traits< CGAL::Polyhedron_3<Gt,I,HDS,A> >
{};
template<class Gt, class I, CGAL_HDS_PARAM_, class A>
inline std::pair<typename undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> >::edge_iterator
,typename undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> >::edge_iterator
> >
undirected_edges( Polyhedron_3<Gt,I,HDS,A>& p ) undirected_edges( Polyhedron_3<Gt,I,HDS,A>& p )
{ {
typedef typename boost::undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> >::edge_iterator Iter; typedef typename undirected_graph_traits< Polyhedron_3<Gt,I,HDS,A> >::edge_iterator Iter;
return std::make_pair( Iter(p.edges_begin()), Iter(p.edges_end()) ); return std::make_pair( Iter(p.edges_begin()), Iter(p.edges_end()) );
} }