head	1.6;
access;
symbols
	r0_10:1.6
	Eglin_alpha_1:1.6;
locks; strict;
comment	@// @;


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

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

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

1.3
date	93.01.19.14.55.38;	author jnw;	state Exp;
branches;
next	1.2;

1.2
date	92.11.13.13.49.21;	author jnw;	state Exp;
branches;
next	1.1;

1.1
date	92.10.05.11.45.31;	author jnw;	state Exp;
branches;
next	;


desc
@Initial revision
@


1.6
log
@Copyright Notices
@
text
@// Emacs: -*- C++ -*-

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


// $Log:	BaseDIIter.h,v $
// Revision 1.5  93/04/17  18:45:00  thoth
// Iterator support is no longer based on a switch statement.  We now
// use a virtual method.  The user can now provide faster iterators.
// 
// Revision 1.4  93/02/20  12:31:44  thoth
// There are now two sorts of BaseDIIters: value and pixel.  This
// makes the distinction in type between the DIVIter and DIPIter
// much clearer to the compiler and removes the need for some ugly
// code.
// 
// Revision 1.3  93/01/19  14:55:38  jnw
// Modified to support IA_ naming convention
// 
// Revision 1.2  92/11/13  13:49:21  jnw
// initial revision
// 
// Revision 1.1  92/10/05  11:45:31  jnw
// Initial revision
// 

#ifndef BaseDIIter_h_
#define BaseDIIter_h_

#include "IntPoint.h"

template <class T> class IA_BaseDI;

template <class T>
class IA_BaseDIVIter {
protected:

    // This is the image over whose pixels we are iterating.
    IA_BaseDI<T> *domain;

public:

    IA_BaseDIVIter(const IA_BaseDI<T> *x);

    virtual ~IA_BaseDIVIter();

    // this returns a pointer to a copy of the object
    virtual IA_BaseDIVIter * clone_self() =0;

    // If the iterator has reached the end, the next() method will return 0.
    // Otherwise it will set the reference parameter to the
    // (lexicographically) next pixel in the image and return 1.

    virtual int next(T&) { 
	ia_throw( IA::IMAGE_REQUIRE_VALUE_ITER, __FILE__, __LINE__);
	return 0;
    }

    // this method resets the iterator to the beginning of the point set
    virtual void reset() = 0;

    IA_BaseDI<T> *domain_() const { return this->domain; }
};

template <class T>
class IA_BaseDIPIter {
protected:

    // This is the image over whose pixels we are iterating.
    IA_BaseDI<T> *domain;

public:

    IA_BaseDIPIter(const IA_BaseDI<T> *x);

    virtual ~IA_BaseDIPIter() {}

    // this returns a pointer to a copy of the object
    virtual IA_BaseDIPIter * clone_self() =0;

    // If the iterator has reached the end, the next() method will return 0.
    // Otherwise it will set the reference parameter to the
    // (lexicographically) next pixel in the image and return 1.

    virtual int next(IA_IntPoint&, T&) = 0;

    // this method resets the iterator to the beginning of the point set
    virtual void reset() = 0;

    IA_BaseDI<T> *domain_() const{ return this->domain; }
};

#endif
@


1.5
log
@Iterator support is no longer based on a switch statement.  We now
use a virtual method.  The user can now provide faster iterators.
@
text
@d3 6
d10 4
@


1.4
log
@There are now two sorts of BaseDIIters: value and pixel.  This
makes the distinction in type between the DIVIter and DIPIter
much clearer to the compiler and removes the need for some ugly
code.
@
text
@d4 6
a23 2
#include "IntPointSet.h"
#include "DiscreteImage.h"
d25 2
d32 1
a32 1
    IA_DiscreteImage<T> domain;
d36 1
a36 2
    IA_BaseDIVIter(const IA_DiscreteImage<T> &x)
    :domain(x) {}
d38 1
a38 1
    virtual ~IA_BaseDIVIter() {}
d55 1
a55 1
    IA_DiscreteImage<T> domain_() const;
d63 1
a63 1
    IA_DiscreteImage<T> domain;
d67 1
a67 2
    IA_BaseDIPIter(const IA_DiscreteImage<T> &x)
    :domain(x) {}
d83 1
a83 1
    IA_DiscreteImage<T> domain_() const;
@


1.3
log
@Modified to support IA_ naming convention
@
text
@d4 3
d22 1
a22 1
class IA_BaseDIIter {
d30 1
a30 1
    IA_BaseDIIter(const IA_DiscreteImage<T> &x)
d33 1
a33 1
    virtual ~IA_BaseDIIter() {}
d36 1
a36 1
    virtual IA_BaseDIIter * clone_self() =0;
a41 3

    //  !!!!Make these non virtual and return error!!!!

d47 28
a74 4
    virtual int next(IA_IntPoint&, T&) {
	ia_throw( IA::IMAGE_REQUIRE_PIXEL_ITER, __FILE__, __LINE__);
	return 0;
    }
@


1.2
log
@initial revision
@
text
@d4 3
d19 1
a19 1
class BaseDIIter {
d23 1
a23 1
    DiscreteImage<T> domain;
d27 1
a27 1
    BaseDIIter(const DiscreteImage<T> &x)
d30 1
a30 1
    virtual ~BaseDIIter() {}
d33 1
a33 1
    virtual BaseDIIter * clone_self() =0;
d47 1
a47 1
    virtual int next(IntPoint&, T&) {
d55 1
a55 1
    DiscreteImage<T> domain_() const;
@


1.1
log
@Initial revision
@
text
@d3 4
a6 1
// $Log$
d39 4
a42 1
    virtual int next(T&) = 0;
d44 4
a47 1
    virtual int next(T&, IntPoint&) = 0;
@
