aboutsummaryrefslogtreecommitdiff
path: root/shapes.tex
diff options
context:
space:
mode:
Diffstat (limited to 'shapes.tex')
-rw-r--r--shapes.tex171
1 files changed, 171 insertions, 0 deletions
diff --git a/shapes.tex b/shapes.tex
new file mode 100644
index 0000000..1471807
--- /dev/null
+++ b/shapes.tex
@@ -0,0 +1,171 @@
+\makeatletter
+
+\pgfdeclareshape{stop}{%
+ \savedanchor{\upperrightcorner}{
+ \setlength{\pgf@xa}{\pgfshapeminwidth}
+ \setlength{\pgf@ya}{\pgfshapeminheight}
+ \pgf@x=0.5\pgf@xa
+ \pgf@y=0.5\pgf@ya
+ }
+ \savedanchor{\lowerleftcorner}{
+ \setlength{\pgf@xa}{\pgfshapeminwidth}
+ \setlength{\pgf@ya}{\pgfshapeminheight}
+ \pgf@x=-0.5\pgf@xa
+ \pgf@y=-0.5\pgf@ya
+ }
+
+ \anchor{center}{\pgfpointorigin}
+ % \anchor{center}{\centerpoint}
+ \anchor{north east}{%
+ \upperrightcorner%
+ }
+ \anchor{north}{%
+ \upperrightcorner%
+ \pgf@x=0pt
+ }
+ \anchor{south east}{%
+ \upperrightcorner%
+ \pgf@y=-\pgf@y
+ }
+ \anchor{south west}{%
+ \lowerleftcorner%
+ }
+ \anchor{south}{%
+ \lowerleftcorner%
+ \pgf@x=0pt
+ }
+ \anchor{north west}{%
+ \upperrightcorner%
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{%
+ \lowerleftcorner%
+ \pgf@y=0pt
+ }
+ \anchor{east}{%
+ \upperrightcorner%
+ \pgf@y=0pt
+ }
+
+ \savedanchor{\outerfirstcentersecond}{
+ \setlength{\pgf@xa}{\pgfshapeminwidth}
+ \setlength{\pgf@ya}{\pgfshapeminheight}
+ % \divide\pgf@xa by 3
+ % \divide\pgf@xa by 2
+ \pgf@x=-.5\pgf@xa
+ \advance\pgf@x by .5\pgf@ya
+ \pgf@y=\pgf@ya
+ }
+
+ \anchor{one half}{
+ \outerfirstcentersecond
+ \pgf@y=0pt
+ }
+ \anchor{two half}{
+ \outerfirstcentersecond
+ \pgf@x=-\pgf@x
+ \pgf@y=0pt
+ }
+
+ \anchor{north one half}{
+ \outerfirstcentersecond
+ }
+ \anchor{north two half}{
+ \outerfirstcentersecond
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south one half}{
+ \outerfirstcentersecond
+ \pgf@y=-\pgf@y
+ }
+ \anchor{south two half}{
+ \outerfirstcentersecond
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+
+ \savedanchor{\outerfirstquarter}{
+ \setlength{\pgf@xa}{\pgfshapeminwidth}
+ \setlength{\pgf@ya}{\pgfshapeminheight}
+ \pgf@y=\pgf@ya
+ \pgf@x=-.5\pgf@xa % We are at (shape.north west) now
+ \advance\pgf@x by .5\pgf@ya % We are at (shape.north one half) now
+ \advance\pgf@x by \pgf@ya
+ }
+
+ \anchor{two quarter}{
+ \outerfirstquarter
+ \pgf@y=0pt
+ }
+ \anchor{three quarter}{
+ \outerfirstquarter
+ \pgf@x=-\pgf@x
+ \pgf@y=0pt
+ }
+
+ \anchor{north two quarter}{
+ \outerfirstquarter
+ }
+ \anchor{south two quarter}{
+ \outerfirstquarter
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north three quarter}{
+ \outerfirstquarter
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south three quarter}{
+ \outerfirstquarter
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+
+
+ \savedanchor{\outertop}{
+ \setlength{\pgf@ya}{\pgfshapeminheight}
+ \pgf@x=0pt
+ \pgf@y=1\pgf@ya
+ }
+
+ \anchor{north center}{
+ \outertop
+ }
+
+ \anchor{south center}{
+ \outertop
+ \pgf@y=-\pgf@y
+ }
+
+ \backgroundpath{
+ \pgfpathrectanglecorners{\lowerleftcorner}{\upperrightcorner}
+ }
+}
+
+\makeatother
+
+\tikzset{
+ stop/.style={
+ shape=stop,
+ color=black!30,
+ draw,
+ fill=yellow!30,
+ rounded corners=1cm,
+ minimum height=2cm,
+ },
+ stop1/.style={
+ stop,
+ minimum width=2cm,
+ },
+ stop2/.style={
+ stop,
+ minimum width=4cm,
+ },
+ stop3/.style={
+ stop,
+ minimum width=6cm,
+ },
+ stop4/.style={
+ stop,
+ minimum width=8cm,
+ },
+}