Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Blend.h

Go to the documentation of this file.
00001 /** 
00002  * @file Blend.h 
00003  * Definition of the abstract Blend class.
00004  * 
00005  * @author William Nagel (for CS 497).
00006  * @date Fall 2000
00007  */
00008 
00009 #ifndef BLEND_H
00010 #define BLEND_H
00011 
00012 #include "BinaryOp.h"
00013 
00014 /** Blend is an abstract class designed to support a variety of blending
00015  * operation.
00016  *
00017  * The main functionality of blend is the definition of the method h(f,g) which
00018  * is a real function of two real variables f and g which are the values of the
00019  * two implicits to blend.
00020  */
00021 class Blend : public BinaryOp
00022 {
00023   private:
00024     void init(Implicit*,Implicit*);
00025 
00026   public:
00027     double m_r1, m_r2;  // blend radii used only for local blends -jh
00028 
00029     /// Constructors
00030     Blend();
00031     Blend(Implicit*,Implicit*);
00032 
00033     /** The function h merges the value of the two implicits to blend.
00034      * New blends need only implement h and its derivatives.
00035      *
00036      * \parameter f,g The values of the two implicits.
00037      * \return The value of the blend of the two implicits.
00038      */
00039     virtual double h(double f, double g) = 0;
00040     virtual Intervald h(Intervald f, Intervald g) = 0;
00041 
00042     /** dh/df
00043      * Defaults to a numerical approximation.
00044      */
00045     virtual double hf(double f, double g) 
00046       { return (h(f+m_epsilon,g) - h(f,g))/m_epsilon; }
00047     virtual Intervald hf(Intervald f, Intervald g) 
00048       { return (h(f+Intervald(m_epsilon),g) - h(f,g))/Intervald(m_epsilon); }
00049 
00050     /** dh/dg
00051      * Defaults to a numerical approximation.
00052      */
00053     virtual double hg(double f, double g) 
00054       { return (h(f,g+m_epsilon) - h(f,g))/m_epsilon; }
00055     virtual Intervald hg(Intervald f, Intervald g) 
00056       { return (h(f,g+Intervald(m_epsilon)) - h(f,g))/Intervald(m_epsilon); }
00057 
00058     /** d^2h/df^2
00059      * Defaults to a numerical approximation.
00060      */
00061     virtual double hff(double f, double g) 
00062       { return (hf(f+m_epsilon,g) - hf(f,g))/m_epsilon; }
00063     virtual Intervald hff(Intervald f, Intervald g) 
00064       { return (hf(f+Intervald(m_epsilon),g) - hf(f,g))/Intervald(m_epsilon); }
00065 
00066     /** d^2h/dg^2
00067      * Defaults to a numerical approximation.
00068      */
00069     virtual double hgg(double f, double g) 
00070       { return (hf(f,g+m_epsilon) - hf(f,g))/m_epsilon; }
00071     virtual Intervald hgg(Intervald f, Intervald g) 
00072       { return (hf(f,g+Intervald(m_epsilon)) - hf(f,g))/Intervald(m_epsilon); }
00073 
00074     /** d^2h/dfdg
00075      * Defaults to a numerical approximation.
00076      */
00077     virtual double hfg(double f, double g) 
00078       { return (hg(f+m_epsilon,g) - hg(f,g))/m_epsilon; }
00079     virtual Intervald hfg(Intervald f, Intervald g) 
00080       { return (hg(f+Intervald(m_epsilon),g) - hg(f,g))/Intervald(m_epsilon); }
00081 
00082     /** dh/dr1 The derivative of h wrt the first radius.
00083      * Defaults to zero since we have no way of knowing.
00084      */
00085     virtual double hr1(double f, double g) { return 0.0; }
00086     virtual Intervald hr1(Intervald f, Intervald g) { return Intervald(0.0); }
00087 
00088     /** dh/dr2 The derivative of h wrt the second radius.
00089      * Defaults to zero since we have no way of knowing.
00090      */
00091     virtual double hr2(double f, double g) { return 0.0; }
00092     virtual Intervald hr2(Intervald f, Intervald g) { return Intervald(0.0); }
00093 
00094 #ifndef INTERVAL_EVAL_ONLY
00095     virtual double proc(gmVector3 x);
00096     virtual gmVector3 grad(gmVector3 x);
00097     virtual gmMatrix3 hess(gmVector3 x);
00098 #endif
00099 
00100     virtual Intervald proc(Box<double>);
00101     virtual Box3d grad(Box<double>);
00102     virtual IMatrix3d hess(Box<double>);
00103 
00104     virtual void _setq(double* q);
00105     virtual void getq(double* q);
00106     virtual void procq(gmVector3 x, double* q);
00107     virtual void getqname(char** name);
00108     virtual int qlen(void);
00109 };
00110 
00111 #endif 
00112 

Generated on Mon Jun 28 14:58:13 2004 for Advanced Surface Library by doxygen 1.3.4