head	1.2;
access;
symbols
	bobbase:1.2
	bob:1.2.1
	r2_1:1.2
	r2_0:1.2
	r1_1_beta:1.2
	r1_1_alpha:1.2
	r1_0:1.2
	r0_11:1.2
	r0_10:1.2
	r0_9:1.1;
locks
	thoth:1.2.1.2
	thoth:1.2; strict;
comment	@// @;


1.2
date	94.01.07.15.12.35;	author thoth;	state Exp;
branches
	1.2.1.1;
next	1.1;

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

1.2.1.1
date	94.12.28.16.56.06;	author thoth;	state Exp;
branches;
next	1.2.1.2;

1.2.1.2
date	95.01.13.19.37.42;	author thoth;	state Exp;
branches;
next	;


desc
@Image iterator handle class implementation
@


1.2
log
@Image class is now CoreImage and named image types are
Image<P,T>.
@
text
@// Emacs: -*- C++ -*-

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

// 
// $Log: ImageIter.c,v $
// Revision 1.1  1993/09/15  12:54:04  thoth
// Initial revision
//

#include "ImageIter.h"

template <class P, class T>
class IA_errorIVIter: public IA_BaseIVIter<P,T> {
  public:
    IA_errorIVIter() 
    :IA_BaseIVIter<P,T>(0) {}

    virtual IA_BaseIVIter<P,T> * clone_self() { 
	ia_throw( IA::IMAGE_REQUIRE_VALUE_ITER, __FILE__, __LINE__);
	return new IA_errorIVIter;
    }

    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() { 
	ia_throw( IA::IMAGE_REQUIRE_VALUE_ITER, __FILE__, __LINE__);
    }

};

//
//
//

template <class P, class T>
IA_IVIter<P,T>::IA_IVIter()
{
    iter = new IA_errorIVIter<P,T>;
}

template <class P, class T>
IA_IVIter<P,T>& IA_IVIter<P,T>::operator=(const IA_CoreImage<P,T> &image)
{
    delete this->iter;

    this->iter = image.bip->value_iterator();

    return *this;
}

template <class P, class T>
IA_IVIter<P,T>& IA_IVIter<P,T>::operator=(const IA_IVIter<P,T> &x)
{
    if (x.iter==this->iter)
	return *this;

    delete this->iter;

    this->iter = x.iter->clone_self();

    return *this;
}

template <class P, class T>
class IA_errorIPIter: public IA_BaseIPIter<P,T> {
  public:
    IA_errorIPIter() 
    :IA_BaseIPIter<P,T>(0) {}

    virtual IA_BaseIPIter<P,T> * clone_self() { 
	ia_throw( IA::IMAGE_REQUIRE_VALUE_ITER, __FILE__, __LINE__);
	return new IA_errorIPIter;
    }

    virtual int next(P&, 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() { 
	ia_throw( IA::IMAGE_REQUIRE_VALUE_ITER, __FILE__, __LINE__);
    }

};

//
//
//

template <class P, class T>
IA_IPIter<P,T>::IA_IPIter()
{
    iter = new IA_errorIPIter<P,T>;
}

template <class P, class T>
IA_IPIter<P,T>& IA_IPIter<P,T>::operator=(const IA_CoreImage<P,T> &image)
{
    delete this->iter;

    this->iter = image.bip->pixel_iterator();

    return *this;
}

template <class P, class T>
IA_IPIter<P,T>& IA_IPIter<P,T>::operator=(const IA_IPIter<P,T> &x)
{
    if (x.iter==this->iter)
	return *this;

    delete this->iter;

    this->iter = x.iter->clone_self();

    return *this;
}
@


1.2.1.1
log
@Conversion to classes for throw.
@
text
@a9 4
// Revision 1.2  1994/01/07  15:12:35  thoth
// Image class is now CoreImage and named image types are
// Image<P,T>.
//
a14 1
#include "image_errors.h"
d23 1
a23 1
	ia_throw(ImageIter_Uninitialized_Exception(__FILE__, __LINE__));
d28 1
a28 1
	ia_throw(ImageIter_Uninitialized_Exception(__FILE__, __LINE__));
d34 1
a34 1
	ia_throw(ImageIter_Uninitialized_Exception(__FILE__, __LINE__));
d79 1
a79 1
	ia_throw(ImageIter_Uninitialized_Exception(__FILE__, __LINE__));
d84 1
a84 1
	ia_throw(ImageIter_Uninitialized_Exception(__FILE__, __LINE__));
d90 1
a90 1
	ia_throw(ImageIter_Uninitialized_Exception(__FILE__, __LINE__));
@


1.2.1.2
log
@CoreImage has been re-merged with Image.  All special stuff should be
friends of FBI now.
@
text
@a9 3
// Revision 1.2.1.1  1994/12/28  16:56:06  thoth
// Conversion to classes for throw.
//
d55 1
a55 1
IA_IVIter<P,T>& IA_IVIter<P,T>::operator=(const IA_Image<P,T> &image)
d111 1
a111 1
IA_IPIter<P,T>& IA_IPIter<P,T>::operator=(const IA_Image<P,T> &image)
@


1.1
log
@Initial revision
@
text
@d9 4
a12 1
// $Log:	DIVIter.c,v $
d50 1
a50 1
IA_IVIter<P,T>& IA_IVIter<P,T>::operator=(const IA_Image<P,T> &image)
d106 1
a106 1
IA_IPIter<P,T>& IA_IPIter<P,T>::operator=(const IA_Image<P,T> &image)
@
