3

I get following error message:

! Package pgf Error: Sorry, the requested layer 'connectionlayers' is not part of the layer list. Please verify that you provided \pgfsetlayers and that 'conn ectionlayers' is part of this list.

when using:

\usepackage{tikz-uml}
\let\umlnoteold\umlnote
\let\umlnote\relax
\usepackage[simplified]{pgf-umlcd}

Context to this question: crash of tikz-uml and pgf-umlcd

Can someone help me out?

compilable code:

\documentclass[]{scrreprt} 
\usepackage[ngerman, english]{babel} 
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage{tikz-uml}
\let\umlnoteold\umlnote
\let\umlnote\relax
\usepackage[simplified]{pgf-umlcd}


\begin{document}

%\begin{figure}[h]
%\centering
%\resizebox{1\textwidth}{!}{%
%\begin{tikzpicture}
%\tikzumlset{fill object = white, fill call = gray!20} 
%\begin{umlseqdiag}
%\umlactor{a}
%\umlobject[x=4]{b}
%\umlobject[x=13]{c}
%\begin{umlcall}[op=blah, type=synchron, return=halb]{a}{b}
%
%        \begin{umlcallself}[op=lögfkhjölgkjh]{b} 
%       \end{umlcallself}
%       
%       \begin{umlcallself}[op=sieorjögdfljglö]{b} 
%       \end{umlcallself}
%       
%       \begin{umlcallself}[op=pffffff]{b} 
%       \end{umlcallself}       
%        \begin{umlcall}[op=signalize witching]{b}{c} 
%            \end{umlcall}                  
%                \begin{umlcall}[op=send fartValue, type=synchron, return=backnforth]{b}{c}                 
%                   \begin{umlcallself}[padding=1.5, op=search th ligth]{c} 
%                   \end{umlcallself}                   
%           \end{umlcall}
%\end{umlcall}
%\umlsdnode[dt=5]{a}
%\umlsdnode[dt=5.5]{b}
%\umlsdnode[dt=7]{c}
%\end{umlseqdiag}
%\end{tikzpicture}}
%\caption{blaaaaah}
%\label{fig:SDG}
%\end{figure}
%
%



