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


1.12
date	94.07.25.16.58.52;	author thoth;	state Exp;
branches;
next	1.11;

1.11
date	93.11.17.18.02.03;	author thoth;	state Exp;
branches;
next	1.10;

1.10
date	93.09.15.12.34.09;	author thoth;	state Exp;
branches;
next	1.9;

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

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

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

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

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

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

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

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

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


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


1.12
log
@\Name sanitization
@
text
@// Emacs: -*- C++ -*-

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


// 
// $Log: MondoPS.h,v $
// Revision 1.11  1993/11/17  18:02:03  thoth
// extensivep() is now extensive()
//
// Revision 1.10  1993/09/15  12:34:09  thoth
// Pointset behavior controls have moved to IA::
//
// Revision 1.9  93/08/08  13:21:31  thoth
// deInlining of a few methods.
// 
// Revision 1.8  93/07/15  11:46:30  thoth
// New iterator virtual method.
// 
// Revision 1.7  93/05/26  16:51:37  thoth
// Copyright Notices
// 
// Revision 1.6  93/04/29  12:52:58  thoth
// Mondo PointSets are now templatized.
// 
// Revision 1.5  93/04/19  23:27:46  thoth
// Convert BaseIPS to IA_BasePS<IA_IntPoint>
// 
// Revision 1.4  93/02/12  16:27:58  thoth
// more IA_ prefixes.
// 
// Revision 1.3  92/12/16  14:48:17  thoth
// conversion to IA_ mostly complete
// 
// Revision 1.2  92/12/07  12:05:11  thoth
// new IntPoint index(unsigned) operation for use with "other" iterators.
// 
// Revision 1.1  92/09/30  10:52:47  thoth
// Initial revision
// 
//

#ifndef MondoPS_h_
#define MondoPS_h_

#include "BasePS.h"

// this is the class that contains all of the points of its dimensionality
template <class P>
class IA_WhiteHole_: public IA_BasePS<P> {
private:
    static char	type_;
public:
    IA_WhiteHole_(unsigned dim) :IA_BasePS<P>(dim) { }
    // this class contains all points of a given dimensionality
    int equal(IA_BasePS<P>* ips) const { return ips->type()==this->type() &&
				      ips->dim() == this->dimen; }
    unsigned hash_self(unsigned) const { return 0; }
    static IA::Type s_type() { return &type_; }
    IA::Type type() const { return &type_; }
    int contains(const P&) const { return 1; }
    unsigned index(const P &) const { return 0; }
    P index(unsigned idx) const;
    int extensive() const { return dimen==0;}
    IA_BasePSIter<P> *iterator() const;
    unsigned card() const {
	if (this->dimen!=0)
	    ia_throw(IA::PSET_REQUIRE_EXTENSIVE,__FILE__,__LINE__);
	return 1;
    }
    int empty() const { return 0; }
    IA_BasePS<P> *offsetted(const P &) const
	{ return new IA_WhiteHole_(dimen); }
    void output(ostream & o, unsigned indent=0) const {
      for (unsigned i=0; i<indent; i++) cout << ' ';
      o << "White"<<dimen<<'\n';
    }
};

// this is the class that contains none of the points of its dimensionality
template <class P>
class IA_BlackHole_: public IA_BasePS<P> {
private:
    static char	type_;
public:
    IA_BlackHole_(unsigned dim) :IA_BasePS<P>(dim) { }
    ~IA_BlackHole_() {}
    // this class contains no points of a given dimensionality
    int equal(IA_BasePS<P>* ips) const { return ips->type()==this->type() &&
				      ips->dim()==this->dimen; }
    unsigned hash_self(unsigned mod) const { return (1+dimen)%mod; }
    static IA::Type s_type() { return &type_; }
    IA::Type type() const { return &type_; }
    int contains(const P&) const { return 0; }
    unsigned index(const P &) const {
	if (IA::throw_on_index_uncontained)
	    ia_throw(IA::PSET_INDEX_UNCONTAINED, __FILE__,__LINE__);
	return IA::index_of_uncontained;
    }
    P index(unsigned) const;
    int extensive() const { return 1;}
    IA_BasePSIter<P> *iterator() const;
    unsigned card() const { return 0;}
    int empty() const { return 1; }
    IA_BasePS<P> *offsetted(const P &) const
	{ return new IA_BlackHole_(dimen); }
    void output(ostream & o, unsigned indent=0) const {
      for (unsigned i=0; i<indent; i++) cout << ' ';
      o << "Black"<<dimen<<'\n';
    }
};

#endif
@


1.11
log
@extensivep() is now extensive()
@
text
@d11 3
d62 2
a63 2
    static IA_PointSetType s_type() { return &type_; }
    IA_PointSetType type() const { return &type_; }
d95 2
a96 2
    static IA_PointSetType s_type() { return &type_; }
    IA_PointSetType type() const { return &type_; }
@


1.10
log
@Pointset behavior controls have moved to IA::
@
text
@d10 4
a13 1
// $Log:	MondoPS.h,v $
d64 1
a64 1
    int extensivep() const { return dimen==0;}
d101 1
a101 1
    int extensivep() const { return 1;}
@


1.9
log
@deInlining of a few methods.
@
text
@d11 3
a43 1
#include "IntPointSet.h"
d93 1
a93 1
	if (IA_IntPointSet::throw_on_index_uncontained)
d95 1
a95 1
	return IA_IntPointSet::index_of_uncontained;
@


