用于 C++ 的 UML 免费逆向工程工具(.h/.cpp ==> 类图)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8015471/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 17:51:25  来源:igfitidea点击:

UML free reverse engineering tool for C++ (.h/.cpp ==> Class Diagram)

c++umlreverse-engineeringclass-diagram

提问by Ben

What tools are available for creating UML ClassDiagrams from a set of .h- or .cpp-files?

哪些工具可用于从一组 .h 或 .cpp 文件创建 UML图?

I am looking for something that...

我正在寻找的东西...

  • is free
  • runs out of the box on Windows
  • does not require any particular IDE
  • ideally provides a GUI
  • 免费的
  • Windows 上开箱即用
  • 不需要任何特定的 IDE
  • 理想情况下提供一个 GUI

回答by pnezis

Diais a very good open source drawing tool, and cpp2diacreates UML diagrams from .h/.cpp files.

Dia是一个非常好的开源绘图工具,cpp2dia从 .h/.cpp 文件创建 UML 图。

I use it under Linux, I don't know if it runs in other platforms.

我在Linux下用的,不知道其他平台能不能运行。

There is no GUI for cpp2dia, but its command line usage is very simple.

cpp2dia 没有 GUI,但它的命令行使用非常简单。

回答by Bruno Pagès

About Bouml

关于布尔

it claims to have found errors in my code

它声称在我的代码中发现了错误

the reverse only accept 'true' C++, there is no preprocessor step, so any use of a macro in a class definition or an operation definition produces an error.

相反只接受“真”C++,没有预处理器步骤,因此在类定义或操作定义中使用宏会产生错误。

it doesn't display data members that are of custom data types directly as attributes

它不会将自定义数据类型的数据成员直接显示为属性

the reverse produces relations the more it is possible, an attribute is used when the type is not a known class or not a class (eg 'int').

反向产生的关系越可能,当类型不是已知类或不是类(例如'int')时使用属性。

don't do several separated reverses, do one reverse specifying several top directories to reserve (each specified directory is traversed recursively)

不要做几个分开的反向,做一个反向指定几个要保留的顶级目录(每个指定的目录都递归遍历)

Bruno Pagès (author of Bouml)

布鲁诺·佩格斯(Bouml 的作者)

回答by Oktalist

I've developed a tool called Doxygraphwhich can parse the XML generated by Doxygen and turn it into an interactive UML class diagram which you can view in a web browser or import into any software that can read Graphviz "dot" files.

我开发了一个名为Doxygraph的工具,它可以解析 Doxygen 生成的 XML 并将其转换为交互式 UML 类图,您可以在 Web 浏览器中查看该类图,也可以将其导入任何可以读取 Graphviz“点”文件的软件。

回答by Roman Kutlak

I haven't tried this but Umbrello seems like a viable candidate: http://uml.sourceforge.net/It is built on top of KDE libraries so it should run on Linux/Windows/Mac.

我还没有尝试过,但 Umbrello 似乎是一个可行的候选者:http: //uml.sourceforge.net/它建立在 KDE 库之上,因此它应该可以在 Linux/Windows/Mac 上运行。

回答by jopasserat

You can try ArgoUMLwhich is free, has a nice GUI and is written in Java so can be run painless on any system.

您可以尝试免费的ArgoUML,它有一个漂亮的 GUI 并且是用 Java 编写的,因此可以在任何系统上轻松运行。

It is able to generate C++ from UML diagrams; however, reverse engineering of C++ source code is handled by a sub-projectfor the moment. The latest snapshot of this tool can be downloaded from the source repository. Yet, this tool is still in development, so it might not work as you would expect.

能够从UML图生成C++;但是,C++ 源代码的逆向工程目前由一个子项目处理。可以从源存储库下载此工具的最新快照。然而,此工具仍在开发中,因此它可能无法如您所愿。

回答by acampesino

I have implemented a module for StarUML that provides incremental reverse engineering of C++. It provides support for std containers also. It still under development but you may want give it a try. http://starumlcmodule.sourceforge.net.

我已经为 StarUML 实现了一个模块,它提供了 C++ 的增量逆向工程。它还提供对 std 容器的支持。它仍在开发中,但您可能想尝试一下。 http://starumlcmodule.sourceforge.net