\begin{figure}[h]
\centering
\resizebox{1\textwidth}{!}{%
\begin{tikzpicture}

    \begin{class}[text width =14 cm]{Meeeh}{0,0}
\attribute{\# m\_actualinpuss:int}
\attribute{\# m\_bufferFlood:buul}
%%%%%
\operation{+ deleteSuffers():void}
\operation{+ Togglewitch(int, FatServer*, unint32\_t)}
\end{class}
    \begin{class}[text width =10 cm]{Slave}{-6,-14}
\inherit{Meeeh}
\attribute{- m\_...: ... int}
%%%%%
\operation{+ ....(int, ...)}
\end{class}
    \begin{class}[text width =10 cm]{Master}{6,-14}
\inherit{Slave}
\attribute{- m\_...: ... int}
%%%%%
\operation{+ ....(int, ...)}
\end{class}
    \begin{class}[text width =15 cm]{blabber}{-8,-18}
\inherit{Slave}
\attribute{- m\_bufferHamburger: unsigned int}
\attribute{- m\_emptySlotCount:int}
%%%%%
\operation{+ nghjkldrt*)}
\operation{+ \~{}ggllblabber()}
\
\end{class}
    \begin{class}[text width =15 cm]{blubber}{8,-18}
\inherit{Master}
\attribute{-  m\_blub:bool}
\attribute{-  m\_blahblah*}
%%%%%
\operation{+  getBlah():shared\_ptr$<$ShmSlotBlahBuffer$>$}
\operation{+  blah():void}
\end{class}

\end{tikzpicture}}
\caption{blah}
\label{fig:KDG}
\end{figure}
\end{document}

This works fine (TeXworks, texlive). But when uncomment the first figure the problem occurs.

nm82
  • 41

4 Answers4

3

I might not use the same version of tikz-uml, but the error you are describing can be solved by adding this line in your code:

\pgfsetlayers{connections,activity,lifelines}`

This adds the layers to your image, see this MWE:

\documentclass[]{scrreprt} 
\usepackage[ngerman, english]{babel} 
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage{tikz-uml}
\let\umlnoteold\umlnote
\let\umlnote\relax
\usepackage[simplified]{pgf-umlcd}

\begin{document}

\begin{figure}[h]
\centering
\begin{tikzpicture}
\pgfsetlayers{connections,activity,lifelines}
\tikzumlset{fill object = white, fill call = gray!20} 
\begin{umlseqdiag}
\umlactor{a}
\umlobject[x=4]{b}
\umlobject[x=13]{c}
\begin{umlcall}[op=blah, type=synchron, return=halb]{a}{b}

        \begin{umlcallself}[op=bb]{b} 
       \end{umlcallself}

       \begin{umlcallself}[op=bbb]{b} 
       \end{umlcallself}

       \begin{umlcallself}[op=bbbb]{b} 
       \end{umlcallself}   

        \begin{umlcall}[op=signalize witching]{b}{c} 
            \end{umlcall}                  
                \begin{umlcall}[op=send fartValue, type=synchron, return=backnforth]{b}{c}                 
                   \begin{umlcallself}[padding=1.5, op=search th ligth]{c} 
                   \end{umlcallself}                   
           \end{umlcall}
\end{umlcall}
%\umlsdnode[dt=5]{a}
%\umlsdnode[dt=5.5]{b}
%\umlsdnode[dt=7]{c}
\end{umlseqdiag}
\end{tikzpicture}
\end{figure}


\end{document}

I have commented the \umlsdnode commands, as my package version seems not to contain these commands.

Tom
  • 1,279
  • If someone has the link to a newer version of the package, please add the link as a comment! – Tom Aug 03 '18 at 15:13
  • Hi Tom! Thank you for your anwser. Now it compiles, but

    \umlactor{a} \umlobject[x=4]{b} \umlobject[x=13]{c}

    is now not included. So it is not displayed.

    – nm82 Aug 06 '18 at 14:17
  • Hi @nm82, have you tried to simply uncomment the the three lines? I have just commented them because my package version does not provide the umlsdnode commands. If this does not work, can you provide a download link to the tikz-uml file that you are using? – Tom Aug 07 '18 at 22:09
  • See my new answer. Here ist the package: https://www.dropbox.com/s/3igkval8pwn9rdh/tikzuml.zip?dl=0 – nm82 Aug 10 '18 at 14:41
1

This displays the umlobjects, but I can't use the comment part of the code:

\documentclass[]{scrreprt} 
\usepackage[ngerman, english]{babel} 
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage{tikz-uml}
\let\umlnoteold\umlnote
\let\umlnote\relax
%\usepackage[simplified]{pgf-umlcd}


\begin{document}

\begin{figure}[h]
\centering
\resizebox{1\textwidth}{!}{%
\begin{tikzpicture}
%\pgfsetlayers{connections,activity,lifelines}
\tikzumlset{fill object = white, fill call = gray!20} 
\begin{umlseqdiag}
\umlactor{a}
\umlobject[x=4]{b}
\umlobject[x=13]{c}
\begin{umlcall}[op=blah, type=synchron, return=halb]{a}{b}

        \begin{umlcallself}[op=lögfkhjölgkjh]{b} 
       \end{umlcallself}

       \begin{umlcallself}[op=sieorjögdfljglö]{b} 
       \end{umlcallself}

       \begin{umlcallself}[op=pffffff]{b} 
       \end{umlcallself}       
        \begin{umlcall}[op=signalize witching]{b}{c} 
            \end{umlcall}                  
                \begin{umlcall}[op=send fartValue, type=synchron, return=backnforth]{b}{c}                 
                   \begin{umlcallself}[padding=1.5, op=search th ligth]{c} 
                   \end{umlcallself}                   
           \end{umlcall}
\end{umlcall}
\umlsdnode[dt=5]{a}
\umlsdnode[dt=5.5]{b}
\umlsdnode[dt=7]{c}
\end{umlseqdiag}
\end{tikzpicture}}
\caption{blaaaaah}
\label{fig:SDG}
\end{figure}




%
%\begin{figure}[h]
%\centering
%\resizebox{1\textwidth}{!}{%
%\begin{tikzpicture}
%
%    \begin{class}[text width =14 cm]{Meeeh}{0,0}
%\attribute{\# m\_actualinpuss:int}
%\attribute{\# m\_bufferFlood:buul}
%%%%%%
%\operation{+ deleteSuffers():void}
%\operation{+ Togglewitch(int, FatServer*, unint32\_t)}
%\end{class}
%    \begin{class}[text width =10 cm]{Slave}{-6,-14}
%\inherit{Meeeh}
%\attribute{- m\_...: ... int}
%%%%%%
%\operation{+ ....(int, ...)}
%\end{class}
%    \begin{class}[text width =10 cm]{Master}{6,-14}
%\inherit{Slave}
%\attribute{- m\_...: ... int}
%%%%%%
%\operation{+ ....(int, ...)}
%\end{class}
%    \begin{class}[text width =15 cm]{blabber}{-8,-18}
%\inherit{Slave}
%\attribute{- m\_bufferHamburger: unsigned int}
%\attribute{- m\_emptySlotCount:int}
%%%%%%
%\operation{+ nghjkldrt*)}
%\operation{+ \~{}ggllblabber()}
%\
%\end{class}
%    \begin{class}[text width =15 cm]{blubber}{8,-18}
%\inherit{Master}
%\attribute{-  m\_blub:bool}
%\attribute{-  m\_blahblah*}
%%%%%%
%\operation{+  getBlah():shared\_ptr$<$ShmSlotBlahBuffer$>$}
%\operation{+  blah():void}
%\end{class}
%
%\end{tikzpicture}}
%\caption{blah}
%\label{fig:KDG}
%\end{figure}
\end{document}

This let me use both parts, but the umlobjects are not displayed:

\documentclass[]{scrreprt} 
\usepackage[ngerman, english]{babel} 
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{positioning,shapes,shadows,arrows}
\usepackage{tikz-uml}
\let\umlnoteold\umlnote
\let\umlnote\relax
\usepackage[simplified]{pgf-umlcd}


\begin{document}

\begin{figure}[h]
\centering
\resizebox{1\textwidth}{!}{%
\begin{tikzpicture}
\pgfsetlayers{connections,activity,lifelines}
\tikzumlset{fill object = white, fill call = gray!20} 
\begin{umlseqdiag}
\umlactor{a}
\umlobject[x=4]{b}
\umlobject[x=13]{c}
\begin{umlcall}[op=blah, type=synchron, return=halb]{a}{b}

        \begin{umlcallself}[op=lögfkhjölgkjh]{b} 
       \end{umlcallself}

       \begin{umlcallself}[op=sieorjögdfljglö]{b} 
       \end{umlcallself}

       \begin{umlcallself}[op=pffffff]{b} 
       \end{umlcallself}       
        \begin{umlcall}[op=signalize witching]{b}{c} 
            \end{umlcall}                  
                \begin{umlcall}[op=send fartValue, type=synchron, return=backnforth]{b}{c}                 
                   \begin{umlcallself}[padding=1.5, op=search th ligth]{c} 
                   \end{umlcallself}                   
           \end{umlcall}
\end{umlcall}
\umlsdnode[dt=5]{a}
\umlsdnode[dt=5.5]{b}
\umlsdnode[dt=7]{c}
\end{umlseqdiag}
\end{tikzpicture}}
\caption{blaaaaah}
\label{fig:SDG}
\end{figure}





\begin{figure}[h]
\centering
\resizebox{1\textwidth}{!}{%
\begin{tikzpicture}

    \begin{class}[text width =14 cm]{Meeeh}{0,0}
\attribute{\# m\_actualinpuss:int}
\attribute{\# m\_bufferFlood:buul}
%%%%%
\operation{+ deleteSuffers():void}
\operation{+ Togglewitch(int, FatServer*, unint32\_t)}
\end{class}
    \begin{class}[text width =10 cm]{Slave}{-6,-14}
\inherit{Meeeh}
\attribute{- m\_...: ... int}
%%%%%
\operation{+ ....(int, ...)}
\end{class}
    \begin{class}[text width =10 cm]{Master}{6,-14}
\inherit{Slave}
\attribute{- m\_...: ... int}
%%%%%
\operation{+ ....(int, ...)}
\end{class}
    \begin{class}[text width =15 cm]{blabber}{-8,-18}
\inherit{Slave}
\attribute{- m\_bufferHamburger: unsigned int}
\attribute{- m\_emptySlotCount:int}
%%%%%
\operation{+ nghjkldrt*)}
\operation{+ \~{}ggllblabber()}
\
\end{class}
    \begin{class}[text width =15 cm]{blubber}{8,-18}
\inherit{Master}
\attribute{-  m\_blub:bool}
\attribute{-  m\_blahblah*}
%%%%%
\operation{+  getBlah():shared\_ptr$<$ShmSlotBlahBuffer$>$}
\operation{+  blah():void}
\end{class}

\end{tikzpicture}}
\caption{blah}
\label{fig:KDG}
\end{figure}
\end{document}
nm82
  • 41
1

I added the following two lines in the preamble, just before \begin{document} and that solved my problem. (same error message).

\pgfdeclarelayer{connectionlayers}
\pgfsetlayers{connectionlayers,main} 
0

So, I kicked

\let\umlnoteold\umlnote
\let\umlnote\relax
\usepackage[simplified]{pgf-umlcd}

out and put

\pgfsetlayers{connections,activity,lifelines}

before

\usepackage{tikz-uml}

and use

\umlclass

instead of

\begin{class}

works perfekt!

nm82
  • 41