1.8
log
@New iterator virtual method.
@
text
@d11 3
d58 1
a58 10
    P index(unsigned idx) const {
	if (this->dimen!=0) {
	    ia_throw(IA::PSET_REQUIRE_EXTENSIVE,__FILE__,__LINE__);
	}
	if (idx!=0) {
	    if (IA_IntPointSet::throw_on_index_uncontained)
		ia_throw(IA::PSET_INDEX_UNCONTAINED, __FILE__,__LINE__);
	}
	return P();
    }
d95 1
a95 5
    P index(unsigned) const {
	if (IA_IntPointSet::throw_on_index_uncontained)
	    ia_throw(IA::PSET_INDEX_UNCONTAINED, __FILE__,__LINE__);
	return P();
    }
@


1.7
log
@Copyright Notices
@
text
@d11 3
d66 1
d107 1
@


1.6
log
@Mondo PointSets are now templatized.
@
text
@d3 6
d11 3
@


1.5
log
@Convert BaseIPS to IA_BasePS<IA_IntPoint>
@
text
@d5 3
d29 2
a30 1
class IA_WhiteHole_: public IA_BasePS<IA_IntPoint> {
d34 1
a34 1
    IA_WhiteHole_(unsigned dim) :IA_BasePS<IA_IntPoint>(dim) { }
d36 1
a36 1
    int equal(IA_BasePS<IA_IntPoint>* ips) const { return ips->type()==this->type() &&
d41 3
a43 3
    int contains(const IA_IntPoint&) const { return 1; }
    unsigned index(const IA_IntPoint &) const { return 0; }
    IA_IntPoint index(unsigned idx) const {
d51 1
a51 1
	return IA_IntPoint();
d60 1
a60 1
    IA_BasePS<IA_IntPoint> *offsetted(const IA_IntPoint &) const
d69 2
a70 1
class IA_BlackHole_: public IA_BasePS<IA_IntPoint> {
d74 1
a74 1
    IA_BlackHole_(unsigned dim) :IA_BasePS<IA_IntPoint>(dim) { }
d77 1
a77 1
    int equal(IA_BasePS<IA_IntPoint>* ips) const { return ips->type()==this->type() &&
d82 2
a83 2
    int contains(const IA_IntPoint&) const { return 0; }
    unsigned index(const IA_IntPoint &) const {
d88 1
a88 1
    IA_IntPoint index(unsigned) const {
d91 1
a91 1
	return IA_IntPoint();
d96 1
a96 1
    IA_BasePS<IA_IntPoint> *offsetted(const IA_IntPoint &) const
@


1.4
log
@more IA_ prefixes.
@
text
@d5 3
d22 1
a22 1
#include "BaseIPS.h"
d26 1
a26 1
class IA_WhiteHole_: public BaseIPS {
d30 1
a30 1
    IA_WhiteHole_(unsigned dim) :BaseIPS(dim) { }
d32 1
a32 1
    int equal(BaseIPS* ips) const { return ips->type()==this->type() &&
d56 1
a56 1
    BaseIPS *offsetted(const IA_IntPoint &) const
d65 1
a65 1
class IA_BlackHole_: public BaseIPS {
d69 1
a69 1
    IA_BlackHole_(unsigned dim) :BaseIPS(dim) { }
d72 1
a72 1
    int equal(BaseIPS* ips) const { return ips->type()==this->type() &&
d91 1
a91 1
    BaseIPS *offsetted(const IA_IntPoint &) const
@


1.3
log
@conversion to IA_ mostly complete
@
text
@d5 3
d23 1
a23 1
class IA_WhiteHole: public BaseIPS {
d27 1
a27 1
    IA_WhiteHole(unsigned dim) :BaseIPS(dim) { }
d32 2
a33 2
    static PointSetType s_type() { return &type_; }
    PointSetType type() const { return &type_; }
d54 1
a54 1
	{ return new IA_WhiteHole(dimen); }
d62 1
a62 1
class IA_BlackHole: public BaseIPS {
d66 2
a67 2
    IA_BlackHole(unsigned dim) :BaseIPS(dim) { }
    ~IA_BlackHole() {}
d72 2
a73 2
    static PointSetType s_type() { return &type_; }
    PointSetType type() const { return &type_; }
d89 1
a89 1
	{ return new IA_BlackHole(dimen); }
@


1.2
log
@new IntPoint index(unsigned) operation for use with "other" iterators.
@
text
@d5 3
d20 1
a20 1
class _WhiteHole: public BaseIPS {
d24 1
a24 1
    _WhiteHole(unsigned dim) :BaseIPS(dim) { }
d31 3
a33 3
    int contains(const IntPoint&) const { return 1; }
    unsigned index(const IntPoint &) const { return 0; }
    IntPoint index(unsigned idx) const {
d38 1
a38 1
	    if (IntPointSet::throw_on_index_uncontained)
d41 1
a41 1
	return IntPoint();
d50 2
a51 2
    BaseIPS *offsetted(const IntPoint &) const
	{ return new _WhiteHole(dimen); }
d59 1
a59 1
class _BlackHole: public BaseIPS {
d63 2
a64 2
    _BlackHole(unsigned dim) :BaseIPS(dim) { }
    ~_BlackHole() {}
d71 3
a73 3
    int contains(const IntPoint&) const { return 0; }
    unsigned index(const IntPoint &) const {
	if (IntPointSet::throw_on_index_uncontained)
d75 1
a75 1
	return IntPointSet::index_of_uncontained;
d77 2
a78 2
    IntPoint index(unsigned idx) const {
	if (IntPointSet::throw_on_index_uncontained)
d80 1
a80 1
	return IntPoint();
d85 2
a86 2
    BaseIPS *offsetted(const IntPoint &) const
	{ return new _BlackHole(dimen); }
@


1.1
log
@Initial revision
@
text
@d4 4
a7 1
// $Log:	IntPointSet.c,v $
d30 10
d73 5
@
