% __TPppic.tex,v 1.3 2002/11/14 20:46:00 hansfn Exp
%  
% TeXPower bundle - dynamic online presentations with LaTeX
% Copyright (C) 1999-2002 Stephan Lehmke
% 
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
% 
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
%-----------------------------------------------------------------------------------------------------------------
% File: __TPppic.tex
%
% Code for the PSTricks picture example for the package texpower.sty.
% 
% This file is input by others. Don't compile it separately.
%
%-----------------------------------------------------------------------------------------------------------------
% Autor: Stephan Lehmke <Stephan.Lehmke@cs.uni-dortmund.de>
%
% v0.0.1 Mar 21, 2000: First version for the pre-alpha release of TeXPower.
%
% v0.0.2 Apr 19, 2000: Using \bstep instead of \boxedsteps.
%
% v0.0.3 Apr 28, 2000: Some small changes in preparation of the update to TeXpower v0.0.7.
%

%-----------------------------------------------------------------------------------------------------------------
%
% This has nothing to do with \stepwise, just setting up the picture...
%
\newcommand{\Block}[1]
{%
  \begin{pspicture}(-4,-2)(4,2)
    \pspolygon(-4,0)(-2,2)(2,2)(4,0)(2,-2)(-2,-2)
    \rput(0,0){#1}
  \end{pspicture}%
  }%
\ifthenelse{\boolean{TPcolor}}
{\psset{unit=3mm,fillstyle=solid,fillcolor=highlightcolor,linecolor=textcolor}}%
{\psset{unit=3mm}}%
%
% In the following picture, picture items are built incrementally.
%
% \stepwise generates a sequence of slides, all alike. The only difference ist that on every slide, one more of the
% \step commands occurring in the argument of \stepwise are `activated'. This way the stuff inside the argument of
% \stepwise is gone through `step by step'.
%
\stepwise
{%
  \begin{center}
    \large
    \begin{pspicture}(-1,-13)(33,9)
      \rput(0,0){\rnode{x}{\fboxrule0pt\fbox{$x[t]$}}}
      \rput(32,0){\rnode{y}{\fboxrule0pt\fbox{$y(t)$}}}
      {%
        % The effect of the \step command is to `hide' its argument on the first slide of the sequence generated by
        % \stepwise and display it on all other slides of this sequence. The second \step command starts displaying on
        % the third slide and so on...   
        %
        % Usually `hiding' means ignoring altogehter. For the following application however, the box displayed by
        % \step is used as an node in the picture. This means that instead of ignoring its argument, it's better if
        % \step displays an appropriate amount of blank space.
        % This behaviour (create blank space) is exhibited by the command \bstep.
        \rput(4,0){\rnode{V}{\bstep{\psframebox{\Large$V$}}}}
        \ncline{->}{x}{V}
        %
        % The command \rebstep allows both boxes to appear simultaneously.
        %
        \rput(28,0){\rnode{plus}{\rebstep{\psframebox{\Large$+$}}}}
        }%
      \ncline{->}{plus}{y}
      % By using \restep again, the two boxes defining the operators appear at the same time as the first block of the
      % diagram, which is produced by the following commands.
      \restep
      {%
        % We use \afterstep{\pageTransitionDissolve} to make this first step of the diagram appear with a fancy page
        % transition. We have to use \afterstep because the page transition setting would be undone by the group
        % closing contained in \end{pspicture}.
        \afterstep{\pageTransitionDissolve}%
        \rput(16,0){\rnode{IBlk}{\Block{I-Block}}}
        \ncline{->}{V}{IBlk}
        \Aput{$x[t]$}
        \ncline{->}{IBlk}{plus}
        \Aput
        {%
          %
          % Here, one use of \step is nested inside the other. 
          $%
          % Note how the math spacing is corrected manually by adding {} after \cdot. Otherwise, \cdot wouldn't be
          % aware that something is following and act as a postfix (instead of infix) operator.
          % \afterstep is used again to reset the page transition to Replace for the building of the formula.
          \bstep{\afterstep{\pageTransitionReplace}{}b\cdot{}}%
          \bstep{\int\limits^t_0 x(\tau)\,d\tau}%
          $%
          }%
        }%
      \step
      {%
        \afterstep{\pageTransitionDissolve}%
        \rput(16,6){\rnode{PBlk}{\Block{P-Block}}}
        \ncangle[angleA=90,angleB=180,fillstyle=none]{->}{V}{PBlk}
        \Aput{$x(t)$}
        \ncangle[angleB=90,fillstyle=none]{->}{PBlk}{plus}
        \aput(.5){$a\cdot x(t)$}
        }%
      \step
      {%
        \rput(16,-6){\rnode{DBlk}{\Block{D-Block}}}
        \ncangle[angleA=-90,angleB=180,fillstyle=none]{->}{V}{DBlk}
        \Aput{$x(t)$}
        \ncangle[angleB=-90,fillstyle=none]{->}{DBlk}{plus}
        \aput(.5){$\displaystyle c\cdot \left(\frac{dx}{d\tau}\right)(t)$}
        }
    \end{pspicture}%
  \end{center}
  }%

% The whole execution of \stepwise is encapsuled in a group to make all changes local. This affects also the setting
% of the page transition to dissolve in the last but one step. We set it again explicitly to make the last step appear
% with this page transition as well.

\pageTransitionDissolve


%%% Local Variables: 
%%% mode: latex
%%% fill-column: 120
%%% TeX-master: "picexample"
%%% End: 
