IT TIP

doxygen을 사용하여 C ++ 소스에서 UML 클래스 다이어그램을 만드는 방법

itqueen 2020. 10. 16. 19:19
반응형

doxygen을 사용하여 C ++ 소스에서 UML 클래스 다이어그램을 만드는 방법


doxygen으로 간단한 클래스 다이어그램을 생성하는 방법을 설명하는 자료를 찾고 있었지만 찾을 수 없었습니다. 아무도 도울 수 있습니까?

C ++ 파일 집합에서 아래와 같이 다이어그램을 만들어야합니다. 대체 텍스트

이 작업을 더 쉽게 수행 할 수있는 더 나은 도구가 있으면 알려주세요.


Doxygen은 상속 다이어그램을 만들지 만 전체 클래스 계층을 만들 것이라고 생각하지 않습니다. GraphViz 도구를 사용할 수 있습니다. Doxygen GUI 프런트 엔드 도구를 사용하는 경우에서 관련 옵션을 찾을 수 있습니다 Step2: -> Wizard tab -> Diagrams. DOT 관계 옵션은 전문가 탭 아래에 있습니다.


이 게시물의 인용문 (doxygen 작성자가 직접 작성) :

run doxygen -g and change the following options of the generated Doxyfile:

    EXTRACT_ALL            = YES
    HAVE_DOT               = YES
    UML_LOOK               = YES

run doxygen again

Hmm, this seems to be a bit of an old question, but since I've been messing about with Doxygen configuration last few days, while my head's still full of current info let's have a stab at it -

I think the previous answers almost have it:

The missing option is to add COLLABORATION_GRAPH = YES in the Doxyfile. I assume you can do the equivalent thing somewhere in the doxywizard GUI (I don't use doxywizard).

So, as a more complete example, typical "Doxyfile" options related to UML output that I tend to use are:

EXTRACT_ALL          = YES
CLASS_DIAGRAMS      = YES
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT             = YES
CLASS_GRAPH          = YES
COLLABORATION_GRAPH  = YES
UML_LOOK             = YES
UML_LIMIT_NUM_FIELDS = 50
TEMPLATE_RELATIONS   = YES
DOT_GRAPH_MAX_NODES  = 100
MAX_DOT_GRAPH_DEPTH  = 0
DOT_TRANSPARENT      = YES

These settings will generate both "inheritance" (CLASS_GRAPH=YES) and "collaboration" (COLLABORATION_GRAPH=YES) diagrams.

Depending on your target for "deployment" of the doxygen output, setting DOT_IMAGE_FORMAT = svg may also be of use. With svg output the diagrams are "scalable" instead of the fixed resolution of bitmap formats such as .png. Apparently, if viewing the output in browsers other than IE, there is also INTERACTIVE_SVG = YES which will allow "interactive zooming and panning" of the generated svg diagrams. I did try this some time ago, and the svg output was very visually attractive, but at the time, browser support for svg was still a bit inconsistent, so hopefully that situation may have improved lately.

As other comments have mentioned, some of these settings (DOT_GRAPH_MAX_NODES in particular) do have potential performance impacts, so YMMV.

저는 "RTFM"스타일 답변을 싫어하는 경향이 있으므로이 문장에 대해 사과합니다.이 경우에는 Doxygen 문서가 정말 친구입니다. 위에서 언급 한 설정에 대한 Doxygen 문서를 확인하세요. 마지막으로 살펴 보았을 때 자세한 내용은 http://www.doxygen.nl/manual/config.html .


doxys 파일을 편집하고 GENERATE_UML (그와 비슷한 것)을 true로 설정해야한다고 생각합니다. 그리고 dot / graphviz가 설치되어 있어야합니다.


Enterprise Architect는 가져온 소스 코드에서 UML 다이어그램을 빌드합니다.

참고 URL : https://stackoverflow.com/questions/4755913/how-to-use-doxygen-to-create-uml-class-diagrams-from-c-source

반응형