/*----------------------------------------------------------------------*/ /* (C) Copyright 1994, Stefanos Kiakas */ /* All rights reserved. */ /*----------------------------------------------------------------------*/ defineps HorizontalPipe( int east, level, arrow; float x, y ) /start_x x def /start_y0 y 15 add def /start_y1 y 35 add def %---------------------------------------------------------------------- % Purpose: Function to draw pipe. % % Parameters: none % % Return value: none %---------------------------------------------------------------------- /draw_pipe { 5 setlinewidth newpath start_x start_y0 moveto 50 0 rlineto stroke newpath start_x start_y1 moveto 50 0 rlineto stroke arrow 0 eq { newpath x 15 add y 5 add moveto 0 4 rlineto 15 0 rlineto 0 2 rlineto 5 -4 rlineto -5 -4 rlineto 0 2 rlineto -15 0 rlineto closepath fill } if arrow 2 eq { newpath x 35 add y 5 add moveto 0 4 rlineto -15 0 rlineto 0 2 rlineto -5 -4 rlineto 5 -4 rlineto 0 2 rlineto 15 0 rlineto closepath fill } if } def 0.0 setgray draw_pipe east 0 ne { /fill_length level 1 sub 5 mul def /start_x x def /direction 5 def } { /fill_length level 1 sub 5 mul neg def /start_x x 50 add def /direction 5 neg def } ifelse level 1 gt { newpath start_x start_y0 moveto fill_length 0 rlineto 0 20 rlineto fill_length neg 0 rlineto closepath fill } if level 0 gt { newpath start_x fill_length add start_y0 moveto direction 10 rlineto direction neg 10 rlineto closepath fill } if %flushgraphics endps