#!/usr/lcoal/bin/tcsh  -f

set colormap = ./colormap

if( $#argv > 0 &&  "$1" == "-h" ) then
        echo " "
	echo "Usage: showmediacolor [-h] [outdir config1 config2 ...]"
        echo "where"
        echo " -h to display this message as you see now."
	echo " outdir is the output directory (default ../Work)"
	echo " config* are config file such as config.Pb "
	echo "    made by drawconfig in Util. Default is ../Work/config.*"
	echo "    xx of config.xx must be a media name"
        echo " "
	exit 0
endif



if( $#argv > 0 ) then
	set outdir = $1
	shift
else	
	set outdir = ../Work
endif



@ n = 0
if( $#argv > 0 ) then
	while ( $#argv > 0 ) 
		@ n++
	        ./showmediacolor2 $outdir $1 $colormap  $n
		shift
	end
else
	foreach f(`gawk 'NF==5 {gsub(/\"/,"");print "../"$2}' ../Work/gnu`)
		set nl = `wc -l $f`
		if( $nl[1] > 0 ) then
			@ n++
			./showmediacolor2 $outdir $f $colormap $n
		endif	
	end	
endif

$GEOMVIEW  $outdir/mediatext   &


