[Tex/LaTex] Add new symbol to simple TikZ diagram

tikz-pgf

I'm trying to convert all my LibreOffice diagrams to TikZ, to make my Latex document slightly prettier. I've come across a problem. There are a few symbols that I don't know how to do – and due to my general lack of knowledge about TikZ don't know how to create. I figured that this must be pretty easy work in TikZ, and since I couldn't find much proper documentation, I thought I'd ask for help here.

The symbols I want to create are the ones in this image

enter image description here

Obviously the arrows are easy, and the rounded edges rectangle is easy as well (because the line half way down is optional), but I'm not sure how I'd get the rectangle with the missing side and the rectangle with a dash in the corner?

Best Answer

I propose two changes to your code. The first one is using multipart nodes for DFstore and second using append after command options to draw corner lines on DFsource and some border lines in DFstore. This way your code is simpler. Be careful because DFstore and DFsource requires \draw node instead of a single \node command.

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\begin{document}
\tikzset{
DFsource/.style={
    rectangle, 
    text width=4em, 
    node distance=3cm, 
    text centered, 
    minimum height=5em,
    append after command={% We simply travel along node rectangle and small leftupper part
        ([xshift=0.3cm] \tikzlastnode.north west)-|([yshift=-0.3cm]\tikzlastnode.north west)%
        ([yshift=-0.3cm]\tikzlastnode.north west)|-(\tikzlastnode.south east)|-%
        ([xshift=0.3cm]\tikzlastnode.north west)--cycle%
        }
    },
    DFprocess/.style = {
        rectangle, 
        draw, 
        text width=6em, 
        node distance=3cm, 
        text centered, 
        rounded corners=10, 
        minimum height=8em
    },
    DFstore/.style = {
        rectangle, 
        rectangle split,
        rectangle split parts=2,
        rectangle split horizontal, 
        rectangle split draw splits,
        node distance=3cm, 
        minimum height = 2em,
        append after command={(\tikzlastnode.north east)-|(\tikzlastnode.west)|-(\tikzlastnode.south east)},
%       append after command={(\tikzlastnode.south)-|(\tikzlastnode.text split)|-(\tikzlastnode.north)}
        append after command={(\tikzlastnode.one split north)--(\tikzlastnode.one split south)}
    }
}


\tikzstyle{line} = [draw, -latex']

\begin{tikzpicture}[node distance = 2cm, auto]
% Place Nodes
\draw[red,ultra thick] node [DFsource] (user) {User};
\node [DFprocess, right of=user] (steg) {Perform Steganalysis};
\draw node [DFsource, right of=steg] (user2) {User};
\draw node [DFstore, below of=user] (store1) {1 \nodepart{two} Bitmap Image};
\draw node [DFstore, above of=user2] (store2) {2 \nodepart{two} Results};
% Connections
\path [line] (user) -- (steg);
\path [line] (steg) -- (user2);
\path [line] (store1) |- ([yshift=-0.5cm]steg.south) -- (steg);
\path [line] (steg) |- (store2);
\end{tikzpicture}
\end{document}

enter image description here

Addition by percusse

Now, the DFSource style redraws the whole node from scratch; by providing some options to the \draw commands one can further change the node line width and color. Another advantage is that the line joins are drawn properly.