head	1.12;
access;
symbols
	bobbase:1.10
	bob:1.10
	r2_1:1.6
	r2_0:1.6
	r1_1_beta:1.5
	r1_1_alpha:1.4
	r1_0:1.4
	r0_11:1.4
	r0_10:1.3
	r0_9:1.3
	Eglin_alpha_1:1.2;
locks
	thoth:1.12; strict;
comment	@// @;


1.12
date	94.11.10.18.41.33;	author ljr;	state Exp;
branches;
next	1.11;

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

1.10
date	94.10.04.05.49.46;	author gmt;	state Exp;
branches;
next	1.9;

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

1.8
date	94.09.27.20.49.07;	author fjsoria;	state Exp;
branches;
next	1.7;

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

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

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

1.4
date	94.03.03.22.55.50;	author jnw;	state Exp;
branches;
next	1.3;

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

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

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


desc
@Special ValueSet<int> constructor.
ValueComparator for FloatPoint.
@


1.12
log
@Added IA_NO_RCS_STATIC_DATA guard.
@
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: VS_Specials.c,v 1.11 1994/11/10 18:37:25 fjsoria Exp ljr $";
#endif

//
// $Log: VS_Specials.c,v $
// Revision 1.11  1994/11/10  18:37:25  fjsoria
// *** empty log message ***
//
// Revision 1.10  1994/10/04  05:49:46  gmt
// Added a hack to deal with screwed up system headers for the inclusion
// of complex.h for the Mac using SC++ 7.
//
// Revision 1.9  1994/10/03  17:52:58  thoth
// Added predicate sets.
//
// Revision 1.8  1994/09/27  20:49:07  fjsoria
// *** empty log message ***
//
// Revision 1.7  1994/09/20  17:28:38  thoth
// Handle some difficulties with G++ instantiation of static data members.
//
// Revision 1.6  1994/08/22  15:10:59  thoth
// DOS-inspired name rework
//
// Revision 1.5  1994/07/25  16:45:35  thoth
// Name sanitization.
//
// Revision 1.4  1994/03/03  22:55:50  jnw
// Added comparator for Valueset<IA_RGB>
//
// Revision 1.3  1993/11/17  17:55:48  thoth
// Pointcmp is now pointcmp.
// Added value comparator for ValueSet<complex>
//
// Revision 1.2  1993/05/26  16:31:58  thoth
// Copyright Notices
//
// Revision 1.1  93/05/26  13:49:40  thoth
// Initial revision
// 

#include "compat.h"

#ifdef __SC__
#pragma template_access public
#endif

// Hack for the Mac since the system math headers are screwed up.
#ifdef __SC__
#define _USE_APPLE_LIBRARIES_ 1
#endif

#include <complex.h>

#ifdef __SC__
#undef _USE_APPLE_LIBRARIES_ 
#define _USE_APPLE_LIBRARIES_ 0
#endif

#include "Bit.h"
#include "RGB.h"

#include "DblPoint.h"

#include "Set.h"
#include "ValueSet.h"
#include "LazySet.h"


IA_ValueSet<int> value_range(int v0, int v1) {
    IA_ValueSet<int> vs;
    int sz = v1 - v0;
    
    if (sz < 0)
	return IA_ValueSet<int>();
    if (sz == 0)
	return IA_ValueSet<int>(v0);
    int *ret_array = new int[++sz];
    for (int i = 0; i < sz; i++)
	ret_array[i] = v0+i;
    return IA_ValueSet<int>(ret_array, sz);
}

int IA_ValueSetComparator<IA_Point<double> >::value_type_compare(
    const void *t1, const void *t2) {

  return pointcmp(*(IA_Point<double> *)t1, *(IA_Point<double> *)t2);
}

int IA_ValueSetComparator<complex>::value_type_compare(
    const void *t1, const void *t2) {
    complex	*a = (complex*)t1;
    complex	*b = (complex*)t2;

    float	ap = real(*a);
    float	bp = real(*b);

    if (ap>bp)
	return 1;
    else if (ap<bp)
	return -1;

    ap = imag(*a);
    bp = imag(*b);

    if (ap>bp)
	return 1;
    else if (ap<bp)
	return -1;
    else
	return 0;
}

int IA_ValueSetComparator<IA_RGB>::value_type_compare(
    const void *t1, const void *t2) {
    IA_RGB	*a = (IA_RGB *)t1;
    IA_RGB	*b = (IA_RGB *)t2;

    if (a->red() > b->red())
	return 1;
    else if (a->red() < b->red())
	return -1;

    if (a->green() > b->green())
	return 1;
    else if (a->green() < b->green())
	return -1;

    if (a->blue() > b->blue())
	return 1;
    else if (a->blue() < b->blue())
	return -1;
    else
	return 0;
}

