Boost logo

Boost Users :

From: Cyrille.Damez_at_[hidden]
Date: 2005-04-28 19:12:11


On Thursday 28 April 2005 20:01, Andreas Fabri wrote:
> Hello,
>
> Developping code so that BGL algorithms can run on the vertices and
> edges of CGAL triangulations, I am wondering if there are rules or
> recommendations for in which namespace the functions source, target,
> vertices, out_edges ... shall go.
>
> In boost, because it is boostish code, or in CGAL, because that is the
> namespace where the triangulation lives in?

I did something a bit similar last year (writting a wrapper to be able to
apply BGL's algorithms to the OpenMesh library). I put all the vertices,
edges, etc. classes and functions in boost namespace. As far as I understand,
that shouldn't cause too much problems, since all the types and functions I
added in there were template specializations. That looked like :

// The graph traits
struct graph_traits<MyMesh> {
    typedef MyMesh::FaceHandle vertex_descriptor;
    typedef MyMesh::EdgeHandle edge_descriptor;
    typedef IteratorWrapper<MyMesh::ConstFaceFaceIter> adjacency_iterator;
    typedef CircularIteratorWrapper out_edge_iterator;
// [...] etc
};

// Some functions specialization
graph_traits<MyMesh>::vertex_descriptor
target(graph_traits<MyMesh>::edge_descriptor e, const MyMesh& g)
{
...
}

etc.

Cheers


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net