1 /******************************************************************************
5 * Copyright (C) 1997-2015 by Dimitri van Heesch.
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
17 /*! \page diagrams Graphs and diagrams
19 Doxygen has built-in support to generate inheritance diagrams for C++
22 Doxygen can use the "dot" tool from graphviz to generate
23 more advanced diagrams and graphs. Graphviz is an open-source,
24 cross-platform graph drawing toolkit and can be found
25 at http://www.graphviz.org/
27 If you have the "dot" tool in the path, you can set
28 \ref cfg_have_dot "HAVE_DOT" to \c YES in the configuration file to
31 Doxygen uses the "dot" tool to generate the following graphs:
33 <li>A graphical representation of the class hierarchy will be drawn, along
34 with the textual one. Currently this feature is supported for HTML only.\n
35 <b>Warning:</b> When you have a very large class hierarchy where many
36 classes derive from a common base class, the resulting image may become
37 too big to handle for some browsers.
38 <li>An inheritance graph will be generated for each documented class showing the
39 direct and indirect inheritance relations. This disables the
40 generation of the built-in class inheritance diagrams.
41 <li>An include dependency graph is generated for each documented file that
42 includes at least one other file. This feature is currently supported
43 for HTML and RTF only.
44 <li>An inverse include dependency graph is also generated showing for
45 a (header) file, which other files include it.
46 <li>A graph is drawn for each documented class and struct that shows:
48 <li> the inheritance relations with base classes.
49 <li> the usage relations with other structs and classes (e.g.
50 class \c A has a member variable \c m_a of type class \c B, then
51 \c A has an arrow to \c B with \c m_a as label).
53 <li>if \ref cfg_call_graph "CALL_GRAPH" is set to YES, a
54 graphical call graph is drawn for each function showing the
55 functions that the function directly or indirectly calls
56 (see also section \ref cmdcallgraph "\\callgraph" and
57 section \ref cmdhidecallgraph "\\hidecallgraph").
58 <li>if \ref cfg_caller_graph "CALLER_GRAPH" is set to YES, a
59 graphical caller graph is drawn for each function showing the
60 functions that the function is directly or indirectly called by
61 (see also section \ref cmdcallergraph "\\callergraph" and
62 section \ref cmdhidecallergraph "\\hidecallergraph").
65 Using a \ref customize "layout file" you can determine which of the
66 graphs are actually shown.
68 The options \ref cfg_dot_graph_max_nodes "DOT_GRAPH_MAX_NODES" and
69 \ref cfg_max_dot_graph_depth "MAX_DOT_GRAPH_DEPTH" can be used to
70 limit the size of the various graphs.
72 The elements in the class diagrams in HTML and RTF
73 have the following meaning:
75 <li> A \b yellow box indicates a class. A box can have a
76 little marker in the lower right corner to indicate that the class
77 contains base classes that are hidden.
78 For the class diagrams the maximum tree width is currently 8 elements.
79 If a tree is wider some nodes will be hidden.
80 If the box is filled with a
81 dashed pattern the inheritance relation is virtual.
82 <li> A \b white box indicates that the documentation of the class
84 <li> A \b gray box indicates an undocumented class.
85 <li> A <b>solid dark blue</b> arrow indicates public inheritance.
86 <li> A <b>dashed dark green</b> arrow indicates protected inheritance.
87 <li> A <b>dotted dark green</b> arrow indicates private inheritance.
90 The elements in the class diagram in \LaTeX have the
93 <li> A \b white box indicates a class.
94 A \b marker in the lower right corner of the box indicates that the
95 class has base classes that are hidden.
96 If the box has a \b dashed border this indicates virtual inheritance.
97 <li> A \b solid arrow indicates public inheritance.
98 <li> A \b dashed arrow indicates protected inheritance.
99 <li> A \b dotted arrow indicates private inheritance.
102 The elements in the graphs generated by the dot tool have the following
105 <li> A \b white box indicates a class or struct or file.
106 <li> A box with a \b red border indicates a node that has
107 \e more arrows than are shown!
108 In other words: the graph is \e truncated with respect to this node.
109 The reason why a graph is sometimes truncated is to prevent images
110 from becoming too large.
111 For the graphs generated with dot doxygen tries
112 to limit the width of the resulting image to 1024 pixels.
113 <li> A \b black box indicates that the class' documentation is currently shown.
114 <li> A <b>dark blue</b> arrow indicates an include relation (for the
115 include dependency graph) or public inheritance (for the other graphs).
116 <li> A <b>dark green</b> arrow indicates protected inheritance.
117 <li> A <b>dark red</b> arrow indicates private inheritance.
118 <li> A <b>purple dashed</b> arrow indicated a "usage" relation, the
119 edge of the arrow is labeled with the variable(s) responsible for the
121 Class \c A uses class \c B, if class \c A has a member variable \c m
122 of type C, where B is a subtype of C (e.g. `C` could be `B`, `B*`, `T<B>*`).
126 Here are a couple of header files that together show the various diagrams
127 that doxygen can generate:
129 <code>diagrams_a.h</code>
130 \include diagrams_a.h
131 <code>diagrams_b.h</code>
132 \include diagrams_b.h
133 <code>diagrams_c.h</code>
134 \include diagrams_c.h
135 <code>diagrams_d.h</code>
136 \include diagrams_d.h
137 <code>diagrams_e.h</code>
138 \include diagrams_e.h
142 Click <a href="examples/diagrams/html/index.html">here</a>
143 for the corresponding HTML documentation that is generated by doxygen<br/>
144 (<code>EXTRACT_ALL</code> = <code>YES</code> is used here).
147 \IfFileExists{../html/examples/diagrams/latex/refman_doc.tex}
149 See \hyperlink{diagrams_example}{Diagrams example}
150 for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
156 Go to the <a href="preprocessing.html">next</a> section or return to the
157 <a href="index.html">index</a>.