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


1.16
date	94.12.08.19.22.19;	author fjsoria;	state Exp;
branches;
next	1.15;

1.15
date	94.12.01.15.54.47;	author fjsoria;	state Exp;
branches;
next	1.14;

1.14
date	94.11.30.19.26.58;	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.18.49.52;	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.08.18.23.39.28;	author thoth;	state Exp;
branches;
next	1.9;

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

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

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

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

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

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

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

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

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


desc
@Set of points whose coordinates are floats.
@


1.16
log
@added more static data replacing static data memeber templates
from PS_Special.c
@
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 copyright[] = "Copyright 1993, Center for Computer Vision and Visualization,\nUniversity of Florida.  All rights reserved.\n";

static char rcsid[] = "$Id: DblPS.c,v 1.15 1994/12/01 15:54:47 fjsoria Exp fjsoria $";
#endif

// 
// $Log: DblPS.c,v $
// Revision 1.15  1994/12/01  15:54:47  fjsoria
// changed gaurd __NO_INLINE_DESTRUCTORS to
// __NO_OUTLINE_DESTRUCTORS
//
// Revision 1.14  1994/11/30  19:26:58  fjsoria
// using hash_managed_delete instead of delete_domain
// so no need for delete_domain
//
// Revision 1.13  1994/11/10  19:53:56  ljr
// Added IA_NO_RCS_STATIC_DATA guard.
//
// Revision 1.12  1994/11/10  18:49:52  fjsoria
// *** empty log message ***
//
// Revision 1.11  1994/10/06  17:39:00  fjsoria
// commented rscid[] line
//
// Revision 1.10  1994/08/18  23:39:28  thoth
// DOS-inspired filename rework
//
// Revision 1.9  1994/07/25  16:58:52  thoth
// \Name sanitization
//
// Revision 1.8  1994/04/26  18:10:49  thoth
// White and Black Hole have been renamed to universal and empty _pset
//
// Revision 1.7  1994/01/31  16:36:00  thoth
// Resurrected the int(*)(Point) constructor.
//
// Revision 1.6  1993/11/17  18:03:31  thoth
// Pointcmp is now pointcmp
//
// Revision 1.5  1993/10/20  15:48:39  thoth
// New naming scheme.  Closures are named Closure.
//
// Revision 1.4  1993/09/15  12:31:12  thoth
// Certain functions are necessary for Continuous images,
// we will implement them later.
//
// Revision 1.3  93/08/08  13:13:09  thoth
// Parametrization of the pointsets on the point type using
// template specialization.
// The extensive FloatPointSet representations seem to work.
// 
// Revision 1.2  93/05/26  16:57:35  thoth
// Copyright Notices
// 
// Revision 1.1  93/05/10  08:33:39  thoth
// Initial revision
// 

#include "DblPS.h"
#include "MondoPS.h"
#include "ClosurePS.h"
#include "LazyPS.h"
#include "ListFPS.h"
#include "BasePSIter.h"

IA_Set<IA_Point<double> > IA_empty_fpset(unsigned dim)
{
    return IA_Set<IA_Point<double> >(IA_BlackHole_<IA_Point<double> >::s_type(), dim);
}

IA_Set<IA_Point<double> > IA_universal_fpset(unsigned dim)
{
    return IA_Set<IA_Point<double> >(IA_WhiteHole_<IA_Point<double> >::s_type(), dim);
}

void IA_Set<IA_Point<double> >::associate(IA_BasePS<IA_Point<double> > *fps)
{
    ps = fps;
    ps->enref();
}

void IA_Set<IA_Point<double> >::disassociate()
{
    hash_managed_delete(ps);
    
    ps = 0;
}


IA_Set<IA_Point<double> >::IA_Set()
{
    associate(new IA_BlackHole_<IA_Point<double> >(0));
}


IA_Set<IA_Point<double> >::IA_Set(const IA_Point<double> &p)
{
    associate(new IA_ListPS<IA_Point<double> >(p));
}

IA_Set<IA_Point<double> >::IA_Set
(unsigned dimen, const IA_Point<double> *afp, unsigned len)
{
    for (int i=0; i<len; i++) {
	if (afp[i].dim() != dimen) {
	    ia_throw(IA::PSET_DIMENSION_MISMATCH, __FILE__, __LINE__);
	    associate(new IA_BlackHole_<IA_Point<double> >(0));
	    return;
	}
    }

    associate(new IA_ListPS<IA_Point<double> >(dimen, afp, len));
}

