head	1.20;
access;
symbols
	r2_1:1.20
	r2_0:1.20
	r1_1_beta:1.20
	r1_1_alpha:1.19
	r1_0:1.19
	r0_11:1.19
	r0_10:1.19
	r0_9:1.19
	Eglin_alpha_1:1.17;
locks; strict;
comment	@// @;


1.20
date	94.07.25.16.58.52;	author thoth;	state Exp;
branches;
next	1.19;

1.19
date	93.11.17.18.02.03;	author thoth;	state Exp;
branches;
next	1.18;

1.18
date	93.07.15.11.35.24;	author thoth;	state Exp;
branches;
next	1.17;

1.17
date	93.05.26.16.41.04;	author thoth;	state Exp;
branches;
next	1.16;

1.16
date	93.04.19.23.27.37;	author thoth;	state Exp;
branches;
next	1.15;

1.15
date	93.04.17.14.52.54;	author thoth;	state Exp;
branches;
next	1.14;

1.14
date	93.02.12.16.26.18;	author thoth;	state Exp;
branches;
next	1.13;

1.13
date	92.12.16.14.47.58;	author thoth;	state Exp;
branches;
next	1.12;

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

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

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

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

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

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

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

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

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

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

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

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


desc
@Header file for the Boxy IntPointSet data structure.
@


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

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

// 
// $Log: BoxyIPS.h,v $
// Revision 1.19  1993/11/17  18:02:03  thoth
// extensivep() is now extensive()
//
// Revision 1.18  1993/07/15  11:35:24  thoth
// Add support for iterator virtual method.
//
// Revision 1.17  93/05/26  16:41:04  thoth
// Copyright Notices.
// 
// Revision 1.16  93/04/19  23:27:37  thoth
// Convert BaseIPS to IA_BasePS<IA_IntPoint>
// 
// Revision 1.15  93/04/17  14:52:54  thoth
// Use IA_IntPoint instead of IntPoint
// 
// Revision 1.14  93/02/12  16:26:18  thoth
// more IA_ prefixes.
// 
// Revision 1.13  92/12/16  14:47:58  thoth
// conversion to IA_ mostly complete
// 
// Revision 1.12  92/12/07  12:05:03  thoth
// new IntPoint index(unsigned) operation for use with "other" iterators.
// 
// Revision 1.11  92/09/30  10:27:34  thoth
// type() system now based on address of static data member.
// contains now accepts const Point<>&.
// infimum & supremum virtuals now inf & sup.
// 
// Revision 1.10  92/09/20  17:37:37  thoth
// fixed spelling error
// 
// Revision 1.9  92/09/20  14:05:46  thoth
// new infimum and supremum methods for point sets.
// 
// Revision 1.8  92/09/03  13:31:10  thoth
// hash_self now deals with unsigneds
// 
// Revision 1.7  92/08/25  15:28:40  thoth
// new offsetted virtual functions
// 
// Revision 1.6  92/08/23  13:29:57  thoth
// CFrontified version
// 
// 

#ifndef BoxyIPS_h_
#define BoxyIPS_h_

#ifdef IA_PRII
#pragma interface
#endif

#include "BasePS.h"
#include "IntPoint.h"

class IA_BoxyIPSIter;

class IA_BoxyIPS: public IA_BasePS<IA_Point<int> > {
private:
  static char	type_;
protected:
    // invariants:
    // dimen>0
    // start is pointwise <= end
    // start and end are included in the pointset (the boundaries are a part).
    IA_Point<int> start, end;
public:

    ~IA_BoxyIPS() { }
    IA_BoxyIPS(const IA_Point<int>&, const IA_Point<int>&);
    IA_BoxyIPS(const IA_BoxyIPS&);
    IA_BoxyIPS& operator=(const IA_BoxyIPS&);

    int equal(IA_BasePS<IA_Point<int> >*) const;
    unsigned hash_self(unsigned) const;
    int operator==(const IA_BoxyIPS&) const;

