% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarysnakes.code.tex,v 1.7 2013/07/15 12:05:31 tantau Exp $

\pgfwarning{Snakes have been superseded by
decorations. Please use the decoration libraries instead of the snakes
library}

\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes}


% Old snakes stuff:

\tikzoption{snake}[]{%
  \def\tikz@@snake{#1}%
  \ifx\tikz@@snake\pgfutil@empty%
    \tikz@snakedtrue%
  \else%
    \ifx\tikz@@snake\tikz@nonetext%
      \tikz@snakedfalse%
    \else%
      \tikz@snakedtrue%
      \let\tikz@snake=\tikz@@snake%
    \fi%
  \fi}

\tikzoption{raise snake}{\def\pgf@snake@raise{\pgftransformyshift{#1}}}
\tikzoption{mirror snake}[true]{%
  \csname if#1\endcsname
    \def\pgf@snake@mirror{\pgftransformyscale{-1}}%
  \else%
    \let\pgf@snake@mirror=\pgfutil@empty%
  \fi
}

\tikzoption{gap before snake}{\def\tikz@presnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}}
\tikzoption{line before snake}{\def\tikz@presnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}}

\tikzoption{gap after snake}{\def\tikz@postsnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}}
\tikzoption{line after snake}{\def\tikz@postsnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}\def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}}

\tikzoption{gap around snake}{%
  \def\tikz@presnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
  \def\tikz@postsnake{{moveto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
  \def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}%
}
\tikzoption{line around snake}{%
  \def\tikz@presnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
  \def\tikz@postsnake{{lineto}{#1}{\noexpand\tikz@snake@install@trans}{}}%
  \def\tikz@mainsnakelength{\pgfsnakeremainingdistance-#1}%
}
\let\pgf@snake@mirror=\pgfutil@empty
\let\pgf@snake@raise=\pgfutil@empty

\def\tikz@snake@install@trans{\pgfsetsnakesegmenttransformation{\pgf@snake@mirror\pgf@snake@raise}}

\def\tikz@snake{zigzag}

\let\tikz@presnake=\pgfutil@empty
\let\tikz@postsnake=\pgfutil@empty
\def\tikz@mainsnakelength{\pgfsnakeremainingdistance}


\tikzstyle{snake triangles 45}=      [snake=triangles,segment object length=2.41421356\pgfsnakesegmentamplitude]
\tikzstyle{snake triangles 60}=      [snake=triangles,segment object length=1.73205081\pgfsnakesegmentamplitude]
\tikzstyle{snake triangles 90}=      [snake=triangles,segment object length=\pgfsnakesegmentamplitude]



\endinput
