BGL: half-edge-diagram or doubly-connected-edge-list

Hi group, I want to work with meshes that contain vertices, edges, and faces(1)(2). I've subclassed adjacency_list and added a std::vector to contain the face-data: http://pastebin.com/h4jxpDkt Is there a better solution? (somewhere in the BGL docs it says sublcassing BGL-graphs can be dangerous?) How do I provide a graph_traits::face_descriptor for my sublcass? (now I am using "unsigned int" for face descriptors) How do I allow choice between a vector and a list for storing the vertices? I have also made my first ever attempt (3) to write some template-based code which manipulates this graph class. That file has lots and lots of "typedef" "typename" and "graph_traits" in it. Are there some macros or tools to simplify this style of programming I should be aware of? thanks, Anders (1) http://en.wikipedia.org/wiki/Doubly-connected_edge_list (2) http://www.youtube.com/watch?v=5Rd-u5n0pQs (3) http://code.google.com/p/opencamlib/source/browse/trunk/src/algo/halfedgedia...

On Sat, 19 Feb 2011, Anders Wallin wrote:
Hi group, I want to work with meshes that contain vertices, edges, and faces(1)(2). I've subclassed adjacency_list and added a std::vector to contain the face-data: http://pastebin.com/h4jxpDkt
Is there a better solution? (somewhere in the BGL docs it says sublcassing BGL-graphs can be dangerous?) How do I provide a graph_traits::face_descriptor for my sublcass? (now I am using "unsigned int" for face descriptors) How do I allow choice between a vector and a list for storing the vertices?
I have also made my first ever attempt (3) to write some template-based code which manipulates this graph class. That file has lots and lots of "typedef" "typename" and "graph_traits" in it. Are there some macros or tools to simplify this style of programming I should be aware of?
Have you looked at CGAL (www.cgal.org)? They do many of the same things
with BGL that you want to do in terms of half-edges and such. In terms of
messy templated code, there is some stuff in
participants (2)
-
Anders Wallin
-
Jeremiah Willcock