Boost logo

Boost Users :

From: Stephen torri (storri_at_[hidden])
Date: 2004-11-08 20:43:36


On Mon, 2004-11-08 at 15:17, Jeffrey Holle wrote:
> I believe you need to use boost::make_label_writer.
> Here is how I use it to place information from an external property map:
>
> ofstream os("workFlow.dot");
> write_graphviz(os,workFlowGraph_,make_label_writer(workFlowVertexLabeler(workFlowGraph_)));
>
> Where workFlowVertexLabeler is:
>
> struct workFlowVertexLabeler
> {
> workFlowVertexLabeler(WorkFlowGraph& workFlowGraph) :
> workFlowGraph_(workFlowGraph) {}
> std::string operator[](const WorkFlowVertex& v) const
> {
> return workFlowGraph_.getWorkFlowData()[v].getLabel();
> }
> private:
> WorkFlowGraph& workFlowGraph_;

Your solution words when modified for my situation (data structure). The
problem with the edge labelling still remains. I see a problem with the
loop in graphviz.hpp that prints out the edges:

    typename graph_traits<Graph>::edge_iterator ei, edge_end;
    for(tie(ei, edge_end) = edges(g); ei != edge_end; ++ei) {
      out << source(*ei, g) << Traits::delimiter() << target(*ei, g) <<
" ";
      epw(out, *ei); //print edge attributes
      out << ";" << std::endl;
    }

There is no operator<< function for graph_traits so the memory location
of the vertex_descriptor that is returned is printed instead of the
vertex_index_t value used to name the nodes above. I don't see why this
does not work as the documentation example.

Stephen

-- 
Email: storri_at_[hidden]

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