head	1.1;
access;
symbols;
locks; strict;
comment	@// @;


1.1
date	94.06.20.05.32.43;	author rjj;	state Exp;
branches;
next	;


desc
@Initial control version.
@


1.1
log
@Initial revision
@
text
@// test-shaped-ps.c
//      Copyright 1994, Center for Computer Vision and Visualization,
//      University of Florida.  All rights reserved.
//
// This program takes upto three command line arguments:
//      1st arg: radius of shaped-pointset to use (default == 1)
//      2nd arg: if 1 then use digital_disc(), cross_hair() otherwise

#include "shaped-pointset.h"
#include "PSIter.h"


void main(int argc, char *argv[]) {
    
    if (argc == 1) {
	cerr << "usage: " << argv[0]
	     << " radius  pointset(0=>cross-hair,1=>digital-disc)  dimensions"
	     << endl;
	exit(1);
    }

    // Radius value ?
    int argvalue = ( argc > 1 ? atoi(argv[1]) : 1);
    unsigned int
	radius(argvalue > 1 ? argvalue : 1);
    cerr << "Using radius = " << radius << endl;
    
    // Point set shape ?
    //   == 0 => cross_hair()
    //   == 1 => digital_disc()
    int psShape = ( argc > 2 ? atoi(argv[2]) : 0);
    cerr << "Using point set shape = " <<
	    (psShape ? "digital_disc()" : "cross_hair()") << endl;

	
    // Dimensions ?
    unsigned int dimen = ( argc > 3 ? atoi(argv[3]) : 2 );
    cerr << "Using dimension of: " << dimen << endl;

    IA_Point<int>
	origin = extend_to_point( int(0), dimen );
    IA_Set<IA_Point<int> >
	ps;

    switch (psShape) {
    case 1:
	ps = digital_disc( origin, radius );
	break;
    default:
	ps = cross_hair( origin, radius );
	break;
    };

    IA_PSIter<IA_Point<int> >
	ips( ps );

    int i=1;
    IA_Point<int> p;
    while( ips(p) ) {
	cout << p;
	if (i++ % 5)
	    cout << " ";
	else
	    cout << endl;
    }
    cout << endl;
}
@
