6

With doxygen I can generate nice diagrams but doxygen lacks a deeper analysis of the relationships between classes. It recognizes derivation but other relations are not understood by the tool. Which better utilities are there (commercial or not) that generate more complete UML class diagrams out of C++ source files?

The tools available for C#/Java are a bit better but do not interest me right now.

durron597
  • 31,968
  • 17
  • 99
  • 158
jdehaan
  • 19,700
  • 6
  • 57
  • 97

4 Answers4

4

For parsing C++ code, the best tool I have used is BoUML. It is not perfect, and it won't generate the diagrams for you, but it does understand the relationships. If you pull two classes into a class diagram, it will automatically draw the relationships, and it allows you to grow the diagram by selecting a particular class and having the tool bring up related classes (both classes that depend on the selected one and classes that the selected one depends on).

David Rodríguez - dribeas
  • 204,818
  • 23
  • 294
  • 489
3

@jdehaan looks like lot of us are sailing in the same boat today ;)

codedrawer for C++(http://www.codedrawer.com/) is one such tool.

I will link to some started today that might interest you.

Qt Dependency Visualizer

Code refactoring

Community
  • 1
  • 1
Alok Save
  • 202,538
  • 53
  • 430
  • 533
3

It recognizes derivation but other relations are not understood by the tool.

Doxygen also supports generating collaboration diagrams which does provide an image for non-inheritance relations.

From the Doxygen manual:

COLLABORATION_GRAPH
If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen will generate a graph for each documented class showing the direct and indirect implementation dependencies (inheritance, containment, and class references variables) of the class with other documented classes.

I myself don't do anything fancy with UML, but these diagrams are good enough for my purposes (graphing inheritance and composition).

BradTrim
  • 56
  • 2
  • I am looking for a tool capable of understanding the code a bit deeper. Doxygen just displays what has to do with what (references, members) but not in which exact way. At least a good starter like you said. Thanks anyway. Maybe this helps others that missed this setting. – jdehaan Sep 24 '10 at 07:18
1

Enterprise Architect. Deeply analyzes the code, can generate diagrams from code, code from diagram, and support round-trip code generation which means modifying the generated diagram and saving the changes into source code. And it knows C, C++, C#, Java, Python, VB.NET & VB, PHP, Java, Delphi. Also, it support a whole bunch of diagram types including complete UML2.0 of course. (I don't know what it does in C :P)

Besides doing these stuff right, it does LOTS of other things, and I think it's really worth its price, which is 135-239 USD depending on the edition.

Tamás Szelei
  • 23,169
  • 18
  • 105
  • 180
  • The round tripping is working a bit weirdy but it's definitively a valuable tool. I'll dig a bit deeper into it. – jdehaan Sep 24 '10 at 07:15