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


1.14
date	94.11.29.22.21.44;	author fjsoria;	state Exp;
branches;
next	1.13;

1.13
date	94.11.10.19.53.56;	author ljr;	state Exp;
branches;
next	1.12;

1.12
date	94.11.10.19.27.11;	author fjsoria;	state Exp;
branches;
next	1.11;

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

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

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

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

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

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

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

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

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

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

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


desc
@implementation of Lazy PointSets
@


1.14
log
@problem with /static char rcsid[] commented them out
@
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: LazyPS.c,v 1.13 1994/11/10 19:53:56 ljr Exp fjsoria $";
#endif

// 
// $Log: LazyPS.c,v $
// Revision 1.13  1994/11/10  19:53:56  ljr
// Added IA_NO_RCS_STATIC_DATA guard.
//
// Revision 1.12  1994/11/10  19:27:11  fjsoria
// *** empty log message ***
//
// Revision 1.11  1994/10/06  17:39:00  fjsoria
// commented rscid[] line
//
// Revision 1.10  1994/07/25  16:58:52  thoth
// \Name sanitization
//
// Revision 1.9  1993/11/17  18:05:34  thoth
// PSIter.h is not necessary.
//
// Revision 1.8  1993/06/10  17:15:09  thoth
// typo.
//
// Revision 1.7  93/05/26  16:51:31  thoth
// Copyright Notices
// 
// Revision 1.6  93/04/16  15:50:22  thoth
// use IA_IntPoint instead of IntPoint.
// 
// Revision 1.5  92/12/16  14:48:13  thoth
// conversion to IA_ mostly complete
// 
// Revision 1.4  92/09/30  10:37:13  thoth
// Lazies are now templatized.
// contains now accepts const Point<>&.
// type() system now based on address of static data member.
// 
// Revision 1.3  92/09/20  17:40:57  thoth
// lazy Minkowski point set now works.
// 
// Revision 1.2  92/09/07  13:23:49  thoth
// Lazies now have code to output themselves.
// 
// Revision 1.1  92/09/03  13:37:07  thoth
// Initial revision
// 
//

#include "LazyPS.h"
#include "PSIter.h"

#ifdef IA_PRII
#pragma implementation
#endif

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

template <class P>
void IA_PredicatePS_V<P>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "pred(" << (long) pred << ")\n";
}

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

template <class P>
void IA_PredicatePS_CR<P>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "pred(" << (long) pred << ")C&\n";
}

//
//
//

#ifndef IA_NO_AUTOINST_OF_STATIC_DATA 
template <class PS_t,class P_t>
char IA_LazyUnionPS<PS_t,P_t>::type_;
#endif

template <class PS_t,class P_t>
void IA_LazyUnionPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "union of (\n";
    lhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ") with (\n";
    rhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ")\n";
}

#ifndef IA_NO_AUTOINST_OF_STATIC_DATA 
template <class PS_t,class P_t>
char IA_LazyIntersectionPS<PS_t,P_t>::type_;
#endif

template <class PS_t,class P_t>
void IA_LazyIntersectionPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "intersection of (\n";
    lhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ") and (\n";
    rhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ")\n";
}

#ifndef IA_NO_AUTOINST_OF_STATIC_DATA 
template <class PS_t,class P_t>
char IA_LazyXORPS<PS_t,P_t>::type_;
#endif

template <class PS_t,class P_t>
void IA_LazyXORPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "symmetric difference between (\n";
    lhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ") and (\n";
    rhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ")\n";
}

#ifndef IA_NO_AUTOINST_OF_STATIC_DATA 
template <class PS_t,class P_t>
char IA_LazyMinusPS<PS_t,P_t>::type_;
#endif

template <class PS_t,class P_t>
void IA_LazyMinusPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "difference of (\n";
    lhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ") without (\n";
    rhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ")\n";
}

#ifndef IA_NO_AUTOINST_OF_STATIC_DATA 
template <class PSI_t,class PS_t,class P_t>
char IA_LazyMinkowskiPS<PSI_t,PS_t,P_t>::type_;
#endif