IA_Set<IA_Point<double> >::IA_Set(IA::Type t, unsigned dim)
{
    if (t==IA_WhiteHole_<IA_Point<double> >::s_type())
	associate(new IA_WhiteHole_<IA_Point<double> >(dim));
    else if (t == IA_BlackHole_<IA_Point<double> >::s_type())
	associate(new IA_BlackHole_<IA_Point<double> >(dim));
    else {
	ia_throw(IA::TYPE_MISMATCH, __FILE__, __LINE__);
	associate(new IA_BlackHole_<IA_Point<double> >(0));
    }
}

IA_Set<IA_Point<double> >::IA_Set(unsigned dimen,
				   int(*f)(const IA_Point<double>&))
{
    associate(new IA_PredicatePS_CR<IA_Point<double> >(dimen, f));
}

IA_Set<IA_Point<double> >::IA_Set(unsigned dimen,
				   int(*f)(IA_Point<double>))
{
    associate(new IA_PredicatePS_V<IA_Point<double> >(dimen, f));
}

IA_Set<IA_Point<double> >::IA_Set(const IA_ClosurePS<IA_Point<double> >&ps)
{
    associate(ps.clone_self());
}

IA_Set<IA_Point<double> >::IA_Set(const IA_Set<IA_Point<double> > &fps)
{
    associate(fps.ps);
}

#ifndef __NO_OUTLINE_DESTRUCTORS

IA_Set<IA_Point<double> >::~IA_Set()
{
    disassociate();
}

#endif

IA_Set<IA_Point<double> > & IA_Set<IA_Point<double> >::operator=(const IA_Set<IA_Point<double> > &fps)
{
    IA_BasePS<IA_Point<double> >	*temp;
    temp = fps.ps;
    temp->enref();
    this->disassociate();
    ps = temp;

    return *this;
}

IA_Set<IA_Point<double> > union_with_structure(const IA_Set<IA_Point<double> >&lhs,const IA_Set<IA_Point<double> >&,IA_SetStructure*) {
  cerr << "union_with_structure(fps,fps,ss), NYI\n";
  exit(1);
  return lhs;
}

IA_Set<IA_Point<int> > operator&(const IA_Set<IA_Point<int> >&lhs,
			      const IA_Set<IA_Point<double> >&){
    cerr << "ips&fps, NYI\n";
    exit(1);
    return lhs;
}

IA_Set<IA_Point<double> > operator+(const IA_Set<IA_Point<double> >&lhs,
			      const IA_Point<double>&){
    cerr << "fps+fp, NYI\n";
    exit(1);
    return lhs;
}


extern "C"
/*static*/ int fpcmp(const void *a, const void *b)
{
  return pointcmp(*(IA_Point<double>*)a,*(IA_Point<double>*)b);
}

void SortDoublePointArray(IA_Point<double> *aip, unsigned len)
{
  // We can use qsort because a swap of the bytes in
  // two DoublePoints does not do any damage.
  qsort((char*)aip, len, sizeof(*aip), fpcmp);
}

#ifdef IA_NO_AUTOINST_OF_STATIC_DATA
char IA_ListPS<IA_Point<double> >:: dummy;
char IA_WhiteHole_<IA_Point<double> >::type_;
char IA_BlackHole_<IA_Point<double> >::type_;

char IA_ClosurePS<IA_Point<double> >::type_;
char IA_PredicatePS_V<IA_Point<double> >::type_;
char IA_PredicatePS_CR<IA_Point<double> >::type_;

#endif

void hash_managed_delete(IA_BasePS<IA_Point<double> > * ps)
{
    if (ps->unref()<=0) {
	delete ps;
    }
}


@


1.15
log
@changed gaurd __NO_INLINE_DESTRUCTORS to
__NO_OUTLINE_DESTRUCTORS
@
text
@d11 1
a11 1
static char rcsid[] = "$Id: DblPS.c,v 1.14 1994/11/30 19:26:58 fjsoria Exp fjsoria $";
d16 4
d215 5
@


1.14
log
@using hash_managed_delete instead of delete_domain
so no need for delete_domain
@
text
@d11 1
a11 1
static char rcsid[] = "$Id: DblPS.c,v 1.13 1994/11/10 19:53:56 ljr Exp thoth $";
d16 4
d153 1
a153 1
#ifndef __NO_INLINE_DESTRUCTORS
a219 1
/* // __NO_INLINE_DESTRUCTORS
a220 5
void delete_domain(IA_BasePSIter<IA_Point<double> > &i)
{
  delete i.domain;
}
*/
@


1.13
log
@Added IA_NO_RCS_STATIC_DATA guard.
@
text
@d11 1
a11 1
static char rcsid[] = "$Id: DblPS.c,v 1.12 1994/11/10 18:49:52 fjsoria Exp ljr $";
d16 3
d84 1
a84 2
    if (ps->unref() <=0)
	delete ps;
d209 6
a214 1
#ifdef __NO_INLINE_DESTRUCTORS
d216 1
d222 1
a222 2
#endif

