head	1.11;
access;
symbols
	r2_1:1.9
	r2_0:1.9
	r1_1_beta:1.9
	r1_1_alpha:1.9
	r1_0:1.9
	r0_11:1.9
	r0_10:1.8
	r0_9:1.8
	Eglin_alpha_1:1.5;
locks; strict;
comment	@// @;


1.11
date	94.11.10.19.53.56;	author ljr;	state Exp;
branches;
next	1.10;

1.10
date	94.10.06.17.39.00;	author fjsoria;	state Exp;
branches;
next	1.9;

1.9
date	94.03.30.13.47.16;	author thoth;	state Exp;
branches;
next	1.8;

1.8
date	93.09.15.12.34.02;	author thoth;	state Exp;
branches;
next	1.7;

1.7
date	93.08.08.13.21.18;	author thoth;	state Exp;
branches;
next	1.6;

1.6
date	93.07.15.11.46.00;	author thoth;	state Exp;
branches;
next	1.5;

1.5
date	93.05.26.16.51.35;	author thoth;	state Exp;
branches;
next	1.4;

1.4
date	93.04.29.12.52.52;	author thoth;	state Exp;
branches;
next	1.3;

1.3
date	93.02.12.16.27.49;	author thoth;	state Exp;
branches;
next	1.2;

1.2
date	92.12.16.14.49.59;	author thoth;	state Exp;
branches;
next	1.1;

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


desc
@The White and Black hole classes.
eventually they will be templatized.
@


1.11
log
@Added IA_NO_RCS_STATIC_DATA guard.
@
text
@// Emacs: -*- C++ -*-

//
//	Copyright 1993, Center for Computer Vision and Visualization,
//	University of Florida.  All rights reserved.
//

#ifndef IA_NO_RCS_STATIC_DATA
static char rcsid[] = "$Id: MondoPS.c,v 1.10 1994/10/06 17:39:00 fjsoria Exp ljr $";
#endif

// 
// $Log: MondoPS.c,v $
// Revision 1.10  1994/10/06  17:39:00  fjsoria
// commented rscid[] line
//
// Revision 1.9  1994/03/30  13:47:16  thoth
// Renamed files to BasePSIter.
//
// Revision 1.8  1993/09/15  12:34:02  thoth
// Pointset behavior controls have moved to IA::
//
// Revision 1.7  93/08/08  13:21:18  thoth
// deInlining of a few methods.
// 
// Revision 1.6  93/07/15  11:46:00  thoth
// Iterators for Mondo PSs are now hidden inside the Mondo Module.
// 
// Revision 1.5  93/05/26  16:51:35  thoth
// Copyright Notices
// 
// Revision 1.4  93/04/29  12:52:52  thoth
// Mondo PointSets are now templatized.
// 
// Revision 1.3  93/02/12  16:27:49  thoth
// more IA_ prefixes.
// 
// Revision 1.2  92/12/16  14:49:59  thoth
// conversion to IA_ mostly complete
// 
// Revision 1.1  92/09/30  10:52:18  thoth
// Initial revision
// 
//

#include "MondoPS.h"
#include "BasePSIter.h"

#include "Point.h"

#ifndef IA_NO_AUTOINST_OF_STATIC_DATA
template <class P> char IA_WhiteHole_<P>::type_;
template <class P> char IA_BlackHole_<P>::type_;
#endif

#define WhiteIter IA_WhiteIter
#define BlackIter IA_BlackIter

template <class P>
class WhiteIter: public IA_BasePSIter<P> {
private:
    int	done;
public:
    WhiteIter(IA_WhiteHole_<P> *ps): IA_BasePSIter<P>(ps) { done=0; }
    IA_BasePSIter<P> *clone_self() {
	return new WhiteIter((IA_WhiteHole_<P>*)domain);
    }
    int next(P& ip) {
	if (done)
	    return 0;
	else {
	    ip = P();
	    done = 1;
	    return 1;
	}
    }
    void reset() { done=0; }
};