template <class PSI_t,class PS_t,class P_t>
int IA_LazyMinkowskiPS<PSI_t,PS_t,P_t>::contains(const IA_Point<int> &ip) const
{
    PSI_t	iter(ext());
    P_t		op;

    while (iter(op)) {
	if (comp().contains(ip-op))
	    return 1;
    }
    // we didn't find it
    return 0;
}

template <class PSI_t,class PS_t,class P_t>
void IA_LazyMinkowskiPS<PSI_t,PS_t,P_t>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "Minkowski between (\n";
    lhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ") and (\n";
    rhs.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ")\n";
}

//
//
//
#ifndef IA_NO_AUTOINST_OF_STATIC_DATA
template <class PS_t,class P_t>
char IA_LazyNotPS<PS_t,P_t>::type_;
#endif

template <class PS_t,class P_t>
void IA_LazyNotPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "NOT\n";
    arg.output(o,indent+2);
}

#ifndef IA_NO_AUTOINST_OF_STATIC_DATA
template <class PS_t,class P_t>
char IA_LazyOffsettedPS<PS_t,P_t>::type_;
#endif

template <class PS_t,class P_t>
void IA_LazyOffsettedPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
{
    for (unsigned i=0; i<indent; i++)
	o<<' ';
    o << "offset (\n";
    arg.output(o,indent+2);
    for (i=0; i<indent; i++)
	o<<' ';
    o << ") by " << offset << "\n";
}
@


1.13
log
@Added IA_NO_RCS_STATIC_DATA guard.
@
text
@d9 1
a9 1
static char rcsid[] = "$Id: LazyPS.c,v 1.12 1994/11/10 19:27:11 fjsoria Exp ljr $";
d14 3
@


1.12
log
@*** empty log message ***
@
text
@d8 3
a10 1
//static char rcsid[] = "$Id: LazyPS.c,v 1.11 1994/10/06 17:39:00 fjsoria Exp fjsoria $";
d14 3
@


1.11
log
@commented rscid[] line
@
text
@d8 1
a8 1
//static char rcsid[] = "$Id: LazyPS.c,v 1.10 1994/07/25 16:58:52 thoth Exp fjsoria $";
d12 3
d50 1
a50 1
//#include "PSIter.h"
d56 1
d59 1
d66 1
a66 1
    o << "pred(" << pred << ")\n";
d69 1
d72 1
d79 1
a79 1
    o << "pred(" << pred << ")C&\n";
d86 1
d89 1
d107 1
d110 1
d128 1
d131 1
d149 1
d152 1
d170 1
d173 1
d208 1
a208 1

d211 1
d222 1
d225 1
@


1.10
log
@\Name sanitization
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: LazyPS.c,v 1.9 1993/11/17 18:05:34 thoth Exp thoth $";
d12 3
@


1.9
log
@PSIter.h is not necessary.
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: LazyPS.c,v 1.8 1993/06/10 17:15:09 thoth Exp thoth $";
d12 3
d156 1
a156 1
int IA_LazyMinkowskiPS<PSI_t,PS_t,P_t>::contains(const IA_IntPoint &ip) const
@


1.8
log
@typo.
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: LazyPS.c,v 1.7 93/05/26 16:51:31 thoth Exp $";
d11 4
a14 1
// $Log:	LazyPS.c,v $
d41 1
a41 1
#include "IPSIter.h"
@


1.7
log
@Copyright Notices
@
text
@d8 1
a8 1
static char rcsid[] = "$Id: LazyPS.c,v 1.6 93/04/16 15:50:22 thoth Exp Locker: thoth $";
d12 3
d71 1
a71 1
char IA_LazyUnionPS<PS_t,P_t>::type_
@


1.6
log
@use IA_IntPoint instead of IntPoint.
@
text
@a1 1
static char rcsid[] = "$Id: LazyPS.c,v 1.5 92/12/16 14:48:13 thoth Exp Locker: thoth $";
d3 7
d12 3
@