@


1.12
log
@*** empty log message ***
@
text
@d8 2
a9 1
//static char copyright[] = "Copyright 1993, Center for Computer Vision and Visualization,\nUniversity of Florida.  All rights reserved.\n";
d11 2
a12 1
//static char rcsid[] = "$Id: DblPS.c,v 1.11 1994/10/06 17:39:00 fjsoria Exp fjsoria $";
d16 3
@


1.11
log
@commented rscid[] line
@
text
@d10 1
a10 1
//static char rcsid[] = "$Id: DblPS.c,v 1.10 1994/08/18 23:39:28 thoth Exp fjsoria $";
d14 3
d56 1
a56 1

d201 10
@


1.10
log
@DOS-inspired filename rework
@
text
@d8 1
a8 1
static char copyright[] = "Copyright 1993, Center for Computer Vision and Visualization,\nUniversity of Florida.  All rights reserved.\n";
d10 1
a10 1
static char rcsid[] = "$Id: DblPS.c,v 1.9 1994/07/25 16:58:52 thoth Exp thoth $";
d14 3
d139 2
d146 2
d192 6
@


1.9
log
@\Name sanitization
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: DoublePointSet.c,v 1.8 1994/04/26 18:10:49 thoth Exp thoth $";
d13 4
a16 1
// $Log: DoublePointSet.c,v $
d45 1
a45 1
#include "DoublePointSet.h"
@


1.8
log
@White and Black Hole have been renamed to universal and empty _pset
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: FloatPointSet.c,v 1.7 1994/01/31 16:36:00 thoth Exp thoth $";
d13 4
a16 1
// $Log: FloatPointSet.c,v $
d42 1
a42 1
#include "FloatPointSet.h"
a47 1
typedef IA_ListPS<IA_FloatPoint> IA_ListFPS;
d49 1
a49 1
IA_Set<IA_FloatPoint> IA_empty_fpset(unsigned dim)
d51 1
a51 1
    return IA_Set<IA_FloatPoint>(IA_BlackHole_<IA_FloatPoint>::s_type(), dim);
d54 1
a54 1
IA_Set<IA_FloatPoint> IA_universal_fpset(unsigned dim)
d56 1
a56 1
    return IA_Set<IA_FloatPoint>(IA_WhiteHole_<IA_FloatPoint>::s_type(), dim);
d59 1
a59 1
void IA_Set<IA_FloatPoint>::associate(IA_BasePS<IA_FloatPoint> *fps)
d65 1
a65 1
void IA_Set<IA_FloatPoint>::disassociate()
d74 1
a74 1
IA_Set<IA_FloatPoint>::IA_Set()
d76 1
a76 1
    associate(new IA_BlackHole_<IA_FloatPoint>(0));
d80 1
a80 1
IA_Set<IA_FloatPoint>::IA_Set(const IA_FloatPoint &p)
d82 1
a82 1
    associate(new IA_ListFPS(p));
d85 2
a86 2
IA_Set<IA_FloatPoint>::IA_Set
(unsigned dimen, const IA_FloatPoint *afp, unsigned len)
d91 1
a91 1
	    associate(new IA_BlackHole_<IA_FloatPoint>(0));
d96 1
a96 1
    associate(new IA_ListFPS(dimen, afp, len));
d99 1
a99 1
IA_Set<IA_FloatPoint>::IA_Set(IA_PointSetType t, unsigned dim)
d101 4
a104 4
    if (t==IA_WhiteHole_<IA_FloatPoint>::s_type())
	associate(new IA_WhiteHole_<IA_FloatPoint>(dim));
    else if (t == IA_BlackHole_<IA_FloatPoint>::s_type())
	associate(new IA_BlackHole_<IA_FloatPoint>(dim));
d107 1
a107 1
	associate(new IA_BlackHole_<IA_FloatPoint>(0));
d111 2
a112 2
IA_Set<IA_FloatPoint>::IA_Set(unsigned dimen,
				   int(*f)(const IA_FloatPoint&))
d114 1
a114 1
    associate(new IA_PredicatePS_CR<IA_FloatPoint>(dimen, f));
d117 2
a118 2
IA_Set<IA_FloatPoint>::IA_Set(unsigned dimen,
				   int(*f)(IA_FloatPoint))
d120 1
a120 1
    associate(new IA_PredicatePS_V<IA_FloatPoint>(dimen, f));
