从源代码中使用Doxygen创建一个大的UML图。

6

我正在使用Doxygen和Dot来创建Java项目的UML图。当我运行Doxygen时,它会创建许多指定类的.png UML文件,但没有一个“大”UML图表显示所有类+成员函数等。

是否可以生成这个“大”UML图表?如果可以,怎么做?

1个回答

6

要在所有类中拥有一个大图表,您需要在Doxyfile中启用GRAPHICAL_HIERARCHYHAVE_DOT

# 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, 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)

HAVE_DOT               = YES

# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
# will generate a graphical hierarchy of all classes instead of a textual one.

GRAPHICAL_HIERARCHY    = YES

此外,还有

# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
# collaboration diagrams in a style similar to the OMG's Unified Modeling 
# Language.

UML_LOOK               = YES

这个方法也适用于协作图吗?抄送:@albert - user5534993
据我所知,在协作图中没有特殊的命令,但是您(@user5534993)想要看到什么呢? - albert
我想看到所有协作图的组合,但不希望出现节点重复。通常这会导致一个由不相连的图形组成的图表。@albert,如何实现这一点?可能需要使用额外的工具吗? - user5534993
@albert 我认为使用普通的doxygen是不可能实现的。我已经编写了一些脚本(https://github.com/dhebbeker/doxygen_collaboration_graph_combiner)来实现这个目标。 - user5534993

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接