Graphviz and Doxygen

About once a week or so I run my entire GL Engine project through the Doxygen documentation generator to check that I haven’t missed any documentation and get an idea of how my project is shaping up. There’s an option to use a package called Graphviz for the inheritance/file graph documentation, although up until today I’d never paid much attention to it. On today’s doc run I decided to install it and see what it could do. It turns out it can do a lot.

Graphviz generates all of the inheritance diagrams in the same way as Doxygen’s internal tools, but with a bit more style. Example from GLVertexBuffer:

One of the cool features exclusively supported by Graphviz is the “Collaboration Diagram”, which essentially shows all of the classes that are involved with a particular class. This includes the inheritance tree, and any members that are also instances of classes included in the project. A simple case is the VertexPNT class:

Purple arrows mean “has a member variable of type”, while blue arrows show inheritance. A more complex one for the SkyObject class:

Another feature of Graphviz that I can see myself using very often during development is the file linkage tree, which shows which shows how files are related to each other through #includes. Here’s one for my Vector3F class:

Click for bigger, although be warned that it’s over 4,000 pixels wide. 😉

There are also a few other useful features, such as call/caller graphs for each method. I’m definitely going to be checking “Yes” on all of these options on my subsequent doc generations. I can already think of a few cases where they’ll helpful for development. Ensuring that all code only references the platform agnostic classes, e.g. VertexBuffers instead of GLVertexBuffers, is a big one for me. And of course, at the very least they’re pretty cool to look at.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: