Add [C++ Import] menu in Astah to enable to import C++ source code to Astah from the menu. After importing, you are able to auto-generate Class Diagrams.
Download the Plugin file by clicking the blue Download button at the top of this page.
After the download is complete, drag the downloaded .jar file to an open instance of Astah. A pop-up will appear asking you to confirm installation. Choose [Yes].
If the pop-up below opens, restart Astah.
The [Plugin] menu exists in Astah version 7.2 or later.
If [Import C++] is under [Tools] – [C++], your installation is complete.
How to Use
First, export your C++ source code to XML using Doxygen.
Launch Doxygen from [doxygen] – [Doxywizard]. When the [Doxygen GUI Frontend] dialog opens, select [Wizard] – [Project] and specify the items below.
Project name
Enter the project name
Project version or id
Enter the project version or ID
Source code directory
Specify the source code directory
Scan recursively
Check this to scan subfolders as well.
Destination directory
Do not use the following symbols: &, <, >, * or @.
Go to [Wizard] – [Mode] and check the two options shown below.
Go to [Wizard] – [Output] and check [XML].
Go to [Expert] – [Input] and specify the encoding used in the source code (e.g. UTF-8, CP1252). See the list of supported encodings.
Go to [Expert] – [Preprocessor] and check the three options [ENABLE_PREPROCESSING], [MACRO_EXPANSION] and [SEARCH_INCLUDES]. Other options can be set as you prefer.
Go to [File] – [Save] to save the configuration. Back in the [Doxygen GUI Frontend] dialog, select the [Run] tab, specify the working directory, and click [Run doxygen]. When Doxygen finishes without errors, the message “Doxygen has finished” appears.
In Astah, create a new file or open an existing one. Go to [Tools] – [C++] – [Import C++] and load the XML file.
To create a class diagram from the imported source code, right-click on a package and generate a class diagram automatically.
When import fails
Make sure you set the correct encoding in Doxygen. Follow the steps below to regenerate the XML file.
Check which encoding the C++ source code uses. All source code files must use the same encoding.
Launch Doxygen and go back to Step 3 to configure the settings.