Skip to content

Commit ad5b203

Browse files
committed
autogenerated cpp uml diagrams
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
1 parent 75aa0f0 commit ad5b203

File tree

3 files changed

+109
-1
lines changed

3 files changed

+109
-1
lines changed

.clang-uml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
compilation_database_dir: ./cpp_build/clang-debug
2+
output_directory: output/diagrams
3+
plantuml:
4+
cmd: "plantuml -tsvg \"docs/diagrams/{}.puml\""
5+
diagrams:
6+
power_grid_model_c_packages:
7+
title: Power Grid Model C++ Packages
8+
type: package
9+
generate_packages: true
10+
package_type: directory
11+
glob:
12+
- power_grid_model_c/**/*.cpp
13+
- tests/native_api_tests/*.cpp
14+
- tests/cpp_validation_tests/*.cpp
15+
16+
PowerGridModel:
17+
title: Power Grid Model C++ Classes
18+
type: class
19+
glob:
20+
- power_grid_model_c/**/model.cpp
21+
using_namespace: power_grid_model
22+
exclude:
23+
namespaces:
24+
- power_grid_model::detail
25+
- power_grid_model::math_model_impl
26+
- power_grid_model::meta_data::detail
27+
- power_grid_model::statistics::detail
28+
- power_grid_model::main_core::detail
29+
- power_grid_model::main_core::update::detail
30+
- power_grid_model::math_solver::detail
31+
- power_grid_model::optimizer::detail
32+
- std
33+
- Eigen
34+
- eigen
35+
relationships:
36+
- dependency
37+
subclasses:
38+
- clanguml::common::model::filter_visitor
39+
access: [public, protected, private]
40+
element_types:
41+
- enum
42+
43+
core_include_diagram:
44+
title: Power Grid Model C++ Core Include Diagram
45+
type: include
46+
glob:
47+
- power_grid_model_c/**/*.cpp
48+
relative_to: .
49+
include:
50+
paths:
51+
- power_grid_model_c/**/*.cpp
52+
- power_grid_model_c/**/*.hpp
53+
- power_grid_model_c/**/*.h
54+
55+
integration_tests_include_diagram:
56+
title: Power Grid Model C++ Native API/Validation Tests Include Diagram
57+
type: include
58+
glob:
59+
- tests/native_api_tests/*.cpp
60+
- tests/cpp_validation_tests/*.cpp
61+
relative_to: .
62+
include:
63+
paths:
64+
- tests/**/*.cpp
65+
- tests/**/*.hpp
66+
- power_grid_model_c/**/*.hpp
67+
- power_grid_model_c/**/*.h

.readthedocs.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ build:
1414
python: "3.11"
1515
apt_packages:
1616
- graphviz
17+
- plantuml
18+
- cmake
19+
- llvm
1720
jobs:
1821
post_install:
1922
# Build package with doc requirements from pyproject.optional-dependencies
@@ -23,7 +26,11 @@ build:
2326
- find power_grid_model_c/power_grid_model_c/include -name *.h -exec sed -i -r "s/PGM_API //g" {} \;
2427
# build doxygen for C header
2528
- cd docs/doxygen && doxygen && cd ../..
26-
# build class and package diagrams
29+
# build class and package diagrams for C++
30+
- cmake --preset ci-clang-debug # this generates the compilation database
31+
- clang-uml --render_diagrams --compile-database cpp_build/ci-clang-debug --output_directory docs/_static
32+
- rm docs/static/*.puml
33+
# build class and package diagrams for Python
2734
- pyreverse --no-standalone -o dot src/power_grid_model
2835
- ccomps -x classes.dot | dot -Grankdir=LR -Nfontsize=13 -Efontsize=13 | gvpack -m100 -array_l1 | neato -n2 -Tsvg -o docs/_static/classes.svg
2936
- dot packages.dot -Grankdir=TD -Nfontsize=13 -Efontsize=13 -Tsvg -o docs/_static/packages.svg

docs/advanced_documentation/core-design.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,37 @@ graph TD
4848
4949
ComponentsOutput -->|Output| Output(Output data)
5050
```
51+
52+
## Class diagram
53+
54+
```{raw} html
55+
<div style="overflow-x: auto; white-space: nowrap;">
56+
<img src="../_static/PowerGridModel.svg" style="max-width: none;" alt="Power Grid Model C++ Classes">
57+
</div>.
58+
```
59+
60+
## Package diagram
61+
62+
```{raw} html
63+
<div style="overflow-x: auto; white-space: nowrap;">
64+
<img src="../_static/power_grid_model_c_packages.svg" style="max-width: none;">
65+
</div>.
66+
```
67+
68+
## Include paths
69+
70+
### Core
71+
72+
```{raw} html
73+
<div style="overflow-x: auto; white-space: nowrap;">
74+
<img src="../_static/core_include_diagram.svg" style="max-width: none;">
75+
</div>.
76+
```
77+
78+
### Tests
79+
80+
```{raw} html
81+
<div style="overflow-x: auto; white-space: nowrap;">
82+
<img src="../_static/integration_tests_include_diagram.svg" style="max-width: none;">
83+
</div>.
84+
```

0 commit comments

Comments
 (0)