#ifdef IA_NO_AUTOINST_OF_STATIC_DATA
char IA_ValueSet<IA_Point<double> >::dummy;
#define urgh(T) \
char IA_ValueSet<T>::dummy; \
char IA_PredicateSet_V<T>::type_; \
char IA_PredicateSet_CR<T>::type_; \
char IA_LazyUnionSet<T>::type_; \
char IA_LazyIntersectionSet<T>::type_; \
char IA_LazyXORSet<T>::type_; \
char IA_LazyMinusSet<T>::type_; \
char IA_LazyNotSet<T>::type_; \
/* yucky, eh? */

urgh(IA_Bit)
urgh(u_char)
urgh(int)
urgh(float)
urgh(complex)
urgh(IA_RGB)

#endif // IA_NO_AUTOINST_OF_STATIC_DATA
@


1.11
log
@*** empty log message ***
@
text
@d8 1
d11 2
a12 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.10 1994/10/04 05:49:46 gmt Exp fjsoria $";
d16 3
@


1.10
log
@Added a hack to deal with screwed up system headers for the inclusion
of complex.h for the Mac using SC++ 7.
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.9 1994/10/03 17:52:58 thoth Exp gmt $";
d14 4
d143 1
a143 1

@


1.9
log
@Added predicate sets.
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.8 1994/09/27 20:49:07 fjsoria Exp thoth $";
d14 3
d43 11
d55 6
@


1.8
log
@*** empty log message ***
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.7 1994/09/20 17:28:38 thoth Exp fjsoria $";
d14 3
d48 1
a48 1
//#include "LazySet.h" used by thoth 
d122 7
a128 7
//char IA_PredicateSet_V<T>::type_; \
//char IA_PredicateSet_CR<T>::type_; \
//char IA_LazyUnionSet<T>::type_; \
//char IA_LazyIntersectionSet<T>::type_; \
//char IA_LazyXORSet<T>::type_; \
//char IA_LazyMinusSet<T>::type_; \
//char IA_LazyNotSet<T>::type_; \
@


1.7
log
@Handle some difficulties with G++ instantiation of static data members.
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.6 1994/08/22 15:10:59 thoth Exp thoth $";
d14 3
d45 2
a46 1
#include "LazySet.h"
d119 7
a125 7
char IA_PredicateSet_V<T>::type_; \
char IA_PredicateSet_CR<T>::type_; \
char IA_LazyUnionSet<T>::type_; \
char IA_LazyIntersectionSet<T>::type_; \
char IA_LazyXORSet<T>::type_; \
char IA_LazyMinusSet<T>::type_; \
char IA_LazyNotSet<T>::type_; \
@


1.6
log
@DOS-inspired name rework
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.5 1994/07/25 16:45:35 thoth Exp thoth $";
d14 3
d35 1
d37 4
d42 1
a42 1
#include "DblPoint.h"
d110 22
@


1.5
log
@Name sanitization.
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.4 1994/03/03 22:55:50 jnw Exp thoth $";
d14 3
d34 1
a34 1
#include "DoublePoint.h"
@


1.4
log
@Added comparator for Valueset<IA_RGB>
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.3 1993/11/17 17:55:48 thoth Exp jnw $";
d14 3
d31 1
a31 1
#include "FloatPoint.h"
d47 1
a47 1
int IA_ValueSetComparator<IA_FloatPoint>::value_type_compare(
d50 1
a50 1
  return pointcmp(*(IA_FloatPoint *)t1, *(IA_FloatPoint *)t2);
@


1.3
log
@Pointcmp is now pointcmp.
Added value comparator for ValueSet<complex>
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.2 1993/05/26 16:31:58 thoth Exp thoth $";
d14 4
d26 1
d69 23
@


1.2
log
@Copyright Notices
@
text
@d10 1
a10 1
static char rcsid[] = "$Id: VS_Specials.c,v 1.1 93/05/26 13:49:40 thoth Exp Locker: thoth $";
d13 4
a16 1
// $Log:	VS_Specials.c,v $
d21 1
d42 25
a66 1
  return Pointcmp(*(IA_FloatPoint *)t1, *(IA_FloatPoint *)t2);
@


1.1
log
@Initial revision
@
text
@d3 4
a6 1
static char rcsid[] = "$Id$";
d8 4
d13 4
a16 1
// $Log$
@