    // I hate the tail end of page 179, but the constness differentiates.
    //static IA::Type type() { return &type_; }
    static IA::Type s_type() { return &type_; }
    IA::Type type() const { return &type_; }

    int contains(const IA_Point<int>&) const;
    unsigned index(const IA_Point<int>&) const;
    IA_Point<int> index(unsigned) const;

    IA_Point<int> min() const { return start; }
    IA_Point<int> max() const { return end; }
    IA_Point<int> inf() const { return start; }
    IA_Point<int> sup() const { return end; }
    IA_Point<int> choice() const { return this->min(); }

    unsigned card() const;
    int empty() const { return 0; }

    IA_BasePS<IA_Point<int> > *offsetted(const IA_Point<int> &ip) const
	{ return new IA_BoxyIPS(start+ip, end+ip); }

    int extensive() const { return 1; }

    virtual IA_BasePSIter<IA_Point<int> > *iterator() const;

    void output(ostream &, unsigned=0) const;
    // extra functions

    // This method returns the n-1 dimensional shadow of the
    // boxy point set.  (Basically, we chop off the first coordinate).
    // This method is used to convert a boxy point set to the yoder
    // representation.
    // Calling this method on a BoxyIPS of dimension 0 is an error.
    // Calling this method on a BoxyIPS of dimension 1 is not
    // particularly useful.
    IA_BoxyIPS shadow() const {
	return IA_BoxyIPS(cdr(start), cdr(end));
    }
    unsigned	width(unsigned i) const { return end[i]-start[i]+1; }

    friend class IA_BoxyIPSIter;
};

#endif
@


1.19
log
@extensivep() is now extensive()
@
text
@d10 3
d68 1
a68 1
class IA_BoxyIPS: public IA_BasePS<IA_IntPoint> {
d76 1
a76 1
    IA_IntPoint start, end;
d80 1
a80 1
    IA_BoxyIPS(const IA_IntPoint&, const IA_IntPoint&);
d84 1
a84 1
    int equal(IA_BasePS<IA_IntPoint>*) const;
d89 13
a101 13
    //static IA_PointSetType type() { return &type_; }
    static IA_PointSetType s_type() { return &type_; }
    IA_PointSetType type() const { return &type_; }

    int contains(const IA_IntPoint&) const;
    unsigned index(const IA_IntPoint&) const;
    IA_IntPoint index(unsigned) const;

