\setcounter{section}{-1}

\newlength{\noderadius}
\newlength{\nodesize}

\tikzset{noderadius/.code={\noderadius=#1},
         noderadius=4.5pt,
         nodesize/.code={\nodesize=#1},
         nodesize=6.5pt}

\makeatletter
\pgfdeclareshape{ccross}{
  \inheritsavedanchors[from=rectangle]
  \inheritanchorborder[from=rectangle]
  \inheritanchor[from=rectangle]{center}
  \inheritanchor[from=rectangle]{north}
  \inheritanchor[from=rectangle]{south}
  \inheritanchor[from=rectangle]{west}
  \inheritanchor[from=rectangle]{east}
  \inheritanchor[from=rectangle]{north west}
  \inheritanchor[from=rectangle]{south east}
  \inheritanchor[from=rectangle]{south west}
  \inheritanchor[from=rectangle]{north east}
  \inheritanchor[from=rectangle]{base}
  \inheritanchor[from=rectangle]{base east}
  \inheritanchor[from=rectangle]{base west}
  \inheritanchor[from=rectangle]{mid}
  \inheritanchor[from=rectangle]{mid east}
  \inheritanchor[from=rectangle]{mid west}
  \backgroundpath{
    \centering \pgf@xc=\pgf@x \pgf@yc=\pgf@y
    \pgfsetlinewidth{\nodesize * .3}
    \pgfpathmoveto{\pgfpoint{\pgf@xc - \nodesize * .5}{\pgf@yc - \nodesize * .5}}
    \pgfpathlineto{\pgfpoint{\pgf@xc + \nodesize * .5}{\pgf@yc + \nodesize * .5}}
    \pgfusepath{stroke}
    \pgfpathmoveto{\pgfpoint{\pgf@xc - \nodesize * .5}{\pgf@yc + \nodesize * .5}}
    \pgfpathlineto{\pgfpoint{\pgf@xc + \nodesize * .5}{\pgf@yc - \nodesize * .5}}
    \pgfusepath{stroke}
  }
}
\makeatother

\makeatletter
\pgfdeclareshape{ccircle}{
  \inheritsavedanchors[from=circle]
  \inheritanchorborder[from=circle]
  \inheritanchor[from=circle]{center}
  \inheritanchor[from=circle]{north}
  \inheritanchor[from=circle]{south}
  \inheritanchor[from=circle]{west}
  \inheritanchor[from=circle]{east}
  \inheritanchor[from=circle]{north west}
  \inheritanchor[from=circle]{south east}
  \inheritanchor[from=circle]{south west}
  \inheritanchor[from=circle]{north east}
  \inheritanchor[from=circle]{base}
  \inheritanchor[from=circle]{base east}
  \inheritanchor[from=circle]{base west}
  \inheritanchor[from=circle]{mid}
  \inheritanchor[from=circle]{mid east}
  \inheritanchor[from=circle]{mid west}
  \backgroundpath{
    \centering \pgf@xc=\pgf@x \pgf@yc=\pgf@y
    \pgfpathcircle{\pgfpoint{\pgf@xc}{\pgf@yc}}{\noderadius}
    \pgfusepath{fill,stroke}
  }
}
\makeatother

\makeatletter
\pgfdeclareshape{cring}{
    \inheritsavedanchors[from=circle]
    \inheritanchorborder[from=circle]
    \inheritanchor[from=circle]{center}
    \inheritanchor[from=circle]{north}
    \inheritanchor[from=circle]{south}
    \inheritanchor[from=circle]{west}
    \inheritanchor[from=circle]{east}
    \inheritanchor[from=circle]{north west}
    \inheritanchor[from=circle]{south east}
    \inheritanchor[from=circle]{south west}
    \inheritanchor[from=circle]{north east}
    \inheritanchor[from=circle]{base}
    \inheritanchor[from=circle]{base east}
    \inheritanchor[from=circle]{base west}
    \inheritanchor[from=circle]{mid}
    \inheritanchor[from=circle]{mid east}
    \inheritanchor[from=circle]{mid west}
    \backgroundpath{
        \centering \pgf@xc=\pgf@x \pgf@yc=\pgf@y
        \pgfsetlinewidth{1pt}
        \pgfpathcircle{\pgfpoint{\pgf@xc}{\pgf@yc}}{\noderadius}
        \pgfusepath{stroke}
    }
}
\makeatother

% defining the new dimension
\newlength{\hatchspread}
\newlength{\hatchthickness}
% declaring the keys in tikz
\tikzset{hatchspread/.code={\hatchspread=#1},
         hatchthickness/.code={\hatchthickness=#1},
         hatchspread=6pt,
         hatchthickness=0.1pt}

% declaring the pattern
\pgfdeclarepatternformonly% variables
   {chatch}% name
   {\pgfqpoint{-2\hatchthickness}{-2\hatchthickness}}% lower left corner
   {\pgfqpoint%
     {\dimexpr\hatchspread+2\hatchthickness}%
     {\dimexpr\hatchspread+2\hatchthickness}%
   }% upper right corner
   {\pgfqpoint{\hatchspread}{\hatchspread}}% tile size
   {% shape description
    \pgfsetlinewidth{\hatchthickness}
    \pgfpathmoveto{\pgfqpoint{0pt}{\hatchspread}}
    \pgfpathlineto{\pgfqpoint{\dimexpr\hatchspread+0.15pt}{-0.15pt}}
    \pgfpathclose%
    \pgfusepath{stroke}
   }

% defining the new dimensions
\newlength{\dotstep}
\newlength{\dotthickness}
% declaring the keys in tikz
\tikzset{dotstep/.code={\dotstep=#1},
         dotthickness/.code={\dotthickness=#1},
         dotstep=6pt,
         dotthickness=0.2pt}
% declaring the pattern
\pgfdeclarepatternformonly% variables
   {cdots}% name
   {\pgfqpoint{-2\dotthickness}{-2\dotthickness}}% lower left corner
   {\pgfqpoint%
     {\dimexpr\dotstep+2\dotthickness}%
     {\dimexpr\dotstep+2\dotthickness}%
   }% upper right corner
   {\pgfqpoint{\dotstep}{\dotstep}}% tile size
   {% shape description
    \pgfsetlinewidth{\dotthickness}
    \pgfpathmoveto{\pgfpoint{.5\dotstep - \dotthickness}{.5\dotstep - \dotthickness}}
    \pgfpathlineto{\pgfpoint{.5\dotstep + \dotthickness}{.5\dotstep + \dotthickness}}
    \pgfusepath{stroke}
    \pgfpathmoveto{\pgfpoint{.5\dotstep - \dotthickness}{.5\dotstep + \dotthickness}}
    \pgfpathlineto{\pgfpoint{.5\dotstep + \dotthickness}{.5\dotstep - \dotthickness}}
    \pgfusepath{stroke}
   }

