├── documentation.pdf ├── README ├── .gitignore ├── Makefile ├── documentation.tex ├── LICENSE └── moeptikz.sty /documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moepinet/moeptikz/HEAD/documentation.pdf -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | moepTikZ - a library for typesetting computer networks 2 | ======================================================= 3 | 4 | Overview 5 | -------- 6 | The moepTikZ package provides shapes for typesetting computer networks, e.g. 7 | shapes for hubs, switches, routers, and more. It is in use since 2012 for the 8 | lecture materials of our basic course in computer networks \cite{} due to 9 | shortcomings of some commercial products and (at that time) the lack of 10 | meaningful alternatives. For the first official release many shapes were 11 | redesigned and a couple of new features added, e.g. complete anchor support and 12 | custom colors. 13 | 14 | 15 | How to compile 16 | -------------- 17 | At the moment there is no meaningful Makefile accompanying this package. For 18 | the time being, just run 19 | 20 | | pdflatex documentation.tex 21 | 22 | *twice* in the document's root directory. Be sure to have an up-to-date TeX 23 | distribution. The package is tested with texlive-full on Linux and MacTeX on 24 | OSX, but it should not make any problems using MiKTeX on Windows. 25 | 26 | Installation 27 | ------------ 28 | At this time meopTikZ is distributed a single .sty file that depends on a 29 | couple of common LaTeX packages. Just copy it to the root of your document and 30 | include it using \usepackage{moeptikz}. An upload to CTAN is planned as soon as 31 | the codebase appears to be "nice". 32 | 33 | 34 | Feature requests and bug reports 35 | -------------------------------- 36 | Both is highly welcome. Please report anything to moepi@moepi.net. 37 | 38 | 39 | License 40 | ------- 41 | moepTikZ is published under the LaTeX Project Public License (LPPL). A copy is 42 | of the license text is distributed with the moepTikZ package. 43 | 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Core latex/pdflatex auxiliary files: 2 | *.aux 3 | *.lof 4 | *.log 5 | *.lot 6 | *.fls 7 | *.out 8 | *.toc 9 | 10 | ## Intermediate documents: 11 | *.dvi 12 | *-converted-to.* 13 | # these rules might exclude image files for figures etc. 14 | # *.ps 15 | # *.eps 16 | # *.pdf 17 | 18 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 19 | *.bbl 20 | *.bcf 21 | *.blg 22 | *-blx.aux 23 | *-blx.bib 24 | *.brf 25 | *.run.xml 26 | 27 | ## Build tool auxiliary files: 28 | *.fdb_latexmk 29 | *.synctex 30 | *.synctex.gz 31 | *.synctex.gz(busy) 32 | *.pdfsync 33 | 34 | ## Auxiliary and intermediate files from other packages: 35 | 36 | # algorithms 37 | *.alg 38 | *.loa 39 | 40 | # achemso 41 | acs-*.bib 42 | 43 | # amsthm 44 | *.thm 45 | 46 | # beamer 47 | *.nav 48 | *.snm 49 | *.vrb 50 | 51 | #(e)ledmac/(e)ledpar 52 | *.end 53 | *.[1-9] 54 | *.[1-9][0-9] 55 | *.[1-9][0-9][0-9] 56 | *.[1-9]R 57 | *.[1-9][0-9]R 58 | *.[1-9][0-9][0-9]R 59 | *.eledsec[1-9] 60 | *.eledsec[1-9]R 61 | *.eledsec[1-9][0-9] 62 | *.eledsec[1-9][0-9]R 63 | *.eledsec[1-9][0-9][0-9] 64 | *.eledsec[1-9][0-9][0-9]R 65 | 66 | # glossaries 67 | *.acn 68 | *.acr 69 | *.glg 70 | *.glo 71 | *.gls 72 | 73 | # gnuplottex 74 | *-gnuplottex-* 75 | 76 | # hyperref 77 | *.brf 78 | 79 | # knitr 80 | *-concordance.tex 81 | *.tikz 82 | *-tikzDictionary 83 | 84 | # listings 85 | *.lol 86 | 87 | # makeidx 88 | *.idx 89 | *.ilg 90 | *.ind 91 | *.ist 92 | 93 | # minitoc 94 | *.maf 95 | *.mtc 96 | *.mtc0 97 | 98 | # minted 99 | _minted* 100 | *.pyg 101 | 102 | # morewrites 103 | *.mw 104 | 105 | # nomencl 106 | *.nlo 107 | 108 | # sagetex 109 | *.sagetex.sage 110 | *.sagetex.py 111 | *.sagetex.scmd 112 | 113 | # sympy 114 | *.sout 115 | *.sympy 116 | sympy-plots-for-*.tex/ 117 | 118 | # todonotes 119 | *.tdo 120 | 121 | # xindy 122 | *.xdy 123 | 124 | # WinEdt 125 | *.bak 126 | *.sav 127 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | MAKEFLAGS += -r -R -j $(shell getconf _NPROCESSORS_ONLN) 2 | 3 | .SILENT : 4 | .PHONY : all clean cleanall 5 | 6 | DOCUMENT := documentation 7 | SRC := $(DOCUMENT).tex 8 | SRC += $(wildcard *.cls) 9 | SRC += $(wildcard *.sty) 10 | DEPS := $(SRC) Makefile 11 | TARGET := documentation 12 | 13 | PDFLATEX ?= pdflatex 14 | BIBTEX ?= bibtex 15 | DIFF ?= diff 16 | GREP ?= grep 17 | AWK ?= awk 18 | LS ?= ls 19 | MV ?= mv 20 | SED ?= sed 21 | UNIQ ?= uniq 22 | SORT ?= sort 23 | 24 | PDFLATEX_FLAGS := -interaction=batchmode -recorder -file-line-error 25 | GREP_FLAGS += -E -B 1 -A 2 26 | 27 | # terminal colors 28 | ifneq ($(COLORTERM),false) 29 | NOCOLOR := "\033[0m" 30 | RED := "\033[1;31m" 31 | BLUE := "\033[1;34m" 32 | GREEN := "\033[1;32m" 33 | YELLOW := "\033[1;33m" 34 | CYAN := "\033[1;36m" 35 | WHITE := "\033[1;37m" 36 | MAGENTA := "\033[1;35m" 37 | BOLD := "\033[1m" 38 | else 39 | NOCOLOR := "" 40 | RED := "" 41 | BLUE := "" 42 | GREEN := "" 43 | YELLOW := "" 44 | CYAN := "" 45 | WHITE := "" 46 | MAGENTA := "" 47 | BOLD := "" 48 | endif 49 | 50 | # helper functions for filename conversion 51 | getname = $(firstword $(subst ., ,$(1))) 52 | getaux = $(call getname,$(1)).aux 53 | 54 | # messaging functions 55 | msgtarget = printf $(GREEN)"%s"$(MAGENTA)" %s"$(NOCOLOR)"\n" "$(1)" "$(2)" 56 | msgcompile = printf $(BOLD)"%-25s"$(NOCOLOR)" %s\n" "[$(1)]" "$(2)" 57 | msgfail = printf "%-25s "$(RED)"%s"$(NOCOLOR)"\n" "" "FAILED! Continuing ..." 58 | msginfo = printf "%-25s "$(CYAN)"%s"$(NOCOLOR)"\n" "" "$(1)" 59 | 60 | define run-typeset 61 | $(call msgcompile,$(PDFLATEX),$(1)); \ 62 | $(PDFLATEX) $(PDFLATEX_FLAGS) $(TARGET_PDFLATEX_FLAGS) $(1) /dev/null 2>&1 || \ 63 | $(call msgfail) 64 | endef 65 | 66 | define run-draft-typeset 67 | $(call msgcompile,$(PDFLATEX),$(1)); \ 68 | $(PDFLATEX) $(PDFLATEX_FLAGS) $(TARGET_PDFLATEX_FLAGS) -draftmode $(1) /dev/null 2>&1 || \ 69 | $(call msgfail) 70 | endef 71 | 72 | define run-bibtex 73 | $(call msgcompile,$(BIBTEX),$(call getaux,$(1))); \ 74 | $(BIBTEX) $(BIB_FLAGS) $(call getaux,$(1)) 1>/dev/null 2>&1 || \ 75 | $(call msgfail) 76 | endef 77 | 78 | define grep-citation 79 | $(GREP) $(GREP_FLAGS) -e "Warning: Citation .*" \ 80 | $(call getlog,$(1)) 1>/dev/null 2>&1 81 | endef 82 | 83 | define check-citation 84 | $(GREP) -e'^\\citation' $(call getaux,$(1)) 2>/dev/null \ 85 | >$(call gettemp,$(1)); \ 86 | $(DIFF) $(call gettemp,$(1)) $(call getcit,$(1)) 1>/dev/null 2>&1 || \ 87 | (mv -f $(call gettemp,$(1)) $(call getcit,$(1)); false) 88 | endef 89 | 90 | define grep-crossref 91 | $(GREP) $(GREP_FLAGS) -e "Rerun to get .*" \ 92 | $(call getlog,$(1)) 1>/dev/null 2>&1 && \ 93 | $(call msginfo,Rerun latex to get everything right.) 94 | endef 95 | 96 | define extract-log 97 | $(call msgtarget,Extracting log file for target,$(1)); \ 98 | $(GREP) -E -v -e "^$$" $(call getname,$(1)).log | \ 99 | $(GREP) $(GREP_FLAGS) -e ":[[:digit:]]+: |Warning|Error|Underfull|Overfull|\!|Reference|Label|Citation" || : 100 | endef 101 | 102 | # based on https://github.com/shiblon/latex-makefile/blob/master/get-inputs.sed 103 | # $(call get-inputs,,) 104 | define get-inputs 105 | $(SED) \ 106 | -e '/^INPUT/!d' \ 107 | -e 's!^INPUT \(\./\)\{0,1\}!!' \ 108 | -e 's/[[:space:]]/\\ /g' \ 109 | -e 's/\(.*\)\.aux$$/\1.tex/' \ 110 | -e '/\.out$$/d' \ 111 | -e '/^\/dev\/null$$/d' \ 112 | -e 's!.*!$2: &!' \ 113 | '$1.fls' | grep -v ': $1.tex$$' | $(SORT) | $(UNIQ) 114 | endef 115 | 116 | .PHONY: $(DOCUMENT) 117 | #$(DOCUMENT): $(TARGET).pdf 118 | # use hard coded for shell completion 119 | exam: $(TARGET).pdf 120 | 121 | -include $(DOCUMENT).d 122 | $(TARGET).pdf: TARGET_PDFLATEX_FLAGS = -output-directory=build/$(DOCUMENT) 123 | $(TARGET).pdf: $(DEPS) 124 | # $(call run-typeset,$<) 125 | # $(call run-bibtex,$<) 126 | mkdir -p build/$(DOCUMENT) 127 | $(call run-draft-typeset,$<) 128 | $(call run-typeset,$<) 129 | $(call extract-log,build/$(DOCUMENT)/$(DOCUMENT)) 130 | $(call get-inputs,build/$(DOCUMENT)/$(DOCUMENT),$@) > build/$(DOCUMENT)/$(DOCUMENT).d 131 | $(MV) build/$(DOCUMENT)/$(DOCUMENT).pdf "$@" 132 | 133 | all: $(DOCUMENT) 134 | 135 | clean: 136 | rm -fv *.aux 137 | rm -fv *.log 138 | rm -fv *.toc 139 | rm -fv *.lof 140 | rm -fv *.lot 141 | rm -fv *.eps 142 | rm -fv *.bbl 143 | rm -fv *.out 144 | rm -fv *.fls 145 | rm -fv *.blg 146 | rm -fv *.auxlock 147 | rm -fv *.nav 148 | rm -fv *.snm 149 | 150 | cleanall: clean 151 | rm -fv *.pdf 152 | rm -rf build 153 | 154 | fresh: cleanall 155 | $(MAKE) all 156 | -------------------------------------------------------------------------------- /documentation.tex: -------------------------------------------------------------------------------- 1 | %% documentation.tex 2 | %% Copyright 2015 Stephan M. Guenther 3 | % 4 | % This work may be distributed and/or modified under the % conditions of the 5 | % LaTeX Project Public License, either version 1.3 % of this license or (at 6 | % your option) any later version. The latest version of this license is in 7 | % http://www.latex-project.org/lppl.txt 8 | % and version 1.3 or later is part of all distributions of LaTeX version 9 | % 2005/12/01 or later. 10 | % 11 | % This work has the LPPL maintenance status `maintained'. 12 | % 13 | % The current maintainer of this work is Stephan M. Guenther. 14 | % 15 | % This work consists of the files moeptikz.sty and documentation.tex. 16 | 17 | \documentclass{scrartcl} 18 | 19 | \usepackage[utf8]{inputenc} 20 | \usepackage[T1]{fontenc} 21 | \usepackage[english]{babel} 22 | \usepackage{xspace} 23 | 24 | \usepackage[shading]{moeptikz} 25 | \usepackage{pgfmath} 26 | \usepackage{siunitx} 27 | \usepackage{calc} 28 | \usepackage{inconsolata} 29 | 30 | \usepackage[% 31 | a4paper, 32 | top=20mm, 33 | bottom=20mm, 34 | left=20mm, 35 | right=20mm, 36 | ]{geometry} 37 | 38 | \moeptikzset{shading=true} 39 | 40 | \usetikzlibrary{calc} 41 | \usetikzlibrary{shapes} 42 | 43 | \newcommand*{\TikZ}{Ti\textit{k}Z\xspace} 44 | \newcommand*{\moeptikz}{mo\reflectbox{e}p\TikZ} 45 | \newcommand*{\nodelabel}[1]{{\scriptsize\bfseries\ttfamily #1}} 46 | 47 | \title{The \moeptikz{} package} 48 | \subtitle{a library for typesetting computer networks} 49 | \author{Stephan M. G\"unther} 50 | 51 | \newcommand*{\presentnode}[2]{% 52 | \begin{tikzpicture}[x=1mm,y=1mm] 53 | \node[#1,minimum size=2cm] (x) at (0,0) {}; 54 | \foreach \x in {0,1,...,7} { 55 | \pgfmathparse{20*cos(\x/8*360)} 56 | \edef\xpos{\pgfmathresult} 57 | \pgfmathparse{20*sin(\x/8*360)} 58 | \edef\ypos{\pgfmathresult} 59 | \node[circle,fill=black!40,minimum width=1mm,inner sep=0pt] 60 | (p\x) at ($(x)+(\xpos,\ypos)$) {}; 61 | \draw[line width=1pt,black!40] (x) -- (p\x); 62 | } 63 | \node[rectangle,draw=black!40,line width=.5pt,inner sep=0pt,minimum 64 | size=4cm] at (x) {}; 65 | \node[#1,minimum size=2cm,label=above:\color{red}$\times$] at (0,0) {}; 66 | \node[#1,minimum size=2cm,label=below:\color{red}$\times$] at (0,0) {}; 67 | \node[#1,minimum size=2cm,label=left:\color{red}$\times$] at (0,0) {}; 68 | \node[#1,minimum size=2cm,label=right:\color{red}$\times$,font=\footnotesize\ttfamily] 69 | at (0,0) {\colorbox{white}{#2}}; 70 | \end{tikzpicture} 71 | } 72 | 73 | \begin{document} 74 | 75 | 76 | \maketitle 77 | 78 | The \moeptikz{} package provides shapes for typesetting computer networks, 79 | e.\,g.\@ shapes for hubs, switches, routers, and more. 80 | It is in use since 2012 for the lecture materials of our basic course in 81 | computer networks due to shortcomings of some commercial products and 82 | (at that time) the lack of meaningful alternatives. 83 | For the first official release many shapes were redesigned and a couple of new 84 | features added, e.\,g.\@ complete anchor support and custom colors. 85 | Currently the package provides the following shapes and commands: 86 | \begin{itemize}\itemsep0pt 87 | \item \verb|hub|, \verb|switch|, \verb|router|, \verb|client|, 88 | \verb|server|, \verb|nuc|, \verb|messageclosed|, \verb|messageopen|, 89 | \verb|notebook| 90 | \item \verb|\tikzextractx|, \verb|\tikzextracty| 91 | \item \verb|\moeptikzset|{} 92 | \end{itemize} 93 | 94 | \section{What it can do} 95 | Did you ever try to build slides for a networking lecture from scratch? 96 | If so, do you care about off-topic details such as using solely vector 97 | graphics, perfect alignment of nodes, easy modification of hundreds of figures 98 | when you decide to change fonts or colors, and doing all that without even 99 | thinking about a pointing device? 100 | Then you probably like what \moeptikz{} can do for you: 101 | 102 | \begin{figure}[ht!] 103 | \centering 104 | \begin{tikzpicture}[x=1cm,y=1cm] 105 | \node[cloud,cloud puffs=13,minimum width=3cm,minimum height=1.5cm, 106 | draw=black,line width=1pt] (inet) at (4.25,0) {}; 107 | \node at (inet) {\nodelabel{Internet}}; 108 | \node[router] (r1) at (.5,0) {}; 109 | \node[router,minimum size=5mm] (r2) at (inet.west) {}; 110 | \node[switch] (s1) at (-2,0) {}; 111 | \node[server,minimum size=12mm,label=below:\nodelabel{ swallow.moepi.net}] 112 | (server1) at (-2,-1.5) {}; 113 | \node[server,minimum size=12mm,label=above:\nodelabel{dc.poorcompany.net}] 114 | (server2) at (-2,1.5) {}; 115 | \node[server,minimum size=12mm,label=above:\nodelabel{8.8.8.8}] 116 | (server3) at (8,0) {}; 117 | 118 | \foreach \x in {1,2,3} { 119 | \node[client,label=left:\nodelabel{PC\,\x}] 120 | (c\x) at ($(s1)+(-2.8,2.6-1.2*\x)$) {}; 121 | \draw[black,line width=1pt] (c\x) -- (s1); 122 | } 123 | 124 | \draw[black,line width=1pt] (s1) -- (r1); 125 | \draw[black,line width=1pt] (s1) -- (server1); 126 | \draw[black,line width=1pt] (s1) -- (server2); 127 | \draw[black,line width=1pt] (inet) -- (server3); 128 | \draw[black,line width=1pt] (r1) -- (r2.west); 129 | 130 | \draw[dashed,black,line width=1pt] (r1.west) -- ++(-1,1) 131 | node[above right] {\nodelabel{eth0: 172.16.0.1/24}} -- ++(3,0); 132 | 133 | \draw[line width=1.5pt,-latex,black!40] (r1) to[bend right] 134 | node[below,yshift=-2mm,messageclosed,minimum size=5mm] {} (server3); 135 | \end{tikzpicture} 136 | \caption{What \protect\moeptikz{} can (or cannot?) do for you} 137 | \label{fig:moeptikz-intro} 138 | \end{figure} 139 | 140 | 141 | \section{What it cannot do} 142 | You probably noticed the misalignment of \verb|PC2| (and its friend) in 143 | Figure~\ref{fig:moeptikz-intro}. 144 | Well, you might not have noticed it in the first place (I didn't either), but 145 | now, as you know about that, it must drive you crazy. 146 | The good news: it's your fault (in this particular case it is my fault, of 147 | course). 148 | \moeptikz cannot calculate coordinates for you. 149 | If you are interested in writing \TikZ{} instead of pointing around you will 150 | notice the difference: 151 | 152 | \begin{figure}[ht!] 153 | \centering 154 | \begin{tikzpicture}[x=1cm,y=1cm] 155 | \node[cloud,cloud puffs=13,minimum width=3cm,minimum height=1.5cm, 156 | draw=black,line width=1pt] (inet) at (4.25,0) {}; 157 | \node at (inet) {\nodelabel{Internet}}; 158 | \node[router] (r1) at (.5,0) {}; 159 | \node[router,minimum size=5mm] (r2) at (inet.west) {}; 160 | \node[switch] (s1) at (-2,0) {}; 161 | \node[server,minimum size=12mm,label=below:\nodelabel{ swallow.moepi.net}] 162 | (server1) at (-2,-1.5) {}; 163 | \node[server,minimum size=12mm,label=above:\nodelabel{dc.poorcompany.net}] 164 | (server2) at (-2,1.5) {}; 165 | \node[server,minimum size=12mm,label=above:\nodelabel{8.8.8.8}] 166 | (server3) at (8,0) {}; 167 | 168 | \foreach \x in {1,2,3} { 169 | \node[client,label=left:\nodelabel{PC\,\x}] 170 | (c\x) at ($(s1)+(-2.8,2.6-1.3*\x)$) {}; 171 | \draw[black,line width=1pt] (c\x) -- (s1); 172 | } 173 | 174 | \draw[black,line width=1pt] (s1) -- (r1); 175 | \draw[black,line width=1pt] (s1) -- (server1); 176 | \draw[black,line width=1pt] (s1) -- (server2); 177 | \draw[black,line width=1pt] (inet) -- (server3); 178 | \draw[black,line width=1pt] (r1) -- (r2.west); 179 | 180 | \draw[dashed,black,line width=1pt] (r1.west) -- ++(-1,1) 181 | node[above right] {\nodelabel{eth0: 172.16.0.1/24}} -- ++(3,0); 182 | 183 | \draw[line width=1.5pt,-latex,black!40] (r1) to[bend right] 184 | node[below,yshift=-2mm,messageclosed,minimum size=5mm] {} (server3); 185 | \end{tikzpicture} 186 | \caption{What \protect\moeptikz{} can do for you if you can do your math} 187 | \end{figure} 188 | 189 | 190 | \section{Package options} 191 | 192 | The only package option currently defined is \texttt{shading=}. 193 | If true (default), nodes are shaded to create the visual effect of a spotlight. 194 | The shading has only a marginal impact on the resulting document size but may 195 | be undesirable depending on the personal preference. 196 | 197 | 198 | \section{The shapes} 199 | 200 | Figure~\ref{fig:shapes} presents the different shapes as printed by 201 | \verb|\node[] at ...| (the label font is typewriter here, but that's up 202 | to you). 203 | The default label shows the name of the corresponding shape. 204 | The gray box around the shape is a unit square making the shapes bounding box 205 | visible. 206 | The for red crosses mark the label positions specified by a node option such as 207 | \verb|label=:|. 208 | The gray bullets demonstrate automatically calculated anchor positions. 209 | 210 | If the node option \verb|minimum size| is omitted, nodes will be drawn in a 211 | bounding box of $\SI{1}{\centi\meter}\,\times\,\SI{1}{\centi\meter}$. 212 | Since not all shapes fill their bounding box, default label positions may vary 213 | between nodes, e.\,g.\@ label positions of server and client shapes differ. 214 | This may be undesirable proved to be better than having node labels too far 215 | away from the visible shape. 216 | 217 | \begin{figure}[ht!] 218 | \centering 219 | \presentnode{hub}{hub} 220 | \hskip5mm% 221 | \presentnode{switch}{switch} 222 | \hskip5mm% 223 | \presentnode{router}{router} 224 | \vskip5mm 225 | \presentnode{client}{client} 226 | \hskip5mm% 227 | \presentnode{server}{server} 228 | \hskip5mm% 229 | \presentnode{nuc}{nuc} 230 | \vskip5mm 231 | \presentnode{messageclosed}{messageclosed} 232 | \hskip5mm% 233 | \presentnode{messageopen}{messageopen} 234 | \hskip5mm% 235 | \presentnode{notebook}{notebook} 236 | \caption{Shapes currently defined} 237 | \label{fig:shapes} 238 | \end{figure} 239 | 240 | 241 | \subsection{Changing node colors} 242 | There are very few occasions where you might want to highlight a specific node 243 | by changing its color. 244 | Or you are upset by the default mark color (black), i\,e.\@, the color of 245 | arrows on top of some shapes. 246 | You may change it at will: 247 | all shapes support custom colors using the \verb|fill=| option. 248 | In addition to that, the message shapes also allow to change the line color 249 | using the \verb|draw=| option. 250 | 251 | \vskip\baselineskip 252 | 253 | \begin{minipage}{1.75cm} 254 | \begin{tikzpicture} 255 | \node[router,fill=blue,draw=orange] at (0,0) {}; 256 | \end{tikzpicture} 257 | \end{minipage}% 258 | \begin{minipage}{\textwidth-1.75cm}% 259 | \verb|\node[router,fill=blue,draw=orange] at (0,0) {};| 260 | \end{minipage} 261 | 262 | \vskip\baselineskip 263 | 264 | \begin{minipage}{1.75cm} 265 | \begin{tikzpicture} 266 | \node[messageclosed,fill=red!40,draw=red] at (0,0) {}; 267 | \end{tikzpicture} 268 | \end{minipage}% 269 | \begin{minipage}{\textwidth-1.75cm}% 270 | \verb|\node[messageclosed,fill=red!40,draw=red] at (0,0) {};| 271 | \end{minipage} 272 | 273 | \vskip\baselineskip 274 | 275 | \begin{minipage}{1.75cm} 276 | \begin{tikzpicture} 277 | \node[messageopen,fill=orange!40,paper color=blue,draw=orange] at (0,0) {}; 278 | \end{tikzpicture} 279 | \end{minipage}% 280 | \begin{minipage}{\textwidth-1.75cm}% 281 | \verb|\node[messageopen,fill=orange!40,paper color=blue,draw=orange] at (0,0) {};| 282 | \end{minipage} 283 | 284 | \vskip\baselineskip 285 | 286 | The effect of the \verb|draw| option depends on the actual shape: 287 | a \verb|router| will change the color of its marking (the arrows) while an 288 | \verb|openmessage| or \verb|closedmessage| change their line color. 289 | This behavior may seem inconsistent but is intended -- give it a try, or come 290 | up with fix. 291 | 292 | 293 | 294 | \subsection{Upcoming features} 295 | There will be some additional shapes such as \verb|firewall| and 296 | \verb|workstation| soon. 297 | Feature requests are welcome. 298 | And of course there will be many code updates, since the current pfg code is 299 | all but nice. 300 | 301 | \section{The commands} 302 | \moeptikz{} provides two commands to make your live with \tikz{} easier: 303 | \begin{enumerate}\itemsep0pt 304 | \item \verb|\tikzextractx{(x,y)}{\}|{}\\ 305 | Extracts the \verb|x|-component of a coordinate and stores it 306 | \verb|\| for later use. 307 | \item \verb|\tikzextracty{(x,y)}{\}|{} 308 | Extracts the \verb|y|-component of a coordinate and stores it 309 | \verb|\| for later use. 310 | \item \verb|\moeptikzset{=}|{} 311 | Sets the internal key \verb||{} to value \verb||. 312 | Currently, the only defined key is \verb!shading=!. 313 | \end{enumerate} 314 | 315 | 316 | \section{Known bugs and missing features} 317 | \begin{itemize}\itemsep0pt 318 | \item \texttt{[bug]} Sometimes lines from a node to another node do not end 319 | at an automatically calculated anchor but at the node's center, causing the 320 | line to cross parts of a shape. 321 | Please report such cases (including your code) to \texttt{moepi@moepi.net}. 322 | \item \texttt{[bug]} \texttt{notebook} shape is new and still buggy. 323 | \item \texttt{[bug]} Rendering speed is a problem, which is particularly a 324 | problem in this documentation due to the way nodes/anchors are being 325 | presented (shapes are drawn dozens of times here). 326 | This affects only the documentation and should not be a major problem in 327 | other documents. 328 | \end{itemize} 329 | 330 | \end{document} 331 | 332 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The LaTeX Project Public License 2 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 3 | 4 | LPPL Version 1.3c 2008-05-04 5 | 6 | Copyright 1999 2002-2008 LaTeX3 Project 7 | Everyone is allowed to distribute verbatim copies of this 8 | license document, but modification of it is not allowed. 9 | 10 | 11 | PREAMBLE 12 | ======== 13 | 14 | The LaTeX Project Public License (LPPL) is the primary license under 15 | which the LaTeX kernel and the base LaTeX packages are distributed. 16 | 17 | You may use this license for any work of which you hold the copyright 18 | and which you wish to distribute. This license may be particularly 19 | suitable if your work is TeX-related (such as a LaTeX package), but 20 | it is written in such a way that you can use it even if your work is 21 | unrelated to TeX. 22 | 23 | The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', 24 | below, gives instructions, examples, and recommendations for authors 25 | who are considering distributing their works under this license. 26 | 27 | This license gives conditions under which a work may be distributed 28 | and modified, as well as conditions under which modified versions of 29 | that work may be distributed. 30 | 31 | We, the LaTeX3 Project, believe that the conditions below give you 32 | the freedom to make and distribute modified versions of your work 33 | that conform with whatever technical specifications you wish while 34 | maintaining the availability, integrity, and reliability of 35 | that work. If you do not see how to achieve your goal while 36 | meeting these conditions, then read the document `cfgguide.tex' 37 | and `modguide.tex' in the base LaTeX distribution for suggestions. 38 | 39 | 40 | DEFINITIONS 41 | =========== 42 | 43 | In this license document the following terms are used: 44 | 45 | `Work' 46 | Any work being distributed under this License. 47 | 48 | `Derived Work' 49 | Any work that under any applicable law is derived from the Work. 50 | 51 | `Modification' 52 | Any procedure that produces a Derived Work under any applicable 53 | law -- for example, the production of a file containing an 54 | original file associated with the Work or a significant portion of 55 | such a file, either verbatim or with modifications and/or 56 | translated into another language. 57 | 58 | `Modify' 59 | To apply any procedure that produces a Derived Work under any 60 | applicable law. 61 | 62 | `Distribution' 63 | Making copies of the Work available from one person to another, in 64 | whole or in part. Distribution includes (but is not limited to) 65 | making any electronic components of the Work accessible by 66 | file transfer protocols such as FTP or HTTP or by shared file 67 | systems such as Sun's Network File System (NFS). 68 | 69 | `Compiled Work' 70 | A version of the Work that has been processed into a form where it 71 | is directly usable on a computer system. This processing may 72 | include using installation facilities provided by the Work, 73 | transformations of the Work, copying of components of the Work, or 74 | other activities. Note that modification of any installation 75 | facilities provided by the Work constitutes modification of the Work. 76 | 77 | `Current Maintainer' 78 | A person or persons nominated as such within the Work. If there is 79 | no such explicit nomination then it is the `Copyright Holder' under 80 | any applicable law. 81 | 82 | `Base Interpreter' 83 | A program or process that is normally needed for running or 84 | interpreting a part or the whole of the Work. 85 | 86 | A Base Interpreter may depend on external components but these 87 | are not considered part of the Base Interpreter provided that each 88 | external component clearly identifies itself whenever it is used 89 | interactively. Unless explicitly specified when applying the 90 | license to the Work, the only applicable Base Interpreter is a 91 | `LaTeX-Format' or in the case of files belonging to the 92 | `LaTeX-format' a program implementing the `TeX language'. 93 | 94 | 95 | 96 | CONDITIONS ON DISTRIBUTION AND MODIFICATION 97 | =========================================== 98 | 99 | 1. Activities other than distribution and/or modification of the Work 100 | are not covered by this license; they are outside its scope. In 101 | particular, the act of running the Work is not restricted and no 102 | requirements are made concerning any offers of support for the Work. 103 | 104 | 2. You may distribute a complete, unmodified copy of the Work as you 105 | received it. Distribution of only part of the Work is considered 106 | modification of the Work, and no right to distribute such a Derived 107 | Work may be assumed under the terms of this clause. 108 | 109 | 3. You may distribute a Compiled Work that has been generated from a 110 | complete, unmodified copy of the Work as distributed under Clause 2 111 | above, as long as that Compiled Work is distributed in such a way that 112 | the recipients may install the Compiled Work on their system exactly 113 | as it would have been installed if they generated a Compiled Work 114 | directly from the Work. 115 | 116 | 4. If you are the Current Maintainer of the Work, you may, without 117 | restriction, modify the Work, thus creating a Derived Work. You may 118 | also distribute the Derived Work without restriction, including 119 | Compiled Works generated from the Derived Work. Derived Works 120 | distributed in this manner by the Current Maintainer are considered to 121 | be updated versions of the Work. 122 | 123 | 5. If you are not the Current Maintainer of the Work, you may modify 124 | your copy of the Work, thus creating a Derived Work based on the Work, 125 | and compile this Derived Work, thus creating a Compiled Work based on 126 | the Derived Work. 127 | 128 | 6. If you are not the Current Maintainer of the Work, you may 129 | distribute a Derived Work provided the following conditions are met 130 | for every component of the Work unless that component clearly states 131 | in the copyright notice that it is exempt from that condition. Only 132 | the Current Maintainer is allowed to add such statements of exemption 133 | to a component of the Work. 134 | 135 | a. If a component of this Derived Work can be a direct replacement 136 | for a component of the Work when that component is used with the 137 | Base Interpreter, then, wherever this component of the Work 138 | identifies itself to the user when used interactively with that 139 | Base Interpreter, the replacement component of this Derived Work 140 | clearly and unambiguously identifies itself as a modified version 141 | of this component to the user when used interactively with that 142 | Base Interpreter. 143 | 144 | b. Every component of the Derived Work contains prominent notices 145 | detailing the nature of the changes to that component, or a 146 | prominent reference to another file that is distributed as part 147 | of the Derived Work and that contains a complete and accurate log 148 | of the changes. 149 | 150 | c. No information in the Derived Work implies that any persons, 151 | including (but not limited to) the authors of the original version 152 | of the Work, provide any support, including (but not limited to) 153 | the reporting and handling of errors, to recipients of the 154 | Derived Work unless those persons have stated explicitly that 155 | they do provide such support for the Derived Work. 156 | 157 | d. You distribute at least one of the following with the Derived Work: 158 | 159 | 1. A complete, unmodified copy of the Work; 160 | if your distribution of a modified component is made by 161 | offering access to copy the modified component from a 162 | designated place, then offering equivalent access to copy 163 | the Work from the same or some similar place meets this 164 | condition, even though third parties are not compelled to 165 | copy the Work along with the modified component; 166 | 167 | 2. Information that is sufficient to obtain a complete, 168 | unmodified copy of the Work. 169 | 170 | 7. If you are not the Current Maintainer of the Work, you may 171 | distribute a Compiled Work generated from a Derived Work, as long as 172 | the Derived Work is distributed to all recipients of the Compiled 173 | Work, and as long as the conditions of Clause 6, above, are met with 174 | regard to the Derived Work. 175 | 176 | 8. The conditions above are not intended to prohibit, and hence do not 177 | apply to, the modification, by any method, of any component so that it 178 | becomes identical to an updated version of that component of the Work as 179 | it is distributed by the Current Maintainer under Clause 4, above. 180 | 181 | 9. Distribution of the Work or any Derived Work in an alternative 182 | format, where the Work or that Derived Work (in whole or in part) is 183 | then produced by applying some process to that format, does not relax or 184 | nullify any sections of this license as they pertain to the results of 185 | applying that process. 186 | 187 | 10. a. A Derived Work may be distributed under a different license 188 | provided that license itself honors the conditions listed in 189 | Clause 6 above, in regard to the Work, though it does not have 190 | to honor the rest of the conditions in this license. 191 | 192 | b. If a Derived Work is distributed under a different license, that 193 | Derived Work must provide sufficient documentation as part of 194 | itself to allow each recipient of that Derived Work to honor the 195 | restrictions in Clause 6 above, concerning changes from the Work. 196 | 197 | 11. This license places no restrictions on works that are unrelated to 198 | the Work, nor does this license place any restrictions on aggregating 199 | such works with the Work by any means. 200 | 201 | 12. Nothing in this license is intended to, or may be used to, prevent 202 | complete compliance by all parties with all applicable laws. 203 | 204 | 205 | NO WARRANTY 206 | =========== 207 | 208 | There is no warranty for the Work. Except when otherwise stated in 209 | writing, the Copyright Holder provides the Work `as is', without 210 | warranty of any kind, either expressed or implied, including, but not 211 | limited to, the implied warranties of merchantability and fitness for a 212 | particular purpose. The entire risk as to the quality and performance 213 | of the Work is with you. Should the Work prove defective, you assume 214 | the cost of all necessary servicing, repair, or correction. 215 | 216 | In no event unless required by applicable law or agreed to in writing 217 | will The Copyright Holder, or any author named in the components of the 218 | Work, or any other party who may distribute and/or modify the Work as 219 | permitted above, be liable to you for damages, including any general, 220 | special, incidental or consequential damages arising out of any use of 221 | the Work or out of inability to use the Work (including, but not limited 222 | to, loss of data, data being rendered inaccurate, or losses sustained by 223 | anyone as a result of any failure of the Work to operate with any other 224 | programs), even if the Copyright Holder or said author or said other 225 | party has been advised of the possibility of such damages. 226 | 227 | 228 | MAINTENANCE OF THE WORK 229 | ======================= 230 | 231 | The Work has the status `author-maintained' if the Copyright Holder 232 | explicitly and prominently states near the primary copyright notice in 233 | the Work that the Work can only be maintained by the Copyright Holder 234 | or simply that it is `author-maintained'. 235 | 236 | The Work has the status `maintained' if there is a Current Maintainer 237 | who has indicated in the Work that they are willing to receive error 238 | reports for the Work (for example, by supplying a valid e-mail 239 | address). It is not required for the Current Maintainer to acknowledge 240 | or act upon these error reports. 241 | 242 | The Work changes from status `maintained' to `unmaintained' if there 243 | is no Current Maintainer, or the person stated to be Current 244 | Maintainer of the work cannot be reached through the indicated means 245 | of communication for a period of six months, and there are no other 246 | significant signs of active maintenance. 247 | 248 | You can become the Current Maintainer of the Work by agreement with 249 | any existing Current Maintainer to take over this role. 250 | 251 | If the Work is unmaintained, you can become the Current Maintainer of 252 | the Work through the following steps: 253 | 254 | 1. Make a reasonable attempt to trace the Current Maintainer (and 255 | the Copyright Holder, if the two differ) through the means of 256 | an Internet or similar search. 257 | 258 | 2. If this search is successful, then enquire whether the Work 259 | is still maintained. 260 | 261 | a. If it is being maintained, then ask the Current Maintainer 262 | to update their communication data within one month. 263 | 264 | b. If the search is unsuccessful or no action to resume active 265 | maintenance is taken by the Current Maintainer, then announce 266 | within the pertinent community your intention to take over 267 | maintenance. (If the Work is a LaTeX work, this could be 268 | done, for example, by posting to comp.text.tex.) 269 | 270 | 3a. If the Current Maintainer is reachable and agrees to pass 271 | maintenance of the Work to you, then this takes effect 272 | immediately upon announcement. 273 | 274 | b. If the Current Maintainer is not reachable and the Copyright 275 | Holder agrees that maintenance of the Work be passed to you, 276 | then this takes effect immediately upon announcement. 277 | 278 | 4. If you make an `intention announcement' as described in 2b. above 279 | and after three months your intention is challenged neither by 280 | the Current Maintainer nor by the Copyright Holder nor by other 281 | people, then you may arrange for the Work to be changed so as 282 | to name you as the (new) Current Maintainer. 283 | 284 | 5. If the previously unreachable Current Maintainer becomes 285 | reachable once more within three months of a change completed 286 | under the terms of 3b) or 4), then that Current Maintainer must 287 | become or remain the Current Maintainer upon request provided 288 | they then update their communication data within one month. 289 | 290 | A change in the Current Maintainer does not, of itself, alter the fact 291 | that the Work is distributed under the LPPL license. 292 | 293 | If you become the Current Maintainer of the Work, you should 294 | immediately provide, within the Work, a prominent and unambiguous 295 | statement of your status as Current Maintainer. You should also 296 | announce your new status to the same pertinent community as 297 | in 2b) above. 298 | 299 | 300 | WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE 301 | ====================================================== 302 | 303 | This section contains important instructions, examples, and 304 | recommendations for authors who are considering distributing their 305 | works under this license. These authors are addressed as `you' in 306 | this section. 307 | 308 | Choosing This License or Another License 309 | ---------------------------------------- 310 | 311 | If for any part of your work you want or need to use *distribution* 312 | conditions that differ significantly from those in this license, then 313 | do not refer to this license anywhere in your work but, instead, 314 | distribute your work under a different license. You may use the text 315 | of this license as a model for your own license, but your license 316 | should not refer to the LPPL or otherwise give the impression that 317 | your work is distributed under the LPPL. 318 | 319 | The document `modguide.tex' in the base LaTeX distribution explains 320 | the motivation behind the conditions of this license. It explains, 321 | for example, why distributing LaTeX under the GNU General Public 322 | License (GPL) was considered inappropriate. Even if your work is 323 | unrelated to LaTeX, the discussion in `modguide.tex' may still be 324 | relevant, and authors intending to distribute their works under any 325 | license are encouraged to read it. 326 | 327 | A Recommendation on Modification Without Distribution 328 | ----------------------------------------------------- 329 | 330 | It is wise never to modify a component of the Work, even for your own 331 | personal use, without also meeting the above conditions for 332 | distributing the modified component. While you might intend that such 333 | modifications will never be distributed, often this will happen by 334 | accident -- you may forget that you have modified that component; or 335 | it may not occur to you when allowing others to access the modified 336 | version that you are thus distributing it and violating the conditions 337 | of this license in ways that could have legal implications and, worse, 338 | cause problems for the community. It is therefore usually in your 339 | best interest to keep your copy of the Work identical with the public 340 | one. Many works provide ways to control the behavior of that work 341 | without altering any of its licensed components. 342 | 343 | How to Use This License 344 | ----------------------- 345 | 346 | To use this license, place in each of the components of your work both 347 | an explicit copyright notice including your name and the year the work 348 | was authored and/or last substantially modified. Include also a 349 | statement that the distribution and/or modification of that 350 | component is constrained by the conditions in this license. 351 | 352 | Here is an example of such a notice and statement: 353 | 354 | %% pig.dtx 355 | %% Copyright 2005 M. Y. Name 356 | % 357 | % This work may be distributed and/or modified under the 358 | % conditions of the LaTeX Project Public License, either version 1.3 359 | % of this license or (at your option) any later version. 360 | % The latest version of this license is in 361 | % http://www.latex-project.org/lppl.txt 362 | % and version 1.3 or later is part of all distributions of LaTeX 363 | % version 2005/12/01 or later. 364 | % 365 | % This work has the LPPL maintenance status `maintained'. 366 | % 367 | % The Current Maintainer of this work is M. Y. Name. 368 | % 369 | % This work consists of the files pig.dtx and pig.ins 370 | % and the derived file pig.sty. 371 | 372 | Given such a notice and statement in a file, the conditions 373 | given in this license document would apply, with the `Work' referring 374 | to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being 375 | generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' 376 | referring to any `LaTeX-Format', and both `Copyright Holder' and 377 | `Current Maintainer' referring to the person `M. Y. Name'. 378 | 379 | If you do not want the Maintenance section of LPPL to apply to your 380 | Work, change `maintained' above into `author-maintained'. 381 | However, we recommend that you use `maintained', as the Maintenance 382 | section was added in order to ensure that your Work remains useful to 383 | the community even when you can no longer maintain and support it 384 | yourself. 385 | 386 | Derived Works That Are Not Replacements 387 | --------------------------------------- 388 | 389 | Several clauses of the LPPL specify means to provide reliability and 390 | stability for the user community. They therefore concern themselves 391 | with the case that a Derived Work is intended to be used as a 392 | (compatible or incompatible) replacement of the original Work. If 393 | this is not the case (e.g., if a few lines of code are reused for a 394 | completely different task), then clauses 6b and 6d shall not apply. 395 | 396 | 397 | Important Recommendations 398 | ------------------------- 399 | 400 | Defining What Constitutes the Work 401 | 402 | The LPPL requires that distributions of the Work contain all the 403 | files of the Work. It is therefore important that you provide a 404 | way for the licensee to determine which files constitute the Work. 405 | This could, for example, be achieved by explicitly listing all the 406 | files of the Work near the copyright notice of each file or by 407 | using a line such as: 408 | 409 | % This work consists of all files listed in manifest.txt. 410 | 411 | in that place. In the absence of an unequivocal list it might be 412 | impossible for the licensee to determine what is considered by you 413 | to comprise the Work and, in such a case, the licensee would be 414 | entitled to make reasonable conjectures as to which files comprise 415 | the Work. 416 | 417 | -------------------------------------------------------------------------------- /moeptikz.sty: -------------------------------------------------------------------------------- 1 | %% moeptikz.sty 2 | %% Copyright 2015 Stephan M. Guenther 3 | % 4 | % This work may be distributed and/or modified under the % conditions of the 5 | % LaTeX Project Public License, either version 1.3 % of this license or (at 6 | % your option) any later version. The latest version of this license is in 7 | % http://www.latex-project.org/lppl.txt 8 | % and version 1.3 or later is part of all distributions of LaTeX version 9 | % 2005/12/01 or later. 10 | % 11 | % This work has the LPPL maintenance status `maintained'. 12 | % 13 | % The current maintainer of this work is Stephan M. Guenther. 14 | % 15 | % This work consists of the files moeptikz.sty and documentation.tex. 16 | 17 | \NeedsTeXFormat{LaTeX2e} 18 | \ProvidesPackage{moeptikz}[2016/04/06 moepTikZ] 19 | 20 | \RequirePackage{ifthen} 21 | \RequirePackage{xparse} 22 | \RequirePackage{tikz} 23 | \RequirePackage{makeshape} 24 | 25 | \usetikzlibrary{patterns} 26 | 27 | \DeclareDocumentCommand{\tikzextractx}{m m}{% 28 | \tikz@scan@one@point\pgfutil@firstofone#1\relax% 29 | \edef#2{\the\pgf@x}% 30 | }% 31 | \DeclareDocumentCommand{\tikzextracty}{m m}{% 32 | \tikz@scan@one@point\pgfutil@firstofone#1\relax% 33 | \edef#2{\the\pgf@y}% 34 | }% 35 | 36 | % http://tex.stackexchange.com/questions/218968/how-to-save-the-current-color-in-pgf-tikz 37 | \tikzset{get stroke color/.code={% 38 | \expandafter\global% 39 | \expandafter\let% 40 | \expandafter\pgfsavedstrokecolor% 41 | \csname\string\color@pgfstrokecolor\endcsname% 42 | },% 43 | restore stroke color/.code={\pgf@setstrokecolor#1},% 44 | replace fill by stroke color/.code={\pgf@setfillcolor#1},% 45 | } 46 | \tikzset{get fill color/.code={% 47 | \expandafter\global% 48 | \expandafter\let% 49 | \expandafter\pgfsavedfillcolor% 50 | \csname\string\color@pgffillcolor\endcsname% 51 | },% 52 | restore fill color/.code={\pgf@setfillcolor#1},% 53 | replace stroke by fill color/.code={\pgf@setstrokecolor#1},% 54 | } 55 | 56 | \def\tikz@fillcolor{black} 57 | \newif\ifmoeptikz@shading 58 | \define@key{moeptikz}{shading}{% 59 | \ifthenelse{\equal{#1}{true}}{% 60 | \moeptikz@shadingtrue% 61 | }{% 62 | \moeptikz@shadingfalse% 63 | }% 64 | } 65 | 66 | \DeclareDocumentCommand{\moeptikz@setshading}{}{% 67 | \ifmoeptikz@shading% 68 | \pgfdeclareradialshading{moeptikz@shading}{\pgfpoint{-25bp}{-25bp}}{% 69 | rgb(0bp)=(1,1,1); 70 | color(20bp)=(\tikz@fillcolor!20); 71 | color(50bp)=(\tikz@fillcolor!60) 72 | } 73 | \pgfdeclareradialshading{moeptikz@shadingnuc}{\pgfpoint{-25bp}{-25bp}}{% 74 | rgb(0bp)=(1,1,1); 75 | color(20bp)=(\tikz@fillcolor!70); 76 | color(50bp)=(\tikz@fillcolor!90) 77 | } 78 | \else% 79 | \pgfdeclareradialshading{moeptikz@shading}{\pgfpoint{0}{0}}{% 80 | color(0bp)=(\tikz@fillcolor!30); 81 | color(100bp)=(\tikz@fillcolor!30) 82 | } 83 | \pgfdeclareradialshading{moeptikz@shadingnuc}{\pgfpoint{0}{0}}{% 84 | color(0bp)=(\tikz@fillcolor!70); 85 | color(100bp)=(\tikz@fillcolor!70) 86 | } 87 | \fi% 88 | } 89 | 90 | \DeclareDocumentCommand{\moeptikzset}{m}{% 91 | \setkeys{moeptikz}{#1}% 92 | } 93 | 94 | \moeptikzset{shading=true} 95 | 96 | \DeclareOption{shading}{\moeptikzset{shading=true}} 97 | \DeclareOption{noshading}{\moeptikzset{shading=false}} 98 | \ProcessOptions*\relax 99 | 100 | 101 | 102 | %============================================================================== 103 | % server 104 | %============================================================================== 105 | \def\serveranchor{ 106 | \pgf@xa=\pgfshapeminwidth 107 | \pgf@ya=\pgfshapeminwidth 108 | \pgf@xa=.5\pgf@xa 109 | \pgf@ya=.5\pgf@ya 110 | 111 | \pgfpathmoveto{\pgfpoint{.75\pgf@xa}{.4\pgf@ya}} 112 | \pgfpathlineto{\pgfpoint{-.75\pgf@xa}{.4\pgf@ya}} 113 | \pgfpathlineto{\pgfpoint{-.97\pgf@xa}{-.18\pgf@ya}} 114 | \pgfpathlineto{\pgfpoint{-.99\pgf@xa}{-.18\pgf@ya}} 115 | \pgfpathlineto{\pgfpoint{-.99\pgf@xa}{-.4\pgf@ya}} 116 | \pgfpathlineto{\pgfpoint{.99\pgf@xa}{-.4\pgf@ya}} 117 | \pgfpathlineto{\pgfpoint{.99\pgf@xa}{-.18\pgf@ya}} 118 | \pgfpathlineto{\pgfpoint{.97\pgf@xa}{-.18\pgf@ya}} 119 | \pgfpathclose 120 | } 121 | \def\serverborder{ 122 | \moeptikz@setshading 123 | \pgfmathparse{.004*\pgfshapeminwidth}\let\linewidth\pgfmathresult 124 | \pgfmathparse{.008*\pgfshapeminwidth}\let\linewidthlarge\pgfmathresult 125 | \pgfmathparse{.005*\pgfshapeminwidth}\let\cornerarc\pgfmathresult 126 | \pgfmathparse{.04*sqrt(\pgfshapeminwidth)}\let\fontwidth\pgfmathresult 127 | 128 | % Front 129 | \pgfsetstrokecolor{black!40} 130 | \pgfsetfillcolor{black!40} 131 | \pgfpathrectanglecorners{\northeast \pgf@y=-.2\pgf@y}{\northeast \pgf@x=-\pgf@x \pgf@y=-.4\pgf@y} 132 | \pgfshadepath{moeptikz@shading}{-25} 133 | \pgfusepath{} 134 | 135 | \pgfsetstrokecolor{black!40} 136 | \pgfmoveto{\northeast \pgf@y=-.2\pgf@y} 137 | \pgflineto{\northeast \pgf@x=-\pgf@x \pgf@y=-.2\pgf@y} 138 | \pgflineto{\northeast \pgf@x=-.99\pgf@x \pgf@y=-.18\pgf@y} 139 | \pgflineto{\northeast \pgf@x=.99\pgf@x \pgf@y=-.18\pgf@y} 140 | \pgfclosepath 141 | \pgfshadepath{moeptikz@shading}{-25} 142 | \pgfusepath{} 143 | 144 | % Deckel 145 | \pgfmoveto{\northeast \pgf@x=.75\pgf@x \pgf@y=.4\pgf@y} 146 | \pgflineto{\northeast \pgf@x=.97\pgf@x \pgf@y=-.18\pgf@y} 147 | \pgflineto{\northeast \pgf@x=-.97\pgf@x \pgf@y=-.18\pgf@y} 148 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=.4\pgf@y} 149 | \pgfclosepath 150 | \pgfshadepath{moeptikz@shading}{11.5} 151 | \pgfusepath{} 152 | 153 | % Amaturen 154 | \pgfsetstrokecolor{black} 155 | \pgfsetlinewidth{1.5*\linewidth} 156 | \pgfsetcornersarced{\pgfpoint{\cornerarc}{\cornerarc}} 157 | \pgfmoveto{\northeast \pgf@x=-.9\pgf@x \pgf@y=-.4\pgf@y} 158 | \pgflineto{\northeast \pgf@x=-.9\pgf@x \pgf@y=-.28\pgf@y} 159 | \pgflineto{\northeast \pgf@x=.9\pgf@x \pgf@y=-.28\pgf@y} 160 | \pgflineto{\northeast \pgf@x=.9\pgf@x \pgf@y=-.4\pgf@y} 161 | \pgfusepath{stroke} 162 | 163 | \pgfmoveto{\northeast \pgf@x=-.895\pgf@x \pgf@y=-.4\pgf@y} 164 | \pgflineto{\northeast \pgf@x=-.895\pgf@x \pgf@y=-.28\pgf@y} 165 | \pgfusepath{stroke} 166 | 167 | \pgfmoveto{\northeast \pgf@x=.895\pgf@x \pgf@y=-.4\pgf@y} 168 | \pgflineto{\northeast \pgf@x=.895\pgf@x \pgf@y=-.28\pgf@y} 169 | \pgfusepath{stroke} 170 | 171 | \pgfsetlinewidth{2*\linewidth} 172 | \pgfmoveto{\northeast \pgf@x=-.44\pgf@x \pgf@y=-.4\pgf@y} 173 | \pgflineto{\northeast \pgf@x=-.44\pgf@x \pgf@y=-.28\pgf@y} 174 | \pgfusepath{stroke} 175 | \pgfmoveto{\northeast \pgf@x=-.225\pgf@x \pgf@y=-.4\pgf@y} 176 | \pgflineto{\northeast \pgf@x=-.225\pgf@x \pgf@y=-.28\pgf@y} 177 | \pgfusepath{stroke} 178 | \pgfmoveto{\northeast \pgf@x=.225\pgf@x \pgf@y=-.4\pgf@y} 179 | \pgflineto{\northeast \pgf@x=.225\pgf@x \pgf@y=-.28\pgf@y} 180 | \pgfusepath{stroke} 181 | \pgfmoveto{\northeast \pgf@x=.44\pgf@x \pgf@y=-.4\pgf@y} 182 | \pgflineto{\northeast \pgf@x=.44\pgf@x \pgf@y=-.28\pgf@y} 183 | \pgfusepath{stroke} 184 | 185 | % optical drive 186 | \pgfsetfillcolor{black} 187 | \pgfpathrectanglecorners{\northeast \pgf@x=.9\pgf@x \pgf@y=-.22\pgf@y}{\northeast \pgf@x=.34\pgf@x \pgf@y=-.24\pgf@y} 188 | \pgfusepath{fill} 189 | 190 | % schlitze front oben 191 | \pgfpathrectanglecorners{\northeast \pgf@x=.3\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=.285\pgf@x \pgf@y=-.26\pgf@y} 192 | \pgfusepath{fill} 193 | \pgfpathrectanglecorners{\northeast \pgf@x=.26\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=.245\pgf@x \pgf@y=-.26\pgf@y} 194 | \pgfusepath{fill} 195 | \pgfpathrectanglecorners{\northeast \pgf@x=.22\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=.205\pgf@x \pgf@y=-.26\pgf@y} 196 | \pgfusepath{fill} 197 | \pgfpathrectanglecorners{\northeast \pgf@x=.18\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=.165\pgf@x \pgf@y=-.26\pgf@y} 198 | \pgfusepath{fill} 199 | \pgfpathrectanglecorners{\northeast \pgf@x=.14\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=.125\pgf@x \pgf@y=-.26\pgf@y} 200 | \pgfusepath{fill} 201 | \pgfpathrectanglecorners{\northeast \pgf@x=.10\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=.085\pgf@x \pgf@y=-.26\pgf@y} 202 | \pgfusepath{fill} 203 | \pgfpathrectanglecorners{\northeast \pgf@x=.06\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=.045\pgf@x \pgf@y=-.26\pgf@y} 204 | \pgfusepath{fill} 205 | 206 | \pgfpathrectanglecorners{\northeast \pgf@x=-.3\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=-.285\pgf@x \pgf@y=-.26\pgf@y} 207 | \pgfusepath{fill} 208 | \pgfpathrectanglecorners{\northeast \pgf@x=-.26\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=-.245\pgf@x \pgf@y=-.26\pgf@y} 209 | \pgfusepath{fill} 210 | \pgfpathrectanglecorners{\northeast \pgf@x=-.22\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=-.205\pgf@x \pgf@y=-.26\pgf@y} 211 | \pgfusepath{fill} 212 | \pgfpathrectanglecorners{\northeast \pgf@x=-.18\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=-.165\pgf@x \pgf@y=-.26\pgf@y} 213 | \pgfusepath{fill} 214 | \pgfpathrectanglecorners{\northeast \pgf@x=-.14\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=-.125\pgf@x \pgf@y=-.26\pgf@y} 215 | \pgfusepath{fill} 216 | \pgfpathrectanglecorners{\northeast \pgf@x=-.10\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=-.085\pgf@x \pgf@y=-.26\pgf@y} 217 | \pgfusepath{fill} 218 | \pgfpathrectanglecorners{\northeast \pgf@x=-.06\pgf@x \pgf@y=-.21\pgf@y}{\northeast \pgf@x=-.045\pgf@x \pgf@y=-.26\pgf@y} 219 | \pgfusepath{fill} 220 | 221 | % Lichter 222 | \pgfsetfillcolor{cyan} 223 | \pgfpathcircle{\northeast \pgf@x=-.35\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 224 | \pgfusepath{fill} 225 | \pgfpathcircle{\northeast \pgf@x=-.375\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 226 | \pgfusepath{fill} 227 | \pgfpathcircle{\northeast \pgf@x=-.4\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 228 | \pgfusepath{fill} 229 | \pgfpathcircle{\northeast \pgf@x=-.425\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 230 | \pgfusepath{fill} 231 | \pgfpathcircle{\northeast \pgf@x=-.45\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 232 | \pgfusepath{fill} 233 | \pgfsetfillcolor{black} 234 | \pgfpathcircle{\northeast \pgf@x=-.475\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 235 | \pgfusepath{fill} 236 | \pgfpathcircle{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 237 | \pgfusepath{fill} 238 | \pgfpathcircle{\northeast \pgf@x=-.525\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 239 | \pgfusepath{fill} 240 | \pgfpathcircle{\northeast \pgf@x=-.55\pgf@x \pgf@y=-.22\pgf@y}{.5\pgflinewidth} 241 | \pgfusepath{fill} 242 | 243 | \pgfsetfillcolor{cyan} 244 | \pgfpathcircle{\northeast \pgf@x=-.35\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 245 | \pgfusepath{fill} 246 | \pgfpathcircle{\northeast \pgf@x=-.375\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 247 | \pgfusepath{fill} 248 | \pgfpathcircle{\northeast \pgf@x=-.4\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 249 | \pgfusepath{fill} 250 | \pgfpathcircle{\northeast \pgf@x=-.425\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 251 | \pgfusepath{fill} 252 | \pgfsetfillcolor{black} 253 | \pgfpathcircle{\northeast \pgf@x=-.45\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 254 | \pgfusepath{fill} 255 | \pgfpathcircle{\northeast \pgf@x=-.475\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 256 | \pgfusepath{fill} 257 | \pgfpathcircle{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 258 | \pgfusepath{fill} 259 | \pgfpathcircle{\northeast \pgf@x=-.525\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 260 | \pgfusepath{fill} 261 | \pgfpathcircle{\northeast \pgf@x=-.55\pgf@x \pgf@y=-.24\pgf@y}{.5\pgflinewidth} 262 | \pgfusepath{fill} 263 | \pgfdeclareverticalshading{xserveEject}{100bp}{color(0bp)=(black); color(100bp)=(black!70)} 264 | \pgfsetcornersarced{\pgfpoint{0pt}{0pt}} 265 | \pgfsetfillcolor{black} 266 | \pgfpathrectanglecorners{\northeast \pgf@x=-.425\pgf@x \pgf@y=-.3925\pgf@y}{\northeast \pgf@x=-.24\pgf@x \pgf@y=-.2925\pgf@y} 267 | \pgfshadepath{xserveEject}{180} 268 | \pgfusepath{} 269 | 270 | \pgfsetcornersarced{\pgfpoint{0pt}{0pt}} 271 | \pgfsetfillcolor{black} 272 | \pgfpathrectanglecorners{\northeast \pgf@x=.425\pgf@x \pgf@y=-.3925\pgf@y}{\northeast \pgf@x=.24\pgf@x \pgf@y=-.2925\pgf@y} 273 | \pgfshadepath{xserveEject}{180} 274 | \pgfusepath{} 275 | } 276 | \pgfdeclareshape{@server}{ 277 | \setpaths{\serveranchor}{\serverborder} 278 | \savedanchor\northeast{% 279 | \pgf@x = \pgfshapeminwidth 280 | \pgf@y = \pgfshapeminwidth 281 | \pgf@x=.5\pgf@x 282 | \pgf@y=.5\pgf@y 283 | } 284 | \savedanchor\southwest{% 285 | \pgf@x = \pgfshapeminwidth 286 | \pgf@y = \pgfshapeminwidth 287 | \pgf@x=-.5\pgf@x 288 | \pgf@y=-.5\pgf@y 289 | } 290 | \anchor{north}{\northeast \pgf@y=.4\pgf@y \pgf@x=0pt} 291 | \anchor{north east}{\northeast \pgf@x=.75\pgf@x \pgf@y=.4\pgf@y} 292 | \anchor{north west}{\northeast \pgf@x=-.75\pgf@x \pgf@y=.4\pgf@y} 293 | \anchor{east}{\northeast \pgf@x=.9\pgf@x \pgf@y=0pt} 294 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-.4\pgf@y} 295 | \anchor{south east}{\northeast \pgf@y=-.4\pgf@y} 296 | \anchor{south west}{\northeast \pgf@x=-\pgf@x \pgf@y=-.4\pgf@y} 297 | \anchor{west}{\northeast \pgf@x=-.9\pgf@x \pgf@y=0pt} 298 | \anchor{text}{ 299 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 300 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 301 | \pgf@x=0pt 302 | \pgf@y=-.5\pgf@y 303 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 304 | \advance\pgf@y by -\ht\pgfnodeparttextbox 305 | } 306 | } 307 | 308 | \tikzset{ 309 | server/.style 2 args={ 310 | shape=@server, 311 | minimum size=#1, 312 | fill=#2 313 | }, 314 | server/.default={1cm}{black} 315 | } 316 | 317 | 318 | %============================================================================== 319 | % client 320 | %============================================================================== 321 | \def\clientanchor{ 322 | \pgf@xa=\pgfshapeminwidth 323 | \pgf@ya=\pgfshapeminwidth 324 | \pgf@xa=.5\pgf@xa 325 | \pgf@ya=.5\pgf@ya 326 | 327 | \pgfpathmoveto{\pgfpoint{\pgf@xa}{.79\pgf@ya}} 328 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{.79\pgf@ya}} 329 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{-.5\pgf@ya}} 330 | \pgfpathlineto{\pgfpoint{-.25\pgf@xa}{-.5\pgf@ya}} 331 | \pgfpathlineto{\pgfpoint{-.25\pgf@xa}{-.79\pgf@ya}} 332 | \pgfpathlineto{\pgfpoint{-.4\pgf@xa}{-\pgf@ya}} 333 | \pgfpathlineto{\pgfpoint{.1\pgf@xa}{-\pgf@ya}} 334 | \pgfpathlineto{\pgfpoint{.25\pgf@xa}{-.79\pgf@ya}} 335 | \pgfpathlineto{\pgfpoint{.25\pgf@xa}{-.5\pgf@ya}} 336 | \pgfpathlineto{\pgfpoint{1.02\pgf@xa}{-.5\pgf@ya}} 337 | \pgfpathclose 338 | } 339 | \def\clientborder{ 340 | \moeptikz@setshading 341 | \pgfmathparse{.005*\pgfshapeminwidth}\let\linewidth\pgfmathresult 342 | \pgfmathparse{.01*\pgfshapeminwidth}\let\linewidthlarge\pgfmathresult 343 | \pgfmathparse{.01*\pgfshapeminwidth}\let\cornerarc\pgfmathresult 344 | \pgfmathparse{.01*\pgfshapeminwidth}\let\cornerarclarge\pgfmathresult 345 | \pgfmathparse{.04*sqrt(\pgfshapeminwidth)}\let\fontwidth\pgfmathresult 346 | \pgfsetcornersarced{\pgfpoint{\cornerarc}{\cornerarc}} 347 | 348 | \pgfsetstrokecolor{black!40} 349 | \pgfpathmoveto{\southwest \pgf@x=.98\pgf@x \pgf@y=.50\pgf@y} 350 | \pgfpathlineto{\southwest \pgf@y=.48\pgf@y} 351 | \pgfusepath{stroke} 352 | 353 | \pgfsetstrokecolor{black!40} 354 | \pgfpathmoveto{\northeast \pgf@y=.73\pgf@y} 355 | \pgfpathlineto{\northeast \pgf@x=.98\pgf@x \pgf@y=.75\pgf@y} 356 | \pgfusepath{stroke} 357 | 358 | \pgfsetlinewidth{\linewidthlarge} 359 | % Standfuss 360 | \pgfsetcornersarced{\pgfpoint{\cornerarclarge}{\cornerarclarge}} 361 | \pgfpathmoveto{\southwest \pgf@x=.25\pgf@x \pgf@y=0\pgf@y} 362 | \pgfpathlineto{\southwest \pgf@x=-.25\pgf@x \pgf@y=0\pgf@y} 363 | \pgfpathlineto{\southwest \pgf@x=-.25\pgf@x \pgf@y=.75\pgf@y} 364 | \pgfpathlineto{\southwest \pgf@x=-.10\pgf@x} 365 | \pgfpathlineto{\southwest \pgf@x=.40\pgf@x} 366 | \pgfpathlineto{\southwest \pgf@x=.25\pgf@x \pgf@y=.75\pgf@y} 367 | \pgfpathlineto{\southwest \pgf@x=.25\pgf@x \pgf@y=.55\pgf@y} 368 | \pgfclosepath 369 | \pgfshadepath{moeptikz@shading}{-33} 370 | \pgfusepath{stroke} 371 | 372 | \pgfsetlinewidth{1pt} 373 | % 3D Display Rahmen 374 | \pgfsetcornersarced{\pgfpoint{\cornerarc}{\cornerarc}} 375 | \pgfsetstrokecolor{black!40} 376 | \pgfsetfillcolor{black!40} 377 | \pgfpathrectanglecorners{\southwest \pgf@x=.99\pgf@x \pgf@y=.47\pgf@y} 378 | {\northeast \pgf@y=.77\pgf@y} 379 | \pgfusepath{stroke,fill} 380 | 381 | % Schwarzer aeusserer Monitorrahmen 382 | \pgfsetstrokecolor{black} 383 | \pgfsetfillcolor{black} 384 | \pgfpathrectanglecorners{\southwest \pgf@y=.48\pgf@y}{\northeast \pgf@x=.98\pgf@x \pgf@y=.75\pgf@y} 385 | \pgfusepath{stroke,fill} 386 | 387 | % Displayflaeche 388 | \pgfsetfillcolor{black!90} 389 | \pgfpathrectanglecorners{\southwest \pgf@x=.95\pgf@x \pgf@y=.43\pgf@y}{\northeast \pgf@x=.93\pgf@x \pgf@y=.70\pgf@y} 390 | \pgfusepath{stroke,fill} 391 | 392 | \pgfpathrectanglecorners{\southwest \pgf@x=.95\pgf@x \pgf@y=.43\pgf@y}{\northeast \pgf@x=.93\pgf@x \pgf@y=.70\pgf@y} 393 | \pgfshadepath{moeptikz@shadingnuc}{180} 394 | \pgfusepath{} 395 | } 396 | \pgfdeclareshape{@client}{ 397 | \setpaths{\clientanchor}{\clientborder} 398 | \savedanchor\northeast{% 399 | \pgf@x = \pgfshapeminwidth 400 | \pgf@y = \pgfshapeminwidth 401 | \pgf@x=.5\pgf@x 402 | \pgf@y=.5\pgf@y 403 | } 404 | \savedanchor\southwest{% 405 | \pgf@x = \pgfshapeminwidth 406 | \pgf@y = \pgfshapeminwidth 407 | \pgf@x=-.5\pgf@x 408 | \pgf@y=-.5\pgf@y 409 | } 410 | \anchor{north}{\northeast \pgf@y=.75\pgf@y \pgf@x=0pt} 411 | \anchor{north east}{\northeast \pgf@x=.5\pgf@x \pgf@y=.625\pgf@y} 412 | \anchor{north west}{\northeast \pgf@x=-.5\pgf@x \pgf@y=.625\pgf@y} 413 | \anchor{east}{\northeast \pgf@y=0pt} 414 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 415 | \anchor{south east}{\northeast \pgf@x=.5\pgf@x \pgf@y=-.55\pgf@y} 416 | \anchor{south west}{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.55\pgf@y} 417 | \anchor{west}{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 418 | \anchor{text}{ 419 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 420 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 421 | \pgf@x=0pt 422 | \pgf@y=-.75\pgf@y 423 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 424 | \advance\pgf@y by -\ht\pgfnodeparttextbox 425 | } 426 | } 427 | 428 | \tikzset{ 429 | client/.style 2 args={ 430 | shape=@client, 431 | minimum size=#1, 432 | fill=#2 433 | }, 434 | client/.default={1cm}{black} 435 | } 436 | 437 | 438 | %============================================================================== 439 | % notebook 440 | %============================================================================== 441 | \def\tx{0} 442 | \def\ty{0} 443 | \def\tz{0} 444 | \def\vx{10} 445 | \def\vy{15} 446 | \def\vz{-10} 447 | \pgfmathparse{cos(-\tx)} 448 | \edef\cx{\pgfmathresult} 449 | \pgfmathparse{cos(-\ty)} 450 | \edef\cy{\pgfmathresult} 451 | \pgfmathparse{cos(-\tz)} 452 | \edef\cz{\pgfmathresult} 453 | \pgfmathparse{sin(-\tx)} 454 | \edef\sx{\pgfmathresult} 455 | \pgfmathparse{sin(-\ty)} 456 | \edef\sy{\pgfmathresult} 457 | \pgfmathparse{sin(-\tz)} 458 | \edef\sz{\pgfmathresult} 459 | \newcommand{\moeptikz@transform}[3]{% 460 | \pgfmathparse{\cy*(\sz*(#2-\vy)+\cz*(#1-\vx))-\sy*(#3-\vz)} 461 | \edef\dx{\pgfmathresult} 462 | \pgfmathparse{\sx*(\cy*(#3-\vz)+\sy*(\sz*(#2-\vy)+\cz*(#1-\vx)))+\cx*(\cz*(#2-\vy)-\sz*(#1-\vx)} 463 | \edef\dy{\pgfmathresult} 464 | \pgfmathparse{\cx*(\cy*(#3-\vz)+\sy*(\sz*(#2-\vy)+\cz*(#1-\vx)))-\sx*(\cz*(#2-\vy)-\sz*(#1-\vx))} 465 | \edef\dz{\pgfmathresult} 466 | \pgfmathparse{\dx/\dz} 467 | \pgf@x=\pgfmathresult\pgf@x 468 | \pgfmathparse{\dy/\dz} 469 | \pgf@y=\pgfmathresult\pgf@y 470 | } 471 | \newcommand{\moeptikz@transforma}[3]{% 472 | \pgfmathparse{\cy*(\sz*(#2-\vy)+\cz*(#1-\vx))-\sy*(#3-\vz)} 473 | \edef\dx{\pgfmathresult} 474 | \pgfmathparse{\sx*(\cy*(#3-\vz)+\sy*(\sz*(#2-\vy)+\cz*(#1-\vx)))+\cx*(\cz*(#2-\vy)-\sz*(#1-\vx)} 475 | \edef\dy{\pgfmathresult} 476 | \pgfmathparse{\cx*(\cy*(#3-\vz)+\sy*(\sz*(#2-\vy)+\cz*(#1-\vx)))-\sx*(\cz*(#2-\vy)-\sz*(#1-\vx))} 477 | \edef\dz{\pgfmathresult} 478 | \pgfmathparse{\dx/\dz} 479 | \pgf@xa=\pgfmathresult\pgf@xa 480 | \pgfmathparse{\dy/\dz} 481 | \pgf@ya=\pgfmathresult\pgf@ya 482 | } 483 | 484 | \newcommand\moeptikz@dim[3]{% 485 | \pgf@x=\pgf@xa 486 | \pgf@y=\pgf@ya 487 | \moeptikz@transform{#1}{#2}{#3} 488 | \pgfpoint{\pgf@x}{\pgf@y} 489 | } 490 | 491 | \newcommand\moeptikz@point[3]{% 492 | \northeast 493 | \moeptikz@transform{#1}{#2}{#3} 494 | \pgfpoint{\pgf@x}{\pgf@y} 495 | } 496 | 497 | \def\notebookanchor{ 498 | \pgf@xa=\pgfshapeminwidth 499 | \pgf@ya=\pgfshapeminwidth 500 | \pgf@xa=.5\pgf@xa 501 | \pgf@ya=.5\pgf@ya 502 | \edef\moeptikz@scale{10} 503 | \pgfmathparse{0.1*\moeptikz@scale*\vx} 504 | \edef\moeptikz@xscale{\pgfmathresult} 505 | \pgfmathparse{0.1*\moeptikz@scale*\vy} 506 | \edef\moeptikz@yscale{\pgfmathresult} 507 | \pgftransformxscale{\moeptikz@scale} 508 | \pgftransformyscale{\moeptikz@scale} 509 | \pgfmathparse{-\vx/\vz-1/(\vx*\vz)} 510 | \edef\moeptikz@vxvz{\pgfmathresult} 511 | \pgfmathparse{-\vy/\vz} 512 | \edef\moeptikz@vyvz{\pgfmathresult} 513 | \pgftransformshift{\pgfpoint{\moeptikz@vxvz\pgf@xa}{\moeptikz@vyvz\pgf@ya}} 514 | \pgfmoveto{\moeptikz@dim{-1.0}{1.1}{-.1}} 515 | \pgflineto{\moeptikz@dim{-1.0}{0}{-.1}} 516 | \pgflineto{\moeptikz@dim{-1.0}{0}{-.5}} 517 | \pgflineto{\moeptikz@dim{1.0}{0}{-.5}} 518 | \pgflineto{\moeptikz@dim{1.0}{0}{-.1}} 519 | \pgflineto{\moeptikz@dim{1.0}{1.1}{-.1}} 520 | \pgfclosepath 521 | \pgftransformreset 522 | } 523 | 524 | \def\notebookborder{ 525 | \moeptikz@setshading 526 | \pgfmathparse{.0025*\pgfshapeminwidth}\let\linewidth\pgfmathresult 527 | \pgfmathparse{.01*\pgfshapeminwidth}\let\linewidthlarge\pgfmathresult 528 | \pgfmathparse{.01*\pgfshapeminwidth}\let\cornerarc\pgfmathresult 529 | \pgfmathparse{.004*\pgfshapeminwidth}\let\cornerarcsmall\pgfmathresult 530 | \pgfmathparse{.04*sqrt(\pgfshapeminwidth)}\let\fontwidth\pgfmathresult 531 | 532 | \pgfsetcornersarced{\pgfpoint{\cornerarc}{\cornerarc}} 533 | \pgfsetlinewidth{\linewidth} 534 | 535 | % \pgfmoveto{\moeptikz@point{-1}{-1}} 536 | % \pgflineto{\moeptikz@point{1}{-1}} 537 | % \pgflineto{\moeptikz@point{1}{1}} 538 | % \pgflineto{\moeptikz@point{-1}{1}} 539 | % \pgfclosepath 540 | % \pgfusepath{fill} 541 | 542 | \edef\moeptikz@scale{10} 543 | \pgfmathparse{0.1*\moeptikz@scale*\vx} 544 | \edef\moeptikz@xscale{\pgfmathresult} 545 | \pgfmathparse{0.1*\moeptikz@scale*\vy} 546 | \edef\moeptikz@yscale{\pgfmathresult} 547 | \pgftransformxscale{\moeptikz@scale} 548 | \pgftransformyscale{\moeptikz@scale} 549 | \pgfmathparse{-\vx/\vz-1/(\vx*\vz)} 550 | \edef\moeptikz@vxvz{\pgfmathresult} 551 | \pgfmathparse{-\vy/\vz} 552 | \edef\moeptikz@vyvz{\pgfmathresult} 553 | \pgftransformshift{\northeast \pgfpoint{\moeptikz@vxvz\pgf@x}{\moeptikz@vyvz\pgf@y}} 554 | \pgfsetstrokecolor{red} 555 | 556 | % Kante vorne (simuliert durch darunterliegende Flaeche) 557 | \pgfsetfillcolor{black!40} 558 | \pgfmoveto{\moeptikz@point{-1.0}{-.05}{-.1}} 559 | \pgflineto{\moeptikz@point{1.01}{-.05}{-.1}} 560 | \pgflineto{\moeptikz@point{1.01}{-.01}{-.5}} 561 | \pgflineto{\moeptikz@point{-1.0}{-.01}{-.5}} 562 | \pgfclosepath 563 | \pgfusepath{fill} 564 | 565 | % Kante rechts 566 | \pgfsetfillcolor{black!40} 567 | \pgfmoveto{\moeptikz@point{1.01}{-0.01}{-.5}} 568 | \pgflineto{\moeptikz@point{1.01}{-.05}{-.1}} 569 | \pgflineto{\moeptikz@point{1.0}{0}{-.1}} 570 | \pgflineto{\moeptikz@point{1.0}{0}{-.5}} 571 | \pgfclosepath 572 | \pgfusepath{fill} 573 | 574 | % Tastaturflaeche 575 | \pgfsetfillcolor{black!20} 576 | \pgfsetstrokecolor{black!30} 577 | \pgfmoveto{\moeptikz@point{-1.0}{0}{-.1}} 578 | \pgflineto{\moeptikz@point{1.0}{0}{-.1}} 579 | \pgflineto{\moeptikz@point{1.0}{0}{-.5}} 580 | \pgflineto{\moeptikz@point{-1.0}{0}{-.5}} 581 | \pgfclosepath 582 | \pgfshadepath{moeptikz@shading}{180} 583 | \pgfsetfillcolor{black!20} 584 | \pgfsetstrokecolor{black!30} 585 | \pgfmoveto{\moeptikz@point{-1.0}{0}{-.1}} 586 | \pgflineto{\moeptikz@point{1.0}{0}{-.1}} 587 | \pgflineto{\moeptikz@point{1.0}{0}{-.5}} 588 | \pgflineto{\moeptikz@point{-1.0}{0}{-.5}} 589 | \pgfclosepath 590 | \pgfusepath{stroke} 591 | 592 | % 3D Effekt Bildschirm 593 | \pgfsetfillcolor{black!40} 594 | \pgfmoveto{\moeptikz@point{-1.0}{0}{-.1}} 595 | \pgflineto{\moeptikz@point{1.005}{0}{-.1}} 596 | \pgflineto{\moeptikz@point{1.005}{1.1}{-.1}} 597 | \pgflineto{\moeptikz@point{-1.0}{1.1}{-.1}} 598 | \pgfclosepath 599 | \pgfusepath{fill} 600 | 601 | % Schwarzer Bildschirmrahmen 602 | \pgfsetfillcolor{black} 603 | \pgfmoveto{\moeptikz@point{-1.0}{0}{-.1}} 604 | \pgflineto{\moeptikz@point{1.0}{0}{-.1}} 605 | \pgflineto{\moeptikz@point{1.0}{1.1}{-.1}} 606 | \pgflineto{\moeptikz@point{-1.0}{1.1}{-.1}} 607 | \pgfclosepath 608 | \pgfusepath{fill} 609 | 610 | % Displayflaeche 611 | \pgfsetfillcolor{black!90} 612 | \pgfmoveto{\moeptikz@point{-.95}{0.055}{-.1}} 613 | \pgflineto{\moeptikz@point{.95}{0.055}{-.1}} 614 | \pgflineto{\moeptikz@point{.95}{1.045}{-.1}} 615 | \pgflineto{\moeptikz@point{-.95}{1.045}{-.1}} 616 | \pgfclosepath 617 | \pgfshadepath{moeptikz@shadingnuc}{180} 618 | \pgfusepath{} 619 | 620 | % Trackpad 621 | \pgfsetfillcolor{black!30} 622 | \pgfmoveto{\moeptikz@point{-.4}{0}{-.33}} 623 | \pgflineto{\moeptikz@point{.4}{0}{-.33}} 624 | \pgflineto{\moeptikz@point{.4}{0}{-.49}} 625 | \pgflineto{\moeptikz@point{-.4}{0}{-.49}} 626 | \pgfclosepath 627 | \pgfusepath{stroke,fill} 628 | 629 | % Keyboard 630 | \pgfsetcornersarced{\pgfpoint{\cornerarcsmall}{\cornerarcsmall}} 631 | \foreach \x in {1,2,...,14} {% 632 | \pgfsetfillcolor{black} 633 | \pgfmathparse{-1.025+\x*0.13} 634 | \pgfmoveto{\moeptikz@point{\pgfmathresult}{0}{-.12}} 635 | \pgfmathparse{-1.025+\x*0.13+.1} 636 | \pgflineto{\moeptikz@point{\pgfmathresult}{0}{-.12}} 637 | \pgflineto{\moeptikz@point{\pgfmathresult}{0}{-.14}} 638 | \pgfmathparse{-1.025+\x*0.13} 639 | \pgflineto{\moeptikz@point{\pgfmathresult}{0}{-.14}} 640 | \pgfclosepath 641 | \pgfusepath{fill} 642 | } 643 | \foreach \x in {1,2,...,14} {% 644 | \foreach \z in {0,1,...,4} {% 645 | \pgfsetfillcolor{black} 646 | \pgfmathparse{-1.025+\x*0.13} 647 | \edef\moeptikz@tmpx{\pgfmathresult} 648 | \pgfmathparse{-.15-\z*0.035} 649 | \edef\moeptikz@tmpz{\pgfmathresult} 650 | \pgfmoveto{\moeptikz@point{\moeptikz@tmpx}{0}{\moeptikz@tmpz}} 651 | 652 | \pgfmathparse{-1.025+\x*0.13+0.1} 653 | \edef\moeptikz@tmpx{\pgfmathresult} 654 | \pgflineto{\moeptikz@point{\moeptikz@tmpx}{0}{\moeptikz@tmpz}} 655 | 656 | \pgfmathparse{-.15-\z*0.035-0.025} 657 | \edef\moeptikz@tmpz{\pgfmathresult} 658 | \pgflineto{\moeptikz@point{\moeptikz@tmpx}{0}{\moeptikz@tmpz}} 659 | 660 | \pgfmathparse{-1.025+\x*0.13} 661 | \edef\moeptikz@tmpx{\pgfmathresult} 662 | \pgflineto{\moeptikz@point{\moeptikz@tmpx}{0}{\moeptikz@tmpz}} 663 | 664 | \pgfclosepath 665 | \pgfusepath{fill} 666 | } 667 | } 668 | 669 | %\pgfmoveto{\moeptikz@point{-1.0}{1.1}{-.1}} 670 | %\pgflineto{\moeptikz@point{-1.0}{0}{-.1}} 671 | %\pgflineto{\moeptikz@point{-1.0}{0}{-.5}} 672 | %\pgflineto{\moeptikz@point{1.0}{0}{-.5}} 673 | %\pgflineto{\moeptikz@point{1.0}{0}{-.1}} 674 | %\pgflineto{\moeptikz@point{1.0}{1.1}{-.1}} 675 | %\pgfclosepath 676 | %\pgfusepath{stroke} 677 | \pgftransformreset 678 | } 679 | \pgfdeclareshape{@notebook}{ 680 | \setpaths{\notebookanchor}{\notebookborder} 681 | \savedanchor\northeast{% 682 | \pgf@x = \pgfshapeminwidth 683 | \pgf@y = \pgfshapeminwidth 684 | \pgf@x=.5\pgf@x 685 | \pgf@y=.5\pgf@y 686 | } 687 | \savedanchor\southwest{% 688 | \pgf@x = \pgfshapeminwidth 689 | \pgf@y = \pgfshapeminwidth 690 | \pgf@x=-.5\pgf@x 691 | \pgf@y=-.5\pgf@y 692 | } 693 | \anchor{north}{\northeast \pgf@y=.75\pgf@y \pgf@x=0pt} 694 | \anchor{north east}{\northeast \pgf@x=.5\pgf@x \pgf@y=.625\pgf@y} 695 | \anchor{north west}{\northeast \pgf@x=-.5\pgf@x \pgf@y=.625\pgf@y} 696 | \anchor{east}{\northeast \pgf@y=0pt} 697 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 698 | \anchor{south east}{\northeast \pgf@x=.5\pgf@x \pgf@y=-.55\pgf@y} 699 | \anchor{south west}{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.55\pgf@y} 700 | \anchor{west}{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 701 | \anchor{text}{ 702 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 703 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 704 | \pgf@x=0pt 705 | \pgf@y=-.75\pgf@y 706 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 707 | \advance\pgf@y by -\ht\pgfnodeparttextbox 708 | } 709 | } 710 | 711 | \tikzset{ 712 | notebook/.style 2 args={ 713 | shape=@notebook, 714 | minimum size=#1, 715 | fill=#2 716 | }, 717 | notebook/.default={1cm}{black} 718 | } 719 | 720 | 721 | %============================================================================== 722 | % hub 723 | %============================================================================== 724 | \def\hubanchor{ 725 | \pgf@xa=\pgfshapeminwidth 726 | \pgf@ya=\pgfshapeminwidth 727 | \pgf@xa=.5\pgf@xa 728 | \pgf@ya=.5\pgf@ya 729 | 730 | \pgfpathmoveto{\pgfpoint{0}{.95\pgf@ya}} 731 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{.15\pgf@ya}} 732 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{-.15\pgf@ya}} 733 | \pgfpathlineto{\pgfpoint{0}{-.95\pgf@ya}} 734 | \pgfpathlineto{\pgfpoint{\pgf@xa}{-.15\pgf@ya}} 735 | \pgfpathlineto{\pgfpoint{\pgf@xa}{.15\pgf@ya}} 736 | \pgfpathclose 737 | } 738 | \def\hubborder{ 739 | \moeptikz@setshading 740 | \tikzset{get stroke color} 741 | \pgfsetstrokecolor{black} 742 | \pgfmathparse{.05*\pgfshapeminwidth}\let\linewidth\pgfmathresult 743 | \pgfsetcornersarced{\pgfpoint{0.01pt}{0.01pt}} 744 | 745 | \pgfmoveto{\northeast \pgf@y=.95\pgf@y \pgf@x=0pt} 746 | \pgflineto{\northeast \pgf@y=.15\pgf@y} 747 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.6\pgf@y} 748 | \pgflineto{\northeast \pgf@x=-\pgf@x \pgf@y=.15\pgf@y} 749 | \pgfclosepath 750 | \pgfshadepath{moeptikz@shading}{0} 751 | \pgfusepath{stroke} 752 | 753 | \pgfmoveto{\northeast \pgf@x=-\pgf@x \pgf@y=.15\pgf@y} 754 | \pgflineto{\northeast \pgf@x=-\pgf@x \pgf@y=-.15\pgf@y} 755 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 756 | \pgflineto{\northeast \pgf@y=-.15\pgf@y} 757 | \pgflineto{\northeast \pgf@y=.15\pgf@y} 758 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.6\pgf@y} 759 | \pgfclosepath 760 | \pgfshadepath{moeptikz@shading}{0} 761 | \pgfusepath{stroke} 762 | 763 | \pgfmoveto{\northeast \pgf@x=0pt \pgf@y=-.6\pgf@y} 764 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 765 | \pgfusepath{stroke} 766 | 767 | \tikzset{replace fill by stroke color/.expand once=\pgfsavedstrokecolor} 768 | \pgftransformshift{\northeast \pgf@x=0pt \pgf@y=.15\pgf@y} 769 | { 770 | \pgftransformxslant{1.33} 771 | \pgftransformyslant{-0.375} 772 | \pgftransformyscale{.9} 773 | \pgfmoveto{\northeast \pgf@x=-.75\pgf@x \pgf@y=.075\pgf@y} 774 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=-.075\pgf@y} 775 | \pgflineto{\northeast \pgf@x=.15\pgf@x \pgf@y=-.075\pgf@y} 776 | \pgflineto{\northeast \pgf@x=.15\pgf@x \pgf@y=-.15\pgf@y} 777 | \pgflineto{\northeast \pgf@x=.75\pgf@x \pgf@y=0pt} 778 | \pgflineto{\northeast \pgf@x=.15\pgf@x \pgf@y=.15\pgf@y} 779 | \pgflineto{\northeast \pgf@x=.15\pgf@x \pgf@y=.15\pgf@y} 780 | \pgflineto{\northeast \pgf@x=.15\pgf@x \pgf@y=.075\pgf@y} 781 | \pgfclosepath 782 | \pgfusepath{fill} 783 | } 784 | } 785 | \pgfdeclareshape{@hub}{ 786 | \setpaths{\hubanchor}{\hubborder} 787 | \savedanchor\northeast{% 788 | \pgf@x = \pgfshapeminwidth 789 | \pgf@y = \pgfshapeminwidth 790 | \pgf@x=.5\pgf@x 791 | \pgf@y=.5\pgf@y 792 | } 793 | \savedanchor\southwest{% 794 | \pgf@x = \pgfshapeminwidth 795 | \pgf@y = \pgfshapeminwidth 796 | \pgf@x=-.5\pgf@x 797 | \pgf@y=-.5\pgf@y 798 | } 799 | \anchor{north}{\northeast \pgf@y=.95\pgf@y \pgf@x=0pt} 800 | \anchor{north east}{\northeast \pgf@x=.5\pgf@x \pgf@y=.625\pgf@y} 801 | \anchor{north west}{\northeast \pgf@x=-.5\pgf@x \pgf@y=.625\pgf@y} 802 | \anchor{east}{\northeast \pgf@y=0pt} 803 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 804 | \anchor{south east}{\northeast \pgf@x=.5\pgf@x \pgf@y=-.625\pgf@y} 805 | \anchor{south west}{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.625\pgf@y} 806 | \anchor{west}{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 807 | \anchor{text}{ 808 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 809 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 810 | \pgf@x=0pt 811 | \pgf@y=-.9\pgf@y 812 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 813 | \advance\pgf@y by -\ht\pgfnodeparttextbox 814 | } 815 | } 816 | 817 | \tikzset{ 818 | hub/.style 2 args={ 819 | shape=@hub, 820 | minimum size=#1, 821 | fill=#2 822 | }, 823 | hub/.default={1cm}{black} 824 | } 825 | 826 | 827 | %============================================================================== 828 | % switch 829 | %============================================================================== 830 | \def\switchanchor{ 831 | \pgf@xa=\pgfshapeminwidth 832 | \pgf@ya=\pgfshapeminwidth 833 | \pgf@xa=.5\pgf@xa 834 | \pgf@ya=.5\pgf@ya 835 | 836 | \pgfpathmoveto{\pgfpoint{0}{.95\pgf@ya}} 837 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{.15\pgf@ya}} 838 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{-.15\pgf@ya}} 839 | \pgfpathlineto{\pgfpoint{0}{-.95\pgf@ya}} 840 | \pgfpathlineto{\pgfpoint{\pgf@xa}{-.15\pgf@ya}} 841 | \pgfpathlineto{\pgfpoint{\pgf@xa}{.15\pgf@ya}} 842 | \pgfpathclose 843 | } 844 | \def\switchborder{ 845 | \moeptikz@setshading 846 | \tikzset{get stroke color} 847 | \pgfsetstrokecolor{black} 848 | \pgfmathparse{.05*\pgfshapeminwidth}\let\linewidth\pgfmathresult 849 | \pgfmathparse{.1*\pgfshapeminwidth}\let\arrowdist\pgfmathresult 850 | \pgfsetcornersarced{\pgfpoint{0.01pt}{0.01pt}} 851 | 852 | \pgfmoveto{\northeast \pgf@x=0pt \pgf@y=.95\pgf@y} 853 | \pgflineto{\northeast \pgf@y=.15\pgf@y} 854 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.6\pgf@y} 855 | \pgflineto{\northeast \pgf@x=-\pgf@x \pgf@y=.15\pgf@y} 856 | \pgfclosepath 857 | \pgfshadepath{moeptikz@shading}{0} 858 | \pgfusepath{stroke} 859 | 860 | \pgfmoveto{\northeast \pgf@y=-.15\pgf@y} 861 | \pgflineto{\northeast \pgf@y=.15\pgf@y} 862 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.6\pgf@y} 863 | \pgflineto{\northeast \pgf@x=-\pgf@x \pgf@y=.15\pgf@y} 864 | \pgflineto{\northeast \pgf@x=-\pgf@x \pgf@y=-.15\pgf@y} 865 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 866 | \pgfclosepath 867 | \pgfshadepath{moeptikz@shading}{0} 868 | \pgfusepath{stroke} 869 | 870 | \pgfmoveto{\northeast \pgf@x=0pt \pgf@y=-.6\pgf@y} 871 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 872 | \pgfusepath{stroke} 873 | 874 | 875 | \tikzset{replace fill by stroke color/.expand once=\pgfsavedstrokecolor} 876 | \pgftransformshift{\northeast \pgf@x=0pt \pgf@y=.15\pgf@y} 877 | { 878 | \pgftransformxslant{1.33} 879 | \pgftransformyslant{-0.375} 880 | { 881 | \pgftransformshift{\northeast \pgf@x=.45\pgf@x \pgf@y=.1\pgf@y} 882 | \pgftransformscale{.45} 883 | \pgftransformyscale{.9} 884 | \pgfmoveto{\northeast \pgf@x=-.75\pgf@x \pgf@y=.075\pgf@y} 885 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=-.075\pgf@y} 886 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=-.075\pgf@y} 887 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=-.15\pgf@y} 888 | \pgflineto{\northeast \pgf@x=.75\pgf@x \pgf@y=0pt} 889 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=.15\pgf@y} 890 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=.075\pgf@y} 891 | \pgfclosepath 892 | \pgfusepath{fill} 893 | 894 | \pgfmoveto{\northeast \pgf@x=.75\pgf@x \pgf@y=0.20\pgf@y} 895 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.20\pgf@y} 896 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.125\pgf@y} 897 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=0.275\pgf@y} 898 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.425\pgf@y} 899 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.35\pgf@y} 900 | \pgflineto{\northeast \pgf@x=--.75\pgf@x \pgf@y=0.35\pgf@y} 901 | \pgfclosepath 902 | \pgfusepath{fill} 903 | } 904 | { 905 | \pgftransformshift{\northeast \pgf@x=-.45\pgf@x \pgf@y=.1\pgf@y} 906 | \pgftransformscale{.45} 907 | \pgftransformyscale{.9} 908 | \pgfmoveto{\northeast \pgf@x=-.75\pgf@x \pgf@y=.075\pgf@y} 909 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=-.075\pgf@y} 910 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=-.075\pgf@y} 911 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=-.15\pgf@y} 912 | \pgflineto{\northeast \pgf@x=.75\pgf@x \pgf@y=0pt} 913 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=.15\pgf@y} 914 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=.075\pgf@y} 915 | \pgfclosepath 916 | \pgfusepath{fill} 917 | 918 | \pgfmoveto{\northeast \pgf@x=.75\pgf@x \pgf@y=0.20\pgf@y} 919 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.20\pgf@y} 920 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.125\pgf@y} 921 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=0.275\pgf@y} 922 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.425\pgf@y} 923 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.35\pgf@y} 924 | \pgflineto{\northeast \pgf@x=--.75\pgf@x \pgf@y=0.35\pgf@y} 925 | \pgfclosepath 926 | \pgfusepath{fill} 927 | } 928 | { 929 | \pgftransformshift{\northeast \pgf@x=.45\pgf@x \pgf@y=-.2\pgf@y} 930 | \pgftransformscale{.45} 931 | \pgftransformyscale{.9} 932 | \pgfmoveto{\northeast \pgf@x=-.75\pgf@x \pgf@y=.075\pgf@y} 933 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=-.075\pgf@y} 934 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=-.075\pgf@y} 935 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=-.15\pgf@y} 936 | \pgflineto{\northeast \pgf@x=.75\pgf@x \pgf@y=0pt} 937 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=.15\pgf@y} 938 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=.075\pgf@y} 939 | \pgfclosepath 940 | \pgfusepath{fill} 941 | 942 | \pgfmoveto{\northeast \pgf@x=.75\pgf@x \pgf@y=0.20\pgf@y} 943 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.20\pgf@y} 944 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.125\pgf@y} 945 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=0.275\pgf@y} 946 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.425\pgf@y} 947 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.35\pgf@y} 948 | \pgflineto{\northeast \pgf@x=--.75\pgf@x \pgf@y=0.35\pgf@y} 949 | \pgfclosepath 950 | \pgfusepath{fill} 951 | } 952 | { 953 | \pgftransformshift{\northeast \pgf@x=-.45\pgf@x \pgf@y=-.2\pgf@y} 954 | \pgftransformscale{.45} 955 | \pgftransformyscale{.9} 956 | \pgfmoveto{\northeast \pgf@x=-.75\pgf@x \pgf@y=.075\pgf@y} 957 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=-.075\pgf@y} 958 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=-.075\pgf@y} 959 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=-.15\pgf@y} 960 | \pgflineto{\northeast \pgf@x=.75\pgf@x \pgf@y=0pt} 961 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=.15\pgf@y} 962 | \pgflineto{\northeast \pgf@x=.25\pgf@x \pgf@y=.075\pgf@y} 963 | \pgfclosepath 964 | \pgfusepath{fill} 965 | 966 | \pgfmoveto{\northeast \pgf@x=.75\pgf@x \pgf@y=0.20\pgf@y} 967 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.20\pgf@y} 968 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.125\pgf@y} 969 | \pgflineto{\northeast \pgf@x=-.75\pgf@x \pgf@y=0.275\pgf@y} 970 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.425\pgf@y} 971 | \pgflineto{\northeast \pgf@x=-.25\pgf@x \pgf@y=0.35\pgf@y} 972 | \pgflineto{\northeast \pgf@x=--.75\pgf@x \pgf@y=0.35\pgf@y} 973 | \pgfclosepath 974 | \pgfusepath{fill} 975 | } 976 | } 977 | } 978 | \pgfdeclareshape{@switch}{ 979 | \setpaths{\switchanchor}{\switchborder} 980 | \savedanchor\northeast{% 981 | \pgf@x = \pgfshapeminwidth 982 | \pgf@y = \pgfshapeminwidth 983 | \pgf@x=.5\pgf@x 984 | \pgf@y=.5\pgf@y 985 | } 986 | \savedanchor\southwest{% 987 | \pgf@x = \pgfshapeminwidth 988 | \pgf@y = \pgfshapeminwidth 989 | \pgf@x=-.5\pgf@x 990 | \pgf@y=-.5\pgf@y 991 | } 992 | 993 | \anchor{north}{\northeast \pgf@y=.95\pgf@y \pgf@x=0pt} 994 | \anchor{north east}{\northeast \pgf@x=.5\pgf@x \pgf@y=.625\pgf@y} 995 | \anchor{north west}{\northeast \pgf@x=-.5\pgf@x \pgf@y=.625\pgf@y} 996 | \anchor{east}{\northeast \pgf@y=0pt} 997 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 998 | \anchor{south east}{\northeast \pgf@x=.5\pgf@x \pgf@y=-.625\pgf@y} 999 | \anchor{south west}{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.625\pgf@y} 1000 | \anchor{west}{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 1001 | \anchor{text}{ 1002 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 1003 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 1004 | \pgf@x=0pt 1005 | \pgf@y=-.9\pgf@y 1006 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 1007 | \advance\pgf@y by -\ht\pgfnodeparttextbox 1008 | } 1009 | } 1010 | 1011 | \tikzset{ 1012 | switch/.style 2 args={ 1013 | shape=@switch, 1014 | minimum size=#1, 1015 | fill=#2 1016 | }, 1017 | switch/.default={1cm}{black} 1018 | } 1019 | 1020 | %============================================================================== 1021 | % router 1022 | %============================================================================== 1023 | \def\routeranchor{ 1024 | \pgf@xa=\pgfshapeminwidth 1025 | \pgf@ya=\pgfshapeminwidth 1026 | \pgf@xa=.5\pgf@xa 1027 | \pgf@ya=.5\pgf@ya 1028 | 1029 | \pgfmathparse{1/2*\pgfshapeminwidth}\let\radiusx\pgfmathresult 1030 | \pgfmathparse{3/8*\pgfshapeminwidth}\let\radiusy\pgfmathresult 1031 | 1032 | \pgfsetcornersarced{\pgfpoint{1pt}{1pt}} 1033 | \pgfpathmoveto{\pgfpoint{-\pgf@xa}{-.15\pgf@ya}} 1034 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{.15\pgf@ya}} 1035 | \pgfpatharcaxes{180}{0}{\pgfpoint{\radiusx}{0pt}}{\pgfpoint{0pt}{\radiusy}} 1036 | \pgfpathlineto{\pgfpoint{\pgf@xa}{-.15\pgf@ya}} 1037 | \pgfpatharcaxes{0}{-180}{\pgfpoint{\radiusx}{0pt}}{\pgfpoint{0pt}{\radiusy}} 1038 | \pgfpathclose 1039 | } 1040 | \def\routerborder{ 1041 | \moeptikz@setshading 1042 | \tikzset{get stroke color} 1043 | \pgfsetstrokecolor{black} 1044 | 1045 | \pgfmathparse{.05*\pgfshapeminwidth}\let\linewidth\pgfmathresult 1046 | \pgfsetcornersarced{\pgfpoint{0.01pt}{0.01pt}} 1047 | 1048 | \pgfmathparse{1/2*\pgfshapeminwidth}\let\radiusx\pgfmathresult 1049 | \pgfmathparse{3/8*\pgfshapeminwidth}\let\radiusy\pgfmathresult 1050 | 1051 | % router body 1052 | \pgfsetfillcolor{black!10} 1053 | \pgfpathmoveto{\northeast \pgf@x=-\pgf@x \pgf@y=.15\pgf@y} 1054 | \pgfpathlineto{\northeast \pgf@x=-\pgf@x \pgf@y=-.15\pgf@y} 1055 | \pgfpatharcaxes{180}{360}{\pgfpoint{\radiusx}{0pt}}{\pgfpoint{0pt}{\radiusy}} 1056 | \pgfpathlineto{\northeast \pgf@y=.15\pgf@y} 1057 | \pgfclosepath 1058 | \pgfshadepath{moeptikz@shading}{0} 1059 | \pgfusepath{stroke} 1060 | 1061 | \pgfpathellipse{\northeast \pgf@x=0pt \pgf@y=.15\pgf@y} 1062 | {\northeast \pgf@y=0pt} 1063 | {\northeast \pgf@x=0pt \pgf@y=-.75\pgf@y} 1064 | \pgfshadepath{moeptikz@shading}{0} 1065 | \pgfusepath{stroke} 1066 | 1067 | \tikzset{replace fill by stroke color/.expand once=\pgfsavedstrokecolor} 1068 | \pgftransformshift{\northeast \pgf@x=0pt \pgf@y=.15\pgf@y}{% 1069 | { 1070 | \pgftransformxslant{1.33} 1071 | \pgftransformyslant{-0.375} 1072 | \pgftransformyscale{.8} 1073 | \pgftransformxscale{1.3} 1074 | \pgfmoveto{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 1075 | \pgflineto{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.15\pgf@y} 1076 | \pgflineto{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.05\pgf@y} 1077 | \pgflineto{\northeast \pgf@x=.5\pgf@x \pgf@y=-.05\pgf@y} 1078 | \pgflineto{\northeast \pgf@x=.5\pgf@x \pgf@y=-.15\pgf@y} 1079 | \pgflineto{\northeast \pgf@x=\pgf@x \pgf@y=0pt} 1080 | \pgflineto{\northeast \pgf@x=.5\pgf@x \pgf@y=.15\pgf@y} 1081 | \pgflineto{\northeast \pgf@x=.5\pgf@x \pgf@y=.05\pgf@y} 1082 | \pgflineto{\northeast \pgf@x=-.5\pgf@x \pgf@y=.05\pgf@y} 1083 | \pgflineto{\northeast \pgf@x=-.5\pgf@x \pgf@y=.15\pgf@y} 1084 | \pgfclosepath 1085 | \pgfusepath{fill} 1086 | } 1087 | 1088 | { 1089 | \pgftransformxslant{1.33} 1090 | \pgftransformyslant{-0.375} 1091 | \pgftransformyscale{0.5} 1092 | \pgftransformxscale{2.2} 1093 | \pgfmoveto{\northeast \pgf@y=-\pgf@y \pgf@x=0pt} 1094 | \pgflineto{\northeast \pgf@y=-.5\pgf@y \pgf@x=-.15\pgf@x} 1095 | \pgflineto{\northeast \pgf@y=-.5\pgf@y \pgf@x=-.05\pgf@x} 1096 | \pgflineto{\northeast \pgf@y=.5\pgf@y \pgf@x=-.05\pgf@x} 1097 | \pgflineto{\northeast \pgf@y=.5\pgf@y \pgf@x=-.15\pgf@x} 1098 | \pgflineto{\northeast \pgf@y=\pgf@y \pgf@x=0pt} 1099 | \pgflineto{\northeast \pgf@y=.5\pgf@y \pgf@x=.15\pgf@x} 1100 | \pgflineto{\northeast \pgf@y=.5\pgf@y \pgf@x=.05\pgf@x} 1101 | \pgflineto{\northeast \pgf@y=-.5\pgf@y \pgf@x=.05\pgf@x} 1102 | \pgflineto{\northeast \pgf@y=-.5\pgf@y \pgf@x=.15\pgf@x} 1103 | \pgfclosepath 1104 | \pgfusepath{fill} 1105 | } 1106 | } 1107 | } 1108 | \pgfdeclareshape{@router}{ 1109 | \setpaths{\routeranchor}{\routerborder} 1110 | \savedanchor\northeast{% 1111 | \pgf@x = \pgfshapeminwidth 1112 | \pgf@y = \pgfshapeminwidth 1113 | \pgf@x=.5\pgf@x 1114 | \pgf@y=.5\pgf@y 1115 | } 1116 | \savedanchor\southwest{% 1117 | \pgf@x = \pgfshapeminwidth 1118 | \pgf@y = \pgfshapeminwidth 1119 | \pgf@x=-.5\pgf@x 1120 | \pgf@y=-.5\pgf@y 1121 | } 1122 | \anchor{north}{\northeast \pgf@y=.95\pgf@y \pgf@x=0pt} 1123 | \anchor{east}{\northeast \pgf@y=0pt} 1124 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 1125 | \anchor{west}{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 1126 | \anchor{north east}{\northeast \pgf@y=.7\pgf@y \pgf@x=.7\pgf@x} 1127 | \anchor{north west}{\northeast \pgf@y=.7\pgf@y \pgf@x=-.7\pgf@x} 1128 | \anchor{south west}{\northeast \pgf@y=-.7\pgf@y \pgf@x=-.7\pgf@x} 1129 | \anchor{south east}{\northeast \pgf@y=-.7\pgf@y \pgf@x=.7\pgf@x} 1130 | \anchor{text}{ 1131 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 1132 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 1133 | \pgf@x=0pt 1134 | \pgf@y=-.9\pgf@y 1135 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 1136 | \advance\pgf@y by -\ht\pgfnodeparttextbox 1137 | } 1138 | } 1139 | 1140 | \tikzset{ 1141 | router/.style args={#1,#2,#3}{% 1142 | shape=@router, 1143 | minimum size=#1, 1144 | fill=#2, 1145 | draw=#3 1146 | }, 1147 | router/.default={1cm,black,black} 1148 | } 1149 | 1150 | 1151 | 1152 | %============================================================================== 1153 | % nuc 1154 | %============================================================================== 1155 | \def\nucanchor{ 1156 | \pgf@xa=\pgfshapeminwidth 1157 | \pgf@ya=\pgfshapeminwidth 1158 | \pgf@xa=.5\pgf@xa 1159 | \pgf@ya=.5\pgf@ya 1160 | 1161 | \pgfsetcornersarced{\pgfpoint{1pt}{1pt}} 1162 | \pgfpathmoveto{\pgfpoint{0}{\pgf@ya}} 1163 | \pgfpathlineto{\pgfpoint{\pgf@xa}{.25\pgf@ya}} 1164 | \pgfpathlineto{\pgfpoint{\pgf@xa}{-.25\pgf@ya}} 1165 | \pgfpathlineto{\pgfpoint{0}{-\pgf@ya}} 1166 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{-.25\pgf@ya}} 1167 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{.25\pgf@ya}} 1168 | \pgfpathclose 1169 | } 1170 | \def\nucborder{ 1171 | \moeptikz@setshading 1172 | \pgfsetstrokecolor{black} 1173 | 1174 | % rear antenna 1175 | \pgfmathparse{.075*\pgfshapeminwidth} 1176 | \pgfsetlinewidth\pgfmathresult 1177 | \pgfsys@roundcap 1178 | 1179 | \pgfmoveto{\northeast \pgf@x=-.1\pgf@x \pgf@y=.6\pgf@y} 1180 | \pgflineto{\northeast \pgf@x=-.2\pgf@x \pgf@y=.7\pgf@y} 1181 | \pgflineto{\northeast \pgf@x=-.4\pgf@x \pgf@y=1.5\pgf@y} 1182 | \pgfusepath{stroke} 1183 | 1184 | % body 1185 | \pgfmathparse{.025*\pgfshapeminwidth} 1186 | \pgfsetlinewidth\pgfmathresult 1187 | \pgfsetcornersarced{\pgfpoint{1pt}{1pt}} 1188 | 1189 | \pgfmoveto{\northeast \pgf@x=0pt} 1190 | \pgflineto{\northeast \pgf@y=.25\pgf@y} 1191 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.5\pgf@y} 1192 | \pgflineto{\northeast \pgf@x=-\pgf@x \pgf@y=.25\pgf@y} 1193 | \pgfclosepath 1194 | \pgfshadepath{moeptikz@shadingnuc}{0} 1195 | \pgfusepath{stroke} 1196 | 1197 | \pgfmoveto{\northeast \pgf@x=-\pgf@x \pgf@y=-.25\pgf@y} 1198 | \pgflineto{\northeast \pgf@x=-\pgf@x \pgf@y=.25\pgf@y} 1199 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-.5\pgf@y} 1200 | \pgflineto{\northeast \pgf@y=.25\pgf@y} 1201 | \pgflineto{\northeast \pgf@y=-.25\pgf@y} 1202 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-\pgf@y} 1203 | \pgfclosepath 1204 | \pgfshadepath{moeptikz@shading}{0} 1205 | \pgfusepath{stroke} 1206 | 1207 | \pgfmoveto{\northeast \pgf@x=0pt \pgf@y=-.5\pgf@y} 1208 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-\pgf@y} 1209 | \pgfusepath{stroke} 1210 | 1211 | \pgflineto{\northeast \pgf@x=0pt \pgf@y=-\pgf@y} 1212 | \pgfclosepath 1213 | \pgfshadepath{moeptikz@shading}{0} 1214 | \pgfusepath{stroke} 1215 | 1216 | % front antennas 1217 | \pgfmathparse{.075*\pgfshapeminwidth} 1218 | \pgfsetlinewidth\pgfmathresult 1219 | \pgfsys@roundcap 1220 | 1221 | \pgfmoveto{\northeast \pgf@x=-.5\pgf@x \pgf@y=-.4\pgf@y} 1222 | \pgflineto{\northeast \pgf@x=-.6\pgf@x \pgf@y=-.5\pgf@y} 1223 | \pgflineto{\northeast \pgf@x=-.8\pgf@x \pgf@y=.7\pgf@y} 1224 | \pgfusepath{stroke} 1225 | 1226 | \pgfmoveto{\northeast \pgf@x=.5\pgf@x \pgf@y=-.4\pgf@y} 1227 | \pgflineto{\northeast \pgf@x=.6\pgf@x \pgf@y=-.5\pgf@y} 1228 | \pgflineto{\northeast \pgf@x=.8\pgf@x \pgf@y=.7\pgf@y} 1229 | \pgfusepath{stroke} 1230 | 1231 | \pgftransformshift{\northeast \pgf@x=0pt \pgf@y=.25\pgf@y}{ 1232 | \pgfsetfillcolor{cyan} 1233 | \pgfpathcircle{ 1234 | \northeast \pgf@x=.05\pgf@x\pgf@y=.45\pgf@y 1235 | }{ 1236 | .15\pgflinewidth 1237 | } 1238 | \pgfusepath{fill} 1239 | } 1240 | } 1241 | \pgfdeclareshape{@nuc}{ 1242 | \setpaths{\nucanchor}{\nucborder} 1243 | \savedanchor\northeast{% 1244 | \pgf@x = \pgfshapeminwidth 1245 | \pgf@y = \pgfshapeminwidth 1246 | \pgf@x=.5\pgf@x 1247 | \pgf@y=.5\pgf@y 1248 | } 1249 | \savedanchor\southwest{% 1250 | \pgf@x = \pgfshapeminwidth 1251 | \pgf@y = \pgfshapeminwidth 1252 | \pgf@x=-.5\pgf@x 1253 | \pgf@y=-.5\pgf@y 1254 | } 1255 | \anchor{north}{\northeast \pgf@y=.95\pgf@y \pgf@x=0pt} 1256 | \anchor{north east}{\northeast \pgf@x=.58\pgf@x \pgf@y=.58\pgf@y} 1257 | \anchor{east}{\northeast \pgf@y=0pt} 1258 | \anchor{south east}{\northeast \pgf@x=.58\pgf@x \pgf@y=-.58\pgf@y} 1259 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-.95\pgf@y} 1260 | \anchor{south west}{\northeast \pgf@x=-.58\pgf@x \pgf@y=-.58\pgf@y} 1261 | \anchor{west}{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 1262 | \anchor{north west}{\northeast \pgf@x=-.58\pgf@x \pgf@y=.58\pgf@y} 1263 | \anchor{text}{ 1264 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 1265 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 1266 | \pgf@x=0pt 1267 | \pgf@y=-.75\pgf@y 1268 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 1269 | \advance\pgf@y by -\ht\pgfnodeparttextbox 1270 | } 1271 | } 1272 | 1273 | \tikzset{ 1274 | nuc/.style 2 args={ 1275 | shape=@nuc, 1276 | minimum size=#1, 1277 | fill=#2 1278 | }, 1279 | nuc/.default={1cm}{black} 1280 | } 1281 | 1282 | 1283 | %============================================================================== 1284 | % messageopen 1285 | %============================================================================== 1286 | \def\messageopenanchor{ 1287 | \pgf@xa=\pgfshapeminwidth 1288 | \pgf@ya=\pgfshapeminwidth 1289 | \pgf@xa=.5\pgf@xa 1290 | \pgf@ya=.5\pgf@ya 1291 | 1292 | \pgfsetcornersarced{\pgfpoint{0.01pt}{0.01pt}} 1293 | \pgfpathmoveto{\pgfpoint{0}{\pgf@ya}} 1294 | \pgfpathlineto{\pgfpoint{.27\pgf@xa}{.8\pgf@ya}} 1295 | \pgfpathlineto{\pgfpoint{.8\pgf@xa}{.8\pgf@ya}} 1296 | \pgfpathlineto{\pgfpoint{.8\pgf@xa}{.44\pgf@ya}} 1297 | \pgfpathlineto{\pgfpoint{\pgf@xa}{.25\pgf@ya}} 1298 | \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}} 1299 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}} 1300 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{.25\pgf@ya}} 1301 | \pgfpathlineto{\pgfpoint{-.8\pgf@xa}{.44\pgf@ya}} 1302 | \pgfpathlineto{\pgfpoint{-.8\pgf@xa}{.8\pgf@ya}} 1303 | \pgfpathlineto{\pgfpoint{-.27\pgf@xa}{.8\pgf@ya}} 1304 | \pgfpathclose 1305 | } 1306 | \tikzset{paper color/.initial={black}} 1307 | \def\messageopenborder{ 1308 | \pgfkeys{/tikz/paper color/.get=\moeptikz@papercolor} 1309 | % \expandafter\tikzset\expandafter{\tmp} 1310 | % \tikz@options 1311 | 1312 | \pgfmathparse{.2*sqrt(\pgfshapeminwidth)}\let\cornerarc\pgfmathresult 1313 | \pgfsetcornersarced{\pgfpoint{\cornerarc}{\cornerarc}} 1314 | 1315 | \pgfpathmoveto{\northeast \pgf@x=0\pgf@x} 1316 | \pgfpathlineto{\northeast \pgf@y=.25\pgf@y \pgf@x=-\pgf@x} 1317 | \pgfpathlineto{\southwest} 1318 | \pgfpathlineto{\southwest \pgf@x=-\pgf@x} 1319 | \pgfpathlineto{\southwest \pgf@x=-\pgf@x \pgf@y=-.25\pgf@y} 1320 | \pgfclosepath 1321 | \pgfusepath{fill} 1322 | 1323 | % Aeusserer Rand um das gesamte Couvert 1324 | \pgfpathmoveto{\northeast \pgf@x=0\pgf@x} 1325 | \pgfpathlineto{\northeast \pgf@y=.25\pgf@y} 1326 | \pgfpathlineto{\northeast \pgf@y=-\pgf@y} 1327 | \pgfpathlineto{\northeast \pgf@x=-\pgf@x \pgf@y=-\pgf@y} 1328 | \pgfpathlineto{\northeast \pgf@x=-\pgf@x \pgf@y=.25\pgf@y} 1329 | \pgfclosepath 1330 | \pgfusepath{stroke} 1331 | 1332 | % Papier 1333 | \pgfsetstrokecolor{\moeptikz@papercolor!80} 1334 | \pgfdeclarehorizontalshading{myshadingE}{100bp}{color(0bp)=(white); color(100bp)=(\moeptikz@papercolor!30)} 1335 | \pgfsetcornersarced{\pgfpoint{0.01pt}{0.01pt}} 1336 | \pgfpathrectanglecorners{\northeast \pgf@x=.8\pgf@x \pgf@y=.8\pgf@y} 1337 | {\northeast \pgf@x=-.8\pgf@x \pgf@y=-.8\pgf@y} 1338 | \pgfshadepath{myshadingE}{180} 1339 | \pgfusepath{stroke} 1340 | 1341 | % Linke Seite des Couverts (ohne Rand) 1342 | \pgfsetcornersarced{\pgfpoint{\cornerarc}{\cornerarc}} 1343 | \ifx\tikz@fillcolor\pgfutil@empty 1344 | \pgfsys@color@rgb@fill{0.91}{0.82}{0.67} 1345 | \else 1346 | \pgfsetfillcolor{\tikz@fillcolor} 1347 | \fi 1348 | \ifx\tikz@strokecolor\pgfutil@empty 1349 | \pgfsys@color@rgb@stroke{0.84}{0.58}{0.47} 1350 | \else 1351 | \pgfsetstrokecolor{\tikz@strokecolor} 1352 | \fi 1353 | \pgfpathmoveto{\southwest} 1354 | \pgfpathlineto{\southwest \pgf@y=-.25\pgf@y} 1355 | \pgfpathlineto{\southwest \pgf@y=.3875\pgf@y \pgf@x=0\pgf@x} 1356 | \pgfclosepath 1357 | \pgfusepath{stroke,fill} 1358 | 1359 | % Rechte Seite des Couverts (ohne Rand) 1360 | \pgfpathmoveto{\southwest \pgf@x=-\pgf@x} 1361 | \pgfpathlineto{\southwest \pgf@y=-.25\pgf@y \pgf@x=-\pgf@x} 1362 | \pgfpathlineto{\southwest \pgf@y=.3875\pgf@y \pgf@x=0\pgf@x} 1363 | \pgfclosepath 1364 | \pgfusepath{stroke,fill} 1365 | 1366 | % Untere Seite des Couverts (ohne Rand) 1367 | \pgfpathmoveto{\southwest} 1368 | \pgfpathlineto{\southwest \pgf@x=-\pgf@x} 1369 | \pgfpathlineto{\southwest \pgf@y=.3\pgf@y \pgf@x=0\pgf@x} 1370 | \pgfclosepath 1371 | \pgfusepath{stroke,fill} 1372 | } 1373 | \pgfdeclareshape{@messageopen}{ 1374 | \setpaths{\messageopenanchor}{\messageopenborder} 1375 | \savedanchor\northeast{% 1376 | \pgf@x = \pgfshapeminwidth 1377 | \pgf@y = \pgfshapeminwidth 1378 | \pgf@x=.5\pgf@x 1379 | \pgf@y=.5\pgf@y 1380 | } 1381 | \savedanchor\southwest{% 1382 | \pgf@x = \pgfshapeminwidth 1383 | \pgf@y = \pgfshapeminwidth 1384 | \pgf@x=-.5\pgf@x 1385 | \pgf@y=-.5\pgf@y 1386 | } 1387 | \anchor{north}{\northeast \pgf@x=0pt} 1388 | \anchor{north east}{\northeast \pgf@x=.8\pgf@x \pgf@y=.8\pgf@y} 1389 | \anchor{east}{\northeast \pgf@y=0pt} 1390 | \anchor{south east}{\northeast \pgf@y=-\pgf@y} 1391 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-\pgf@y} 1392 | \anchor{south west}{\northeast \pgf@x=-\pgf@x \pgf@y=-\pgf@y} 1393 | \anchor{west}{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 1394 | \anchor{north west}{\northeast \pgf@x=-.8\pgf@x \pgf@y=.8\pgf@y} 1395 | \anchor{text}{ 1396 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 1397 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 1398 | \pgf@x=0pt 1399 | \pgf@y=-.75\pgf@y 1400 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 1401 | \advance\pgf@y by -\ht\pgfnodeparttextbox 1402 | } 1403 | } 1404 | 1405 | \tikzset{ 1406 | messageopen/.style args={#1,#2,#3}{% 1407 | shape=@messageopen, 1408 | minimum size=#1, 1409 | fill=#2, 1410 | draw=#3, 1411 | }, 1412 | messageopen/.default={1cm,black!30,black} 1413 | } 1414 | 1415 | %============================================================================== 1416 | % messageclosed 1417 | %============================================================================== 1418 | \def\messageclosedanchor{ 1419 | \pgf@xa=\pgfshapeminwidth 1420 | \pgf@ya=\pgfshapeminwidth 1421 | \pgf@xa=.5\pgf@xa 1422 | \pgf@ya=.5\pgf@ya 1423 | \pgfpathmoveto{\pgfpoint{\pgf@xa}{.625\pgf@ya}} 1424 | \pgfpathlineto{\pgfpoint{\pgf@xa}{-.625\pgf@ya}} 1425 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{-.625\pgf@ya}} 1426 | \pgfpathlineto{\pgfpoint{-\pgf@xa}{.625\pgf@ya}} 1427 | \pgfpathclose 1428 | } 1429 | \def\messageclosedborder{ 1430 | \ifx\tikz@strokecolor\pgfutil@empty 1431 | \pgfsys@color@rgb@stroke{0.84}{0.58}{0.47} 1432 | \else 1433 | \pgfsetstrokecolor{\tikz@strokecolor} 1434 | \fi 1435 | \ifx\tikz@fillcolor\pgfutil@empty 1436 | \pgfsys@color@rgb@fill{0.91}{0.82}{0.67} 1437 | \else 1438 | \pgfsetfillcolor{\tikz@fillcolor} 1439 | \fi 1440 | 1441 | \pgfmathparse{.05*sqrt(\pgfshapeminwidth)}\let\linewidth\pgfmathresult 1442 | \pgfmathparse{.1*\pgfshapeminwidth}\let\fontwidth\pgfmathresult 1443 | \pgfmathparse{.2*sqrt(\pgfshapeminwidth)}\let\cornerarc\pgfmathresult 1444 | 1445 | \pgfsetlinewidth{\linewidth} 1446 | \pgfsetcornersarced{\pgfpoint{\cornerarc}{\cornerarc}} 1447 | 1448 | % Linke Seite des Couverts (ohne Rand) 1449 | \pgfsetcornersarced{\pgfpoint{\cornerarc}{\cornerarc}} 1450 | \pgfpathmoveto{\southwest \pgf@y=.625\pgf@y} 1451 | \pgfpathlineto{\southwest \pgf@y=-.625\pgf@y} 1452 | \pgfpathlineto{\southwest \pgf@y=.0125\pgf@y \pgf@x=0\pgf@x} 1453 | \pgfclosepath 1454 | \pgfusepath{stroke,fill} 1455 | 1456 | % Rechte Seite des Couverts (ohne Rand) 1457 | \pgfpathmoveto{\southwest \pgf@x=-\pgf@x \pgf@y=.625\pgf@y} 1458 | \pgfpathlineto{\southwest \pgf@y=-.625\pgf@y \pgf@x=-\pgf@x} 1459 | \pgfpathlineto{\southwest \pgf@y=.0125\pgf@y \pgf@x=0\pgf@x} 1460 | \pgfclosepath 1461 | \pgfusepath{stroke,fill} 1462 | 1463 | % Untere Seite des Couverts (ohne Rand) 1464 | \pgfpathmoveto{\southwest \pgf@y=.625\pgf@y} 1465 | \pgfpathlineto{\southwest \pgf@x=-\pgf@x \pgf@y=.625\pgf@y} 1466 | \pgfpathlineto{\southwest \pgf@y=-.075\pgf@y \pgf@x=0\pgf@x} 1467 | \pgfclosepath 1468 | \pgfusepath{stroke,fill} 1469 | 1470 | % Obere Seite des Couverts (ohne Rand) 1471 | \pgfpathmoveto{\southwest \pgf@y=-.625\pgf@y} 1472 | \pgfpathlineto{\southwest \pgf@x=-\pgf@x \pgf@y=-.625\pgf@y} 1473 | \pgfpathlineto{\southwest \pgf@y=.075\pgf@y \pgf@x=0\pgf@x} 1474 | \pgfclosepath 1475 | \pgfusepath{stroke,fill} 1476 | } 1477 | \pgfdeclareshape{@messageclosed}{ 1478 | \setpaths{\messageclosedanchor}{\messageclosedborder} 1479 | \savedanchor\northeast{% 1480 | \pgf@x = \pgfshapeminwidth 1481 | \pgf@y = \pgfshapeminwidth 1482 | \pgf@x=.5\pgf@x 1483 | \pgf@y=.5\pgf@y 1484 | } 1485 | \savedanchor\southwest{% 1486 | \pgf@x = \pgfshapeminwidth 1487 | \pgf@y = \pgfshapeminwidth 1488 | \pgf@x=-.5\pgf@x 1489 | \pgf@y=-.5\pgf@y 1490 | } 1491 | \anchor{north}{\northeast \pgf@x=0pt \pgf@y=.625\pgf@y} 1492 | \anchor{north east}{\northeast \pgf@y=.625\pgf@y} 1493 | \anchor{east}{\northeast \pgf@y=0pt} 1494 | \anchor{south east}{\northeast \pgf@y=-.625\pgf@y} 1495 | \anchor{south}{\northeast \pgf@x=0pt \pgf@y=-.625\pgf@y} 1496 | \anchor{south west}{\northeast \pgf@x=-\pgf@x \pgf@y=-.625\pgf@y} 1497 | \anchor{west}{\northeast \pgf@x=-\pgf@x \pgf@y=0pt} 1498 | \anchor{north west}{\northeast \pgf@x=-\pgf@x \pgf@y=.625\pgf@y} 1499 | \anchor{text}{ 1500 | \pgfmathsetlength\pgf@x{\pgfshapeminwidth}% 1501 | \pgfmathsetlength\pgf@y{\pgfshapeminwidth}% 1502 | \pgf@x=0pt 1503 | \pgf@y=-.5\pgf@y 1504 | \advance\pgf@x by -.5\wd\pgfnodeparttextbox 1505 | \advance\pgf@y by -\ht\pgfnodeparttextbox 1506 | } 1507 | } 1508 | 1509 | \tikzset{ 1510 | messageclosed/.style args={#1,#2,#3}{% 1511 | shape=@messageclosed, 1512 | minimum size=#1, 1513 | fill=#2, 1514 | draw=#3, 1515 | }, 1516 | messageclosed/.default={1cm,black!30,black} 1517 | } 1518 | 1519 | 1520 | % Redfined checkerboard decoration with better image quality than the default 1521 | \pgfdeclarepatternformonly[\CheckerSize]{moepcheckerboard}% name 1522 | {\pgfqpoint{0mm}{0mm}}% origin 1523 | {\pgfqpoint{2\CheckerSize}{2\CheckerSize}}% top right 1524 | {\pgfqpoint{\CheckerSize}{\CheckerSize}}% tile size 1525 | {% code 1526 | \pgfsetfillcolor{black!15} 1527 | \pgfpathrectanglecorners{\pgfqpoint{0mm}{0mm}}{\pgfqpoint{2.5mm}{2.5mm}} 1528 | \pgfusepath{fill} 1529 | \pgfpathrectanglecorners{\pgfqpoint{2.5mm}{2.5mm}}{\pgfqpoint{5mm}{5mm}} 1530 | \pgfusepath{fill} 1531 | \pgfsetfillcolor{black!25} 1532 | \pgfpathrectanglecorners{\pgfqpoint{0mm}{2.5mm}}{\pgfqpoint{2.5mm}{5mm}} 1533 | \pgfusepath{fill} 1534 | \pgfpathrectanglecorners{\pgfqpoint{2.5mm}{0mm}}{\pgfqpoint{5mm}{2.5mm}} 1535 | \pgfusepath{fill} 1536 | } 1537 | % 1538 | \newdimen\CheckerSize 1539 | \tikzset{ 1540 | CheckerSize/.code={\CheckerSize=#1}, 1541 | CheckerSize=5mm 1542 | } 1543 | 1544 | % Redefined line decoration that allows for custom spacing 1545 | %FIXME add a color option 1546 | \pgfdeclarepatternformonly[\LineSpacing]{moepNorthWestLines}{ 1547 | \pgfqpoint{0pt}{0pt}}{\pgfqpoint{-10mm}{10mm} 1548 | }{ 1549 | \pgfqpoint{\LineSpacing}{\LineSpacing} 1550 | } 1551 | { 1552 | \pgfsetlinewidth{0.3pt} 1553 | \pgfsetstrokecolor{black!40} 1554 | \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} 1555 | \pgfpathlineto{\pgfqpoint{-10mm}{10mm}} 1556 | \pgfusepath{stroke} 1557 | } 1558 | \pgfdeclarepatternformonly[\LineSpacing]{moepSouthEastLines}{ 1559 | \pgfqpoint{0pt}{0pt}}{\pgfqpoint{10mm}{10mm} 1560 | }{ 1561 | \pgfqpoint{\LineSpacing}{\LineSpacing} 1562 | } 1563 | { 1564 | \pgfsetlinewidth{0.3pt} 1565 | \pgfsetstrokecolor{black!40} 1566 | \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} 1567 | \pgfpathlineto{\pgfqpoint{10mm}{10mm}} 1568 | \pgfusepath{stroke} 1569 | } 1570 | % 1571 | \newdimen\LineSpacing 1572 | \tikzset{ 1573 | LineSpacing/.code={\LineSpacing=#1}, 1574 | LineSpacing=3pt 1575 | } 1576 | 1577 | \endinput 1578 | --------------------------------------------------------------------------------