d123 1
a123 1
IA_Set<IA_FloatPoint>::IA_Set(const IA_ClosurePS<IA_FloatPoint>&ps)
d128 1
a128 1
IA_Set<IA_FloatPoint>::IA_Set(const IA_Set<IA_FloatPoint> &fps)
d133 1
a133 1
IA_Set<IA_FloatPoint>::~IA_Set()
d138 1
a138 1
IA_Set<IA_FloatPoint> & IA_Set<IA_FloatPoint>::operator=(const IA_Set<IA_FloatPoint> &fps)
d140 1
a140 1
    IA_BasePS<IA_FloatPoint>	*temp;
d155 2
a156 2
IA_Set<IA_IntPoint> operator&(const IA_Set<IA_IntPoint>&lhs,
			      const IA_FloatPointSet&){
d162 2
a163 2
IA_Set<IA_FloatPoint> operator+(const IA_Set<IA_FloatPoint>&lhs,
			      const IA_FloatPoint&){
d173 1
a173 1
  return pointcmp(*(IA_FloatPoint*)a,*(IA_FloatPoint*)b);
d176 1
a176 1
void SortFloatPointArray(IA_FloatPoint *aip, unsigned len)
d179 1
a179 1
  // two FloatPoints does not do any damage.
@


1.7
log
@Resurrected the int(*)(Point) constructor.
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: FloatPointSet.c,v 1.6 1993/11/17 18:03:31 thoth Exp thoth $";
d14 3
d47 1
a47 1
IA_Set<IA_FloatPoint> IA_CBlackHole(unsigned dim)
d52 1
a52 1
IA_Set<IA_FloatPoint> IA_CWhiteHole(unsigned dim)
@


1.6
log
@Pointcmp is now pointcmp
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: FloatPointSet.c,v 1.5 1993/10/20 15:48:39 thoth Exp thoth $";
d14 3
d110 6
@


1.5
log
@New naming scheme.  Closures are named Closure.
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: FloatPointSet.c,v 1.4 1993/09/15 12:31:12 thoth Exp thoth $";
d14 3
d159 1
a159 1
  return Pointcmp(*(IA_FloatPoint*)a,*(IA_FloatPoint*)b);
@


1.4
log
@Certain functions are necessary for Continuous images,
we will implement them later.
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: FloatPointSet.c,v 1.3 93/08/08 13:13:09 thoth Exp Locker: thoth $";
d13 5
a17 1
// $Log:	FloatPointSet.c,v $
d32 1
a32 1
#include "PredicatePS.h"
d106 1
a106 1
IA_Set<IA_FloatPoint>::IA_Set(const IA_PSPred<IA_FloatPoint>&ps)
@


1.3
log
@Parametrization of the pointsets on the point type using
template specialization.
The extensive FloatPointSet representations seem to work.
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: FloatPointSet.c,v 1.2 93/05/26 16:57:35 thoth Exp Locker: thoth $";
d14 5
d126 20
@


1.2
log
@Copyright Notices
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: FloatPointSet.c,v 1.1 93/05/10 08:33:39 thoth Exp Locker: thoth $";
d14 3
d29 1
a29 1
IA_FloatPointSet IA_CBlackHole(unsigned dim)
d31 1
a31 1
    return IA_FloatPointSet(IA_BlackHole_<IA_FloatPoint>::s_type(), dim);
d34 1
a34 1
IA_FloatPointSet IA_CWhiteHole(unsigned dim)
d36 1
a36 1
    return IA_FloatPointSet(IA_WhiteHole_<IA_FloatPoint>::s_type(), dim);
d39 1
a39 1
void IA_FloatPointSet::associate(IA_BasePS<IA_FloatPoint> *fps)
d45 1
a45 1
void IA_FloatPointSet::disassociate()
d54 1
a54 1
IA_FloatPointSet::IA_FloatPointSet()
d59 2
a60 2
#if 1
IA_FloatPointSet::IA_FloatPointSet(const IA_FloatPoint &p)
a63 1
#endif
d65 2
a66 1
IA_FloatPointSet::IA_FloatPointSet(IA_PointSetType t, unsigned dim)
d68 13
d91 1
a91 1
IA_FloatPointSet::IA_FloatPointSet(unsigned dimen,
d97 1
a97 1
IA_FloatPointSet::IA_FloatPointSet(const IA_PSPred<IA_FloatPoint>&ps)
d102 1
a102 1
IA_FloatPointSet::IA_FloatPointSet(const IA_FloatPointSet &fps)
d107 1
a107 1
IA_FloatPointSet::~IA_FloatPointSet()
d112 1
a112 1
IA_FloatPointSet & IA_FloatPointSet::operator=(const IA_FloatPointSet &fps)
d121 14
@


1.1
log
@Initial revision
@
text
@a1 1
static char rcsid[] = "$Id: IntPointSet.c,v 1.20 93/04/19 23:27:40 thoth Exp $";
d3 9
d13 4
a16 1
// $Log:	IntPointSet.c,v $
@
