Skip to content

Commit

Permalink
Add examples for a class diagram with tikz-uml (closes latextemplates#71
Browse files Browse the repository at this point in the history
)
  • Loading branch information
diehlpk committed Feb 28, 2018
1 parent 1e35490 commit 1c5a130
Show file tree
Hide file tree
Showing 4 changed files with 5,460 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,11 @@
}{}
%%%

%%%
% EN: tikz-uml
% Package for creating uml diagramms
\usepackage{tikz-uml}
%%%

%%
% EN: Layout: bottoms of pages not aligned to each other
Expand Down
40 changes: 40 additions & 0 deletions latexhints-english.tex
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,46 @@ \section{Weitere Illustrationen}
\caption{A regular grid genrated with easily with two for loops.}\label{fig:tikz_example}
\end{figure}
}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{UML diagrams with tikz-uml}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{center}
\begin{figure}
\begin{tikzpicture}
\begin{umlpackage}{p}
\begin{umlpackage}{sp1}
\umlclass[template=T]{A}{
n : uint \\ t : float
}{}
\umlclass[y=-3]{B}{
d : double
}{
\umlvirt{setB(b : B) : void} \\ getB() : B}
\end{umlpackage}
\begin{umlpackage}[x=10,y=-6]{sp2}
\umlinterface{C}{
n : uint \\ s : string
}{}
\end{umlpackage}
\umlclass[x=2,y=-10]{D}{
n : uint
}{}
\end{umlpackage}

\umlassoc[geometry=-|-, arg1=tata, mult1=*, pos1=0.3, arg2=toto, mult2=1, pos2=2.9, align2=left]{C}{B}
\umlunicompo[geometry=-|, arg=titi, mult=*, pos=1.7, stereo=vector]{D}{C}
\umlimport[geometry=|-, anchors=90 and 50, name=import]{sp2}{sp1}
\umlaggreg[arg=tutu, mult=1, pos=0.8, angle1=30, angle2=60, loopsize=2cm]{D}{D}
\umlinherit[geometry=-|]{D}{B}
\umlnote[x=2.5,y=-6, width=3cm]{B}{A note with respect to class B}
\umlnote[x=7.5,y=-2]{import-2}{A anotation}
\end{tikzpicture}
\caption{Class diagram generated with tikz-uml. Example adapted from Nicolas Kielbasiewicz.}
\end{figure}
\end{center}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Closing remarks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
39 changes: 39 additions & 0 deletions latexhints-german.tex
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,45 @@ \section{Weitere Illustrationen}
\end{figure}
}{}

\section{UML-Diagramme mit tikz-uml}


\begin{center}
\begin{figure}
\begin{tikzpicture}
\begin{umlpackage}{p}
\begin{umlpackage}{sp1}
\umlclass[template=T]{A}{
n : uint \\ t : float
}{}
\umlclass[y=-3]{B}{
d : double
}{
\umlvirt{setB(b : B) : void} \\ getB() : B}
\end{umlpackage}
\begin{umlpackage}[x=10,y=-6]{sp2}
\umlinterface{C}{
n : uint \\ s : string
}{}
\end{umlpackage}
\umlclass[x=2,y=-10]{D}{
n : uint
}{}
\end{umlpackage}

\umlassoc[geometry=-|-, arg1=tata, mult1=*, pos1=0.3, arg2=toto, mult2=1, pos2=2.9, align2=left]{C}{B}
\umlunicompo[geometry=-|, arg=titi, mult=*, pos=1.7, stereo=vector]{D}{C}
\umlimport[geometry=|-, anchors=90 and 50, name=import]{sp2}{sp1}
\umlaggreg[arg=tutu, mult=1, pos=0.8, angle1=30, angle2=60, loopsize=2cm]{D}{D}
\umlinherit[geometry=-|]{D}{B}
\umlnote[x=2.5,y=-6, width=3cm]{B}{Eine Notiz f\"ur die Klasse B}
\umlnote[x=7.5,y=-2]{import-2}{Eine Anmerkung}
\end{tikzpicture}
\caption{Ein Klassendiagramm mit tikz-uml generiert. Beispiel von Nicolas Kielbasiewicz adaptiert.}
\end{figure}
\end{center}


\section{Schlusswort}
Verbesserungsvorschläge für diese Vorlage sind immer willkommen.
Bitte bei GitHub ein Ticket eintragen (\url{https://github.com/latextemplates/scientific-thesis-template/issues}).
Loading

0 comments on commit 1c5a130

Please sign in to comment.