Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Doxygen show diamond inheritance graphs

Doxygen has a really neat feature whereby it will generate inheritance graphs from code. However, when using multiple inheritance from classes with a common base, the plot shows two separate base classes (even though I'm using virtual inheritance as signified by the dashed lines around the base class)

enter image description here

How can I make Doxygen plot something more like the following . . .

     D
    / \
   B   C
    \ /
     A

And not: (as happens without virtual inheritance)

     D
   /   \
   B   C
   |   |
   A   A
like image 731
learnvst Avatar asked May 22 '14 17:05

learnvst


People also ask

Can Doxygen generate class diagram?

Doxygen Manual: Graphs and diagrams. Doxygen has built-in support to generate inheritance diagrams for C++ classes.

How can we solve diamond problem in inheritance?

The solution to the diamond problem is to use the virtual keyword. We make the two parent classes (who inherit from the same grandparent class) into virtual classes in order to avoid two copies of the grandparent class in the child class.

How do you create a dependency graph in Doxygen?

Make sure the following options are set in the Doxywizard dialog: In Wizard tab, under Output, select HTML output. In Wizard tab, under Diagrams, choose the option Use dot tool from the GraphViz package. Select the following two options below it: Include dependency graphs and Included by dependency graphs.

How do you create a call graph in Doxygen?

You have to set HAVE_DOT , CALL_GRAPH and CALLER_GRAPH to YES . Also make sure the path to dot is in your PATH variable. If that still doesn't work, you might have to set EXTRACT_ALL and/or EXTRACT_STATIC , depending on your functions. Apologies, I do have HAVE_DOT, CALL_GRAPH, and CALLER_GRAPH set to YES.


1 Answers

If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is available from the path. This tool is part of Graphviz (see: http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent Bell Labs. The other options in this section have no effect if this option is set to NO The default value is: NO.

Set to

HAVE_DOT = YES

like image 102
oukore Avatar answered Sep 27 '22 22:09

oukore