[bgl] user defined vertex_descriptor?

hi all, i'm curious, if it's possible to change the type, that a graph uses as vertex_descriptor... i went through the examples, where usually int values are used, which seems to be the default ... for my application, i'd like to use a class pointer as vertex_descriptor, though... the problem i had with property map is, that i was only able to look up a property by vertex_descriptor, but not the other way round... it's possibly only a problem caused by my limited knowledge of the bgl, but it would be very nice, if someone could enlighten me. thanks in advance ... tim -- View this message in context: http://www.nabble.com/-bgl--user-defined-vertex_descriptor--tf2008709.html#a... Sent from the Boost - Users forum at Nabble.com.

On Jul 27, 2006, at 6:01 AM, timblech wrote:
i'm curious, if it's possible to change the type, that a graph uses as vertex_descriptor... i went through the examples, where usually int values are used, which seems to be the default ... for my application, i'd like to use a class pointer as vertex_descriptor, though...
The BGL graph types don't let you change the type of vertex_descriptor, but you can add extra properties to the vertices of the graph (which can include your own class).
the problem i had with property map is, that i was only able to look up a property by vertex_descriptor, but not the other way round...
Right. You could store a copy of the vertex descriptor in the property itself. adjacency_list_traits allows you to determine what the descriptor type will be, before instantiating the graph. Doug
participants (2)
-
Doug Gregor
-
timblech