1.5
log
@conversion to IA_ mostly complete
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: LazyPS.c,v 1.4 92/09/30 10:37:13 thoth Exp Locker: thoth $";
d6 3
d138 1
a138 1
int IA_LazyMinkowskiPS<PSI_t,PS_t,P_t>::contains(const IntPoint &ip) const
@


1.4
log
@Lazies are now templatized.
contains now accepts const Point<>&.
type() system now based on address of static data member.
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: LazyPS.c,v 1.3 92/09/20 17:40:57 thoth Exp Locker: thoth $";
d6 5
d30 1
a30 1
char PredicatePS_V<P>::type_;
d33 1
a33 1
void PredicatePS_V<P>::output(ostream &o, unsigned indent) const
d41 1
a41 1
char PredicatePS_CR<P>::type_;
d44 1
a44 1
void PredicatePS_CR<P>::output(ostream &o, unsigned indent) const
d56 1
a56 1
char LazyUnionPS<PS_t,P_t>::type_
d59 1
a59 1
void LazyUnionPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
d75 1
a75 1
char LazyIntersectionPS<PS_t,P_t>::type_;
d78 1
a78 1
void LazyIntersectionPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
d94 1
a94 1
char LazyXORPS<PS_t,P_t>::type_;
d97 1
a97 1
void LazyXORPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
d113 1
a113 1
char LazyMinusPS<PS_t,P_t>::type_;
d116 1
a116 1
void LazyMinusPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
d132 1
a132 1
char LazyMinkowskiPS<PSI_t,PS_t,P_t>::type_;
d135 1
a135 1
int LazyMinkowskiPS<PSI_t,PS_t,P_t>::contains(const IntPoint &ip) const
d149 1
a149 1
void LazyMinkowskiPS<PSI_t,PS_t,P_t>::output(ostream &o, unsigned indent) const
d169 1
a169 1
char LazyNotPS<PS_t,P_t>::type_;
d172 1
a172 1
void LazyNotPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
d181 1
a181 1
char LazyOffsettedPS<PS_t,P_t>::type_;
d184 1
a184 1
void LazyOffsettedPS<PS_t,P_t>::output(ostream &o, unsigned indent) const
@


1.3
log
@lazy Minkowski point set now works.
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: LazyIPS.c,v 1.2 92/09/07 13:23:49 thoth Exp Locker: thoth $";
d5 4
a8 1
// $Log:	LazyIPS.c,v $
d17 1
a17 1
#include "LazyIPS.h"
d24 5
a28 1
void PredicateIPS::output(ostream &o, unsigned indent) const
d35 11
d50 5
a54 1
void LazyUnionIPS::output(ostream &o, unsigned indent) const
d69 5
a73 1
void LazyIntersectionIPS::output(ostream &o, unsigned indent) const
d88 5
a92 1
void LazyXORIPS::output(ostream &o, unsigned indent) const
d107 5
a111 1
void LazyMinusIPS::output(ostream &o, unsigned indent) const
d126 5
a130 1
int LazyMinkowskiIPS::contains(IntPoint ip) const
d132 2
a133 2
    IPSIter	iter(ext());
    IntPoint	op;
d143 2
a144 1
void LazyMinkowskiIPS::output(ostream &o, unsigned indent) const
d163 5
a167 1
void LazyNotIPS::output(ostream &o, unsigned indent) const
d175 5
a179 1
void LazyOffsettedIPS::output(ostream &o, unsigned indent) const
@


1.2
log
@Lazies now have code to output themselves.
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: LazyIPS.C,v 1.1 92/09/03 13:37:07 thoth Exp Locker: thoth $";
d5 4
a8 1
// $Log:	LazyIPS.C,v $
d15 1
d90 13
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
static char rcsid[] = "$Id: IntPointSet.C,v 1.3 92/08/26 13:43:37 thoth Exp Locker: thoth $";
d5 4
a8 1
// $Log$
d17 108
@