template <class P>
class BlackIter: public IA_BasePSIter<P> {
public:
    BlackIter(IA_BlackHole_<P> *ps): IA_BasePSIter<P>(ps) {}
    IA_BasePSIter<P> *clone_self() {
	return new BlackIter((IA_BlackHole_<P>*)domain);
    }
    int next(P&) {
	return 0;
    }
    void reset() {}
};

//
//
template <class P>
P IA_BlackHole_<P>::index(unsigned) const {
    if (IA::throw_on_index_uncontained)
	ia_throw(IA::PSET_INDEX_UNCONTAINED, __FILE__,__LINE__);
    return P();
}

template <class P>
IA_BasePSIter<P> * IA_BlackHole_<P>::iterator() const
{
    return new BlackIter<P>((IA_BlackHole_<P>*)this);
}

template <class P>
P IA_WhiteHole_<P>::index(unsigned idx) const {
    if (this->dimen!=0) {
	ia_throw(IA::PSET_REQUIRE_EXTENSIVE,__FILE__,__LINE__);
    }
    if (idx!=0) {
	if (IA::throw_on_index_uncontained)
	    ia_throw(IA::PSET_INDEX_UNCONTAINED, __FILE__,__LINE__);
    }
    return P();
}

template <class P>
IA_BasePSIter<P> * IA_WhiteHole_<P>::iterator() const
{
    return new WhiteIter<P>((IA_WhiteHole_<P>*)this);
}
@


1.10
log
@commented rscid[] line
@
text
@d8 3
a10 1
//static char rcsid[] = "$Id: MondoPS.c,v 1.9 1994/03/30 13:47:16 thoth Exp fjsoria $";
d14 3
@


1.9
log
@Renamed files to BasePSIter.
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: MondoPS.c,v 1.8 1993/09/15 12:34:02 thoth Exp thoth $";
d12 3
d46 1
a47 1

d49 1
@


1.8
log
@Pointset behavior controls have moved to IA::
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: MondoPS.c,v 1.7 93/08/08 13:21:18 thoth Exp Locker: thoth $";
d11 4
a14 1
// $Log:	MondoPS.c,v $
d39 1
a39 1
#include "BaseIPSIter.h"
@


1.7
log
@deInlining of a few methods.
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: MondoPS.c,v 1.6 93/07/15 11:46:00 thoth Exp Locker: thoth $";
d12 3
d85 1
a85 1
    if (IA_IntPointSet::throw_on_index_uncontained)
d102 1
a102 1
	if (IA_IntPointSet::throw_on_index_uncontained)
@


1.6
log
@Iterators for Mondo PSs are now hidden inside the Mondo Module.
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: MondoPS.c,v 1.5 93/05/26 16:51:35 thoth Exp Locker: thoth $";
d12 3
d35 2
d80 6
d92 13
@


1.5
log
@Copyright Notices
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: MondoPS.c,v 1.4 93/04/29 12:52:52 thoth Exp Locker: thoth $";
d12 3
d30 1
d35 51
@


1.4
log
@Mondo PointSets are now templatized.
@
text
@a1 1
static char rcsid[] = "$Id: MondoPS.c,v 1.3 93/02/12 16:27:49 thoth Exp Locker: thoth $";
d3 7
d12 3
@


1.3
log
@more IA_ prefixes.
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: MondoPS.c,v 1.2 92/12/16 14:49:59 thoth Exp Locker: thoth $";
d6 3
d19 3
a21 2
char IA_WhiteHole_::type_;
char IA_BlackHole_::type_;
@


1.2
log
@conversion to IA_ mostly complete
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: MondoPS.c,v 1.1 92/09/30 10:52:18 thoth Exp Locker: thoth $";
d6 3
d16 2
a17 2
char IA_WhiteHole::type_;
char IA_BlackHole::type_;
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: IntPointSet.c,v 1.7 92/09/20 17:38:44 thoth Exp Locker: thoth $";
d5 4
a8 1
// $Log:	IntPointSet.c,v $
d13 2
a14 2
char _WhiteHole::type_;
char _BlackHole::type_;
@
