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


1.1
date     92.07.16.11.57.43;  author thoth;  state Exp;
branches ;
next     ;


desc
@test program for boxy point sets
@



1.1
log
@Initial revision
@
text
@// Emacs: -*- C++ -*-
static char rcsid[] = "$Id$";

// 
// $Log$
// 

#include <iostream.h>
#include "BoxyIPS.h"
#include "IntPointSet.h"
#include "IPSIter.h"
#include "BoxyIPSIter.h"


void check(const IntPoint& ip, const BoxyIPS& bps)
{
    cout << "contains " << ip << "? " << (int)bps.contains(ip) << '\n';
}

void check(const IntPoint& ip, const IntPointSet& ips)
{
    cout << "contains " << ip << "? " << (int)ips.contains(ip) << '\n';
}

main()
{
    BoxyIPS bps(IntPoint(3,8,5),IntPoint(8,4,8));

    cout << bps.min() << '\n';
    cout << bps.max() << '\n';

    check(IntPoint(4,4,4), bps);
    check(IntPoint(4,4,6), bps);
    check(IntPoint(2,4,4), bps);
    check(IntPoint(2,4,8), bps);
    check(IntPoint(4,9,4), bps);
    check(IntPoint(4,4,9), bps);
    check(IntPoint(4,2,7), bps);

    {
	BoxyIPSIter	iter(bps);
	IntPoint	ip;

	while (iter.next(ip)) {
	    cout << ip << '\n';
	}
    }

    IntPointSet ips(IntPoint(3,8,5),IntPoint(8,4,8));

    cout << ips.min() << '\n';
    cout << ips.max() << '\n';

    check(IntPoint(4,4,4), ips);
    check(IntPoint(4,4,6), ips);
    check(IntPoint(2,4,4), ips);
    check(IntPoint(2,4,8), ips);
    check(IntPoint(4,9,4), ips);
    check(IntPoint(4,4,9), ips);
    check(IntPoint(4,2,7), ips);

    {
	IPSIter	iter(ips);
	IntPoint	ip;

	while (iter(ip)) {
	    cout << ip << '\n';
	}
    }
}
@
