head	1.4;
access;
symbols
	bobbase:1.4
	bob:1.4
	r2_1:1.4
	r2_0:1.4
	r1_1_beta:1.4
	r1_1_alpha:1.3
	r1_0:1.3
	r0_11:1.3
	r0_10:1.3
	r0_9:1.2;
locks; strict;
comment	@// @;


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

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

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

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


desc
@User-supplied function image declaration.
@


1.4
log
@Name sanitization
@
text
@// Emacs: -*- C++ -*-

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


//
// $Log: FunctionI.h,v $
// Revision 1.3  1993/12/29  16:55:02  thoth
// Added FunctionI that accepts functions with simple T type instead of
// const T&
//
// Revision 1.2  1993/11/17  18:19:12  thoth
// extensivep is now extensive.
//
// Revision 1.1  1993/09/15  12:53:05  thoth
// Initial revision
//

#ifndef FunctionRefI_h_
#define FunctionRefI_h_

#include "ia.h"
#include "BaseI.h"

template < class P,class T>
class IA_FunctionRefI: public IA_BaseImage<P,T>{
private:
    T (*func)(const P&);

    static char dummy;
public:
    IA_FunctionRefI(const IA_Set<P>& p, T (*fp)(const P&))
    : IA_BaseImage<P,T>(p){
	this->func = fp;
    }

    int extensive() const { return 0; }

    T operator ()(const P&) const;

    static IA::Type s_type() { return &dummy; }
    IA::Type type() const { return &dummy; }

    //IA_BaseImage<P,T>* clone_self_extensively() const;

#if 0
    IA_BaseImage<IA_Point<int>,T>* restricted_to
    (const IA_Point<int>Set &ips) const;
    IA_BaseImage<P,T>* restricted_to(const IA_Set<IA_Point<double> > &ips) const
#if 1
	;
#else
	{
	    return new IA_FunctionRefI(this->domain() & ips, this->func);
	}
#endif

#endif
    ostream& print_this(ostream&) const;
};

//
//
//

template < class P,class T>
class IA_FunctionI: public IA_BaseImage<P,T>{
private:
    T (*func)(P);

    static char dummy;
public:
    IA_FunctionI(const IA_Set<P>& p, T (*fp)( P))
    : IA_BaseImage<P,T>(p){
	this->func = fp;
    }

    int extensive() const { return 0; }

    T operator ()(const P&) const;

    static IA::Type s_type() { return &dummy; }
    IA::Type type() const { return &dummy; }

    //IA_BaseImage<P,T>* clone_self_extensively() const;

#if 0
    IA_BaseImage<IA_Point<int>,T>* restricted_to
    (const IA_Point<int>Set &ips) const;
    IA_BaseImage<P,T>* restricted_to(const IA_Set<IA_Point<double> > &ips) const
#if 1
	;
#else
	{
	    return new IA_FunctionI(this->domain() & ips, this->func);
	}
#endif

#endif
    ostream& print_this(ostream&) const;
};

#endif
@


1.3
log
@Added FunctionI that accepts functions with simple T type instead of
const T&
@
text
@d10 5
a14 1
// $Log: FuncRefI.h,v $
d44 2
a45 2
    static IA_ImageType s_type() { return &dummy; }
    IA_ImageType type() const { return &dummy; }
d50 3
a52 3
    IA_BaseImage<IA_IntPoint,T>* restricted_to
    (const IA_IntPointSet &ips) const;
    IA_BaseImage<P,T>* restricted_to(const IA_Set<IA_FloatPoint> &ips) const
d85 2
a86 2
    static IA_ImageType s_type() { return &dummy; }
    IA_ImageType type() const { return &dummy; }
d91 3
a93 3
    IA_BaseImage<IA_IntPoint,T>* restricted_to
    (const IA_IntPointSet &ips) const;
    IA_BaseImage<P,T>* restricted_to(const IA_Set<IA_FloatPoint> &ips) const
@


1.2
log
@extensivep is now extensive.
@
text
@d11 3
d54 41
@


1.1
log
@Initial revision
@
text
@d10 4
a13 1
// $Log:	FunctionRefI.h,v $
d33 1
a33 1
    int extensivep() const { return 0; }
@
