diff --git a/doc/dev/documentation.org b/doc/dev/documentation.org index fe817d41043d194f6b9063f9b80a09a18c5833d6..02c6ef213ec59f7328466856eeddfb91371addac 100644 --- a/doc/dev/documentation.org +++ b/doc/dev/documentation.org @@ -28,6 +28,20 @@ #+OPTIONS: toc:t #+LANGUAGE: UKenglish +#+NAME: attr_wrap +#+HEADER: :var width="\\textwidth" +#+HEADER: :var caption="" +#+HEADER: :var smallcaption="" +#+HEADER: :var name="" +#+HEADER: :var data="" +#+HEADER: :var float="nil" +#+BEGIN_SRC sh :results output :exports none + echo "#+CAPTION[$smallcaption]: $caption" + echo "#+NAME: $name" + echo "#+ATTR_LATEX: :width $width :float $float" + echo "$data" +#+END_SRC + #+BEGIN_abstract This document is for the use of developers. It describes the project architecture, the tools available to assist development and @@ -60,9 +74,123 @@ https://doc.qt.io/qt-5/model-view-programming.html (last access 2023-09-15) * TODO Architecture + +Pamhyr2 architecture is based on Qt Model/View programming[fn:qt-mv] architecture. + +#+name: graph-architecture +#+header: :results drawer +#+header: :exports results +#+header: :post attr_wrap(width="7cm", data=*this*, name="graph-architecture", caption="Pamhyr2 Model/View architecture scheme (inspired by Qt Model/View architecture [[https://doc.qt.io/qt-5/model-view-programming.html]])", float="t") +#+begin_src dot :file "images/graph-architecture.png" :cache no + digraph { + node[colorscheme=set19,shape=box,style="filled",fillcolor=white]; + + save[label="Pamhyr save",fillcolor="9",shape=note]; + model[label="Model",fillcolor="2"]; + view[label="View",fillcolor="1"]; + delegate[label="Delegate",fillcolor="3"]; + undocommand[label="UndoCommand",fillcolor="4"]; + user[label="User",shape=ellipse]; + + model -> save[label="Save"]; + save -> model[label="Load"]; + + model -> view[label="Rendering"]; + view -> delegate[label="Rendering"]; + delegate -> undocommand[label="Create"]; + undocommand -> model[label="Modify"] + + view -> user[label="Vizualize"]; + user -> delegate[label="Modify"]; + } +#+end_src + +#+name: graph-model +#+header: :results drawer +#+header: :exports results +#+header: :post attr_wrap(width="16cm", data=*this*, name="graph-model", caption="Pamhyr2 Model architecture scheme", float="t") +#+begin_src dot :file "images/graph-model.png" :cache no + digraph { + node[colorscheme=set19,shape=box,style="filled",fillcolor="2"]; + + study[label="Study"]; + river[label="River"]; + + subgraph cluster00 { + label="Network" + rnode[label="RiverNode"]; + redge[label="RiverReach"]; + } + + frictionlist[label="FrictionList"]; + + subgraph cluster01 { + label="Stricklers"; + stricklers[label="Stricklers"]; + stricklerslist[label="StricklersList"]; + } + subgraph cluster02 { + label="BoundaryCondition"; + boundaryconditionlist[label="BoundaryConditionList"]; + boundarycondition[label="BoundaryCondition"]; + } + subgraph cluster03 { + label="LateralContribution"; + lateralcontributionlist[label="LateralContributionList"]; + lateralcontribution[label="LateralContribution"]; + } + subgraph cluster04 { + label="InitialConditions"; + initialconditionsdict[label="InitialConditionsDict"]; + initialconditions[label="InitialConditions"]; + } + + solverparameterslist[label="SolverParametersList"]; + + subgraph cluster05 { + label="Sediment"; + sedimentlayerlist[label="SedimentLayerList"]; + sedimentlayer[label="SedimentLayer"]; + layer[label="Layer"]; + } + + subgraph cluster06 { + label="Greometry" + georeach[label="Reach"]; + geocrosssection[label="Cross-section"]; + geopoint[label="Point"]; + } + + study -> river; + river -> rnode; + river -> redge; + redge -> rnode; + river -> boundaryconditionlist -> boundarycondition -> rnode; + river -> lateralcontributionlist -> lateralcontribution -> redge; + river -> initialconditionsdict -> initialconditions; + initialconditions -> redge; + river -> stricklerslist -> stricklers; + river -> solverparameterslist; + river -> sedimentlayerlist -> sedimentlayer -> layer; + redge -> frictionlist -> stricklers; + redge -> georeach -> geocrosssection -> geopoint; + geocrosssection -> sedimentlayer; + geopoint -> sedimentlayer; + + } +#+end_src + +[fn:qt-mv] The Qt Model/View documentation web page: +https://doc.qt.io/qt-5/model-view-programming.html + ** TODO Model -** TODO Solver ** TODO View +*** TODO UI file +*** TODO Window class +** TODO UndoCommand +** TODO Table +** TODO Plot +** TODO Solver ** TODO Unit tests ** TODO The debug mode * TODO Build the project @@ -188,7 +316,7 @@ print(f"Document build on system: {os.name}") #+RESULTS: : Document build on system: posix -*** Latex +*** LaTeX If we export the file to PDF, org-mode use {{{latex}}}. So we can add some piece of {{{latex}}} into the document[fn:: See {{{latex}}} part diff --git a/doc/dev/images/.gitkeep b/doc/dev/images/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/doc/tools/macro.org b/doc/tools/macro.org index 76db07806139414cceb01d8398b5f1bfa1495222..9c59153f3fe0f75d19005df179eafda887f4eae7 100644 --- a/doc/tools/macro.org +++ b/doc/tools/macro.org @@ -34,3 +34,18 @@ # Biblio #+MACRO: cite [cite:$1] #+MACRO: biblio \bibliography{documentation} + +# Wrapper +#+NAME: attr_wrap +#+HEADER: :var width="\\textwidth" +#+HEADER: :var caption="" +#+HEADER: :var smallcaption="" +#+HEADER: :var name="" +#+HEADER: :var data="" +#+HEADER: :var float="nil" +#+BEGIN_SRC sh :results output :exports none + echo "#+CAPTION[$smallcaption]: $caption" + echo "#+NAME: $name" + echo "#+ATTR_LATEX: :width $width :float $float" + echo "$data" +#+END_SRC diff --git a/doc/tools/setup.el b/doc/tools/setup.el index 54a3517bc72453d8c0833cd5f6997526248ca090..027e5700dd360bf37e1484d635446d7b81d9f8df 100644 --- a/doc/tools/setup.el +++ b/doc/tools/setup.el @@ -16,6 +16,18 @@ (setq org-confirm-babel-evaluate nil) (setq org-latex-caption-above nil) +(org-babel-do-load-languages + 'org-babel-load-languages + (add-to-list 'org-babel-load-languages '(shell . t))) + +(org-babel-do-load-languages + 'org-babel-load-languages + (add-to-list 'org-babel-load-languages '(dot . t))) + +(org-babel-do-load-languages + 'org-babel-load-languages + (add-to-list 'org-babel-load-languages '(python . t))) + (add-to-list 'org-latex-packages-alist '("" "minted")) (setq org-latex-listings 'minted) (setq org-src-fontify-natively t)