    IA_IntPoint min() const { return start; }
    IA_IntPoint max() const { return end; }
    IA_IntPoint inf() const { return start; }
    IA_IntPoint sup() const { return end; }
    IA_IntPoint choice() const { return this->min(); }
d106 1
a106 1
    IA_BasePS<IA_IntPoint> *offsetted(const IA_IntPoint &ip) const
d111 1
a111 1
    virtual IA_BasePSIter<IA_IntPoint> *iterator() const;
@


1.18
log
@Add support for iterator virtual method.
@
text
@d9 4
a12 1
// $Log:	BoxyIPS.h,v $
d106 1
a106 1
    int extensivep() const { return 1; }
@


1.17
log
@Copyright Notices.
@
text
@d10 3
d104 2
@


1.16
log
@Convert BaseIPS to IA_BasePS<IA_IntPoint>
@
text
@d3 5
d10 3
@


1.15
log
@Use IA_IntPoint instead of IntPoint
@
text
@d5 3
d46 2
a47 1
#include "BaseIPS.h"
d51 1
a51 1
class IA_BoxyIPS: public BaseIPS {
d67 1
a67 1
    int equal(BaseIPS*) const;
d89 1
a89 1
    BaseIPS *offsetted(const IA_IntPoint &ip) const
@


1.14
log
@more IA_ prefixes.
@
text
@d5 3
d55 1
a55 1
    IntPoint start, end;
d59 1
a59 1
    IA_BoxyIPS(const IntPoint&, const IntPoint&);
d72 3
a74 3
    int contains(const IntPoint&) const;
    unsigned index(const IntPoint&) const;
    IntPoint index(unsigned) const;
d76 5
a80 5
    IntPoint min() const { return start; }
    IntPoint max() const { return end; }
    IntPoint inf() const { return start; }
    IntPoint sup() const { return end; }
    IntPoint choice() const { return this->min(); }
d85 1
a85 1
    BaseIPS *offsetted(const IntPoint &ip) const
@


1.13
log
@conversion to IA_ mostly complete
@
text
@d5 3
d65 3
a67 3
    //static PointSetType type() { return &type_; }
    static PointSetType s_type() { return &type_; }
    PointSetType type() const { return &type_; }
@


1.12
log
@new IntPoint index(unsigned) operation for use with "other" iterators.
@
text
@d5 3
d39 1
a39 1
class BoxyIPSIter;
d41 1
a41 1
class BoxyIPS: public BaseIPS {
d52 4
a55 4
    ~BoxyIPS() { }
    BoxyIPS(const IntPoint&, const IntPoint&);
    BoxyIPS(const BoxyIPS&);
    BoxyIPS& operator=(const BoxyIPS&);
d59 1
a59 1
    int operator==(const BoxyIPS&) const;
d80 1
a80 1
	{ return new BoxyIPS(start+ip, end+ip); }
d94 2
a95 2
    BoxyIPS shadow() const {
	return BoxyIPS(cdr(start), cdr(end));
d99 1
a99 1
    friend class BoxyIPSIter;
@


1.11
log
@type() system now based on address of static data member.
contains now accepts const Point<>&.
infimum & supremum virtuals now inf & sup.
@
text
@d5 5
d65 1
d94 1
@


1.10
log
@fixed spelling error
@
text
@d5 3
d34 2
d53 4
a56 1
    PointSetType type() const { return BOXY; }
d58 1
a58 1
    int contains(IntPoint) const;
d63 2
a64 2
    IntPoint infimum() const { return start; }
    IntPoint supremum() const { return end; }
@


1.9
log
@new infemum and supremum methods for point sets.
@
text
@d5 3
d55 1
a55 1
    IntPoint infemum() const { return start; }
@


1.8
log
@hash_self now deals with unsigneds
@
text
@d5 3
d52 2
@


1.7
log
@new offsetted virtual functions
@
text
@d5 3
d39 1
a39 1
    int hash_self(int) const;
@


1.6
log
@CFrontified version
@
text
@d5 2
d8 1
d50 4
@


1.5
log
@*** empty log message ***
@
text
@a4 2
// Revision 1.4  92/08/14  15:46:08  thoth
// Added an index(IntPoint) function to the IntPointSet
a5 11
// Revision 1.3  92/07/26  16:28:11  thoth
// Added some comments so people might be able to understand the code.
// 
// Revision 1.2  92/07/21  11:19:34  thoth
// used IntPoints for the bounds
// added shadow function to make it easy to convert Boxy to Yoder
// 
// Revision 1.1  92/07/16  11:49:56  thoth
// Initial revision
// 
// 
d10 1
d12 1
@


1.4
log
@Added an index(IntPoint) function to the IntPointSet
@
text
@d5 3
d60 1
@


1.3
log
@Added some comments so people might be able to understand the code.
@
text
@d5 3
d24 2
d47 1
d69 2
@


1.2
log
@used IntPoints for the bounds
added shadow function to make it easy to convert Boxy to Yoder
@
text
@d5 4
d23 2
a24 2
    // always: dimen>0
    // start and end are never NULL
d26 1
a26 1
    // start and end are included in the pointset.  The boundaries are a part.
d52 8
@


1.1
log
@Initial revision
@
text
@d4 3
a6 1
// $Log$
d8 1
d23 1
a23 2
    int	*start;
    int	*end;
d26 1
a26 1
    ~BoxyIPS() { delete[] start; delete[] end; }
d39 2
a40 2
    IntPoint min() const { return IntPoint(this->start, this->dimen); }
    IntPoint max() const { return IntPoint(this->end, this->dimen); }
d47 4
@
