Doxygen: Graphs and diagrams (original) (raw)

Doxygen has built-in support to generate inheritance diagrams for C++ classes.

Doxygen can use the "dot" tool from graphviz to generate more advanced diagrams and graphs. Graphviz is an open-source, cross-platform graph drawing toolkit and can be found at https://www.graphviz.org/

If you have the "dot" tool in the PATH (environment variable), you can set HAVE_DOT to YES in the configuration file to let Doxygen use it.

Doxygen uses the "dot" tool to generate the following graphs:

Using a layout file you can determine which of the graphs are actually shown.

The options DOT_GRAPH_MAX_NODES and MAX_DOT_GRAPH_DEPTH can be used to limit the size of the various graphs.

The elements in the class diagrams in HTML and RTF have the following meaning:

The elements in the class diagram in {\LaTeX} have the following meaning:

The elements in the graphs generated by the dot tool have the following meaning:

The elements in the directory dependency graphs have the following meaning:

Here are a couple of header files that together show the various diagrams that Doxygen can generate:

diagrams_a.h

#ifndef DIAGRAMS_A_H

#define DIAGRAMS_A_H

class A { public: A *m_self; };

#endif

diagrams_b.h

#ifndef DIAGRAMS_B_H

#define DIAGRAMS_B_H

class A;

class B { public: A *m_a; };

#endif

diagrams_c.h

#ifndef DIAGRAMS_C_H

#define DIAGRAMS_C_H

#include "diagrams_c.h"

class D;

class C : public A { public: D *m_d; };

#endif

diagrams_d.h

#ifndef DIAGRAM_D_H

#define DIAGRAM_D_H

#include "diagrams_a.h"

#include "diagrams_b.h"

class C;

class D : virtual protected A, private B { public: C m_c; };

#endif

diagrams_e.h

#ifndef DIAGRAM_E_H

#define DIAGRAM_E_H

#include "diagrams_d.h"

class E : public D {};

#endif

Click herefor the corresponding HTML documentation that is generated by Doxygen. Note EXTRACT_ALL = YES is used to generate the diagrams.

Go to the next section or return to theindex.