I'm working on a small library for Registrer Transfer Level (RTL) that I'll use a lot throughout my PhD thesis. I'm designing an operator symbol that can have a bit or a bus as input and/or output. If it is a bit, the connectors should be draw as a thin line. If it is a bus, an ultra thick line. I thought of creating two options to be passed to the shape. I now how to create them, but not how to write the if statement to get the desired results. Following the relevant code fragments.
\tikzset{input type/.initial={bus}} % bus or bit string values
\tikzset{output type/.initial={bus}}
\pgfdeclareshape{operator}{
...
\beforebackgroundpath{%
% Connectors are always black
\color{black}
% This is the part I'm getting problems with
% If input type is *bit*
\pgfsetlinewidth{.5pt} % <-- ideally, it should be the thin option from tikz,
% but I don't know how to set it
% If input type is *bus*
\pgfsetlinewidth{1pt} % <-- should be ultra thick option
% First input
\pgf@process{\pgfutil@useanchor{operator}{a}}
\pgfmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
\pgf@process{\pgfutil@useanchor{operator}{north west}}
\pgflineto{\pgfpoint{\pgf@x}{\pgf@y}}
% Second input
\pgf@process{\pgfutil@useanchor{operator}{b}}
\pgfmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
\pgf@process{\pgfutil@useanchor{operator}{south west}}
\pgflineto{\pgfpoint{\pgf@x}{\pgf@y}}
\pgfusepath{stroke}
% If output type is *bit*
\pgfsetlinewidth{.5pt}
% If output type is *bus*
\pgfsetlinewidth{1pt}
% Output
\pgf@process{\pgfutil@useanchor{operator}{r}}
\pgfmoveto{\pgfpoint{\pgf@x}{\pgf@y}}
\pgf@process{\pgfutil@useanchor{operator}{east}}
\pgflineto{\pgfpoint{\pgf@x}{\pgf@y}}
\pgfusepath{stroke}
}
...
}
It seems to be a rather easy solution, but the manual is enormous and I didn't find any clues up till now. Thanks in advance for the help.