Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ code visualization

A sort of follow up/related question to this.

I'm trying to get a grip on a large code base that has hundreds and hundreds of classes and a large inheritance hierarchy. I want to be able to see the "main veins" of the inheritance hierarchy at a glance - not all the "peripheral" classes that only do some very specific / specialized thing. Visual Studio's "View Class Diagram" makes something that looks like a train and its sprawled horizontally across the screen and isn't very organized. You can't grok it easily.

I've just tried doxygen and graphviz but the results are .. somewhat similar to Visual Studio. I'm getting sweet looking call graphs but again too much detail for what I'm trying to get.

I need a quick way to generate the inheritance hierarchy, in some kind of collapsible view.

like image 385
bobobobo Avatar asked Aug 13 '09 11:08

bobobobo


4 Answers

Why not just do it manually, it is a great learning experience when starting to work with a large code base. I usually just look at what class inherits from what, and what class contain what instances, references or pointers to other classes. Have a piece of paper next to you and get drawing...

like image 128
navigator Avatar answered Oct 11 '22 11:10

navigator


Instead of going into the full Class Designer tool, just use the "Class View" or the "Object Browser" in Visual Studio - they present fully collapsible class heirarchies.

like image 26
Michael Burr Avatar answered Oct 11 '22 11:10

Michael Burr


A good UML tool should do the trick.

Here is a list of generic UMl tools: http://en.wikipedia.org/wiki/List_of_UML_tools

There are lots out there, all with varying feature sets. Try playing with a few to see if you get the output you desire. If they free ones fail you, you might have to shell out for a good commercial grade UML tool

like image 26
Fuzz Avatar answered Oct 11 '22 12:10

Fuzz


You can try CppDepend, it doesn't create a class hierarchy like Doxygen does but it can show 'the big picture' for your project, it also shows some code metrics.

like image 28
Serge Avatar answered Oct 11 '22 12:10

Serge