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

Algebraic.h

Go to the documentation of this file.
00001 /** \file Algebraic.h An algebraic implicit surface class.
00002  * \author Jeff Decker
00003  * \date Fall 2000.
00004  */
00005 
00006 #ifndef __ALGEBRAIC_H
00007 #define __ALGEBRAIC_H
00008 
00009 #include "Implicit/Implicit.h"
00010 
00011 /** An algebraic implicit surface class.
00012  * This class implements arbitrary polynomials of three variables.
00013  */
00014 
00015 class Algebraic : public Implicit
00016 {
00017   private:
00018     void init(int);
00019 
00020   public:
00021     Algebraic();
00022     Algebraic(int degree);
00023     ~Algebraic();
00024 
00025 #ifndef INTERVAL_EVAL_ONLY    
00026     virtual double proc(gmVector3 x);
00027     virtual gmVector3 grad(gmVector3 v);
00028     virtual gmMatrix3 hess(gmVector3 v);
00029 #endif
00030 
00031     virtual Intervald proc(Box<double>);
00032     virtual Box3d grad(Box<double>);
00033     virtual IMatrix3d hess(Box<double>);
00034 
00035     /// Degree of polynomial.
00036     int degree();
00037     void degree(int);
00038 
00039     /// Number of coefficients.
00040     int getNumCoef();
00041 
00042     static int coefficients(int);
00043 
00044     /// Return the ordinal of the x^i y^j z^k coefficient.
00045     int getCoefIndex(int i, int j, int k);
00046     
00047     double getCoef(int i, int j, int k);
00048     void setCoef(int i, int j, int k, double a);
00049 
00050     virtual void procq(gmVector3, double*);
00051     virtual void procq(Box<double>, Intervald*);
00052     virtual void gradq(Box<double>, Intervald*, Intervald*, Intervald*);
00053 
00054     virtual void getq(double*);
00055     virtual void _setq(double*);
00056     virtual int qlen();
00057     virtual void getqname(char** qn);
00058 
00059     MAKE_NAME();
00060 
00061   private:
00062     /** Array of coefficients.
00063      * Should be accessed through getCoef and setCoef.
00064      */
00065     double *m_a;
00066     
00067     /// Linear interpolate - 4D critical points
00068     Intervald m_alrp(int,Intervald);
00069 
00070   protected:
00071     /// Degree.
00072     int m_d;
00073 
00074     /** Number of terms.
00075      * Initialized by calcNumCoef.
00076      * Accessed via getNumCoef.
00077      */
00078     int m_numCoef;
00079 
00080     /// Array storing the exponents of x in coefficient order.
00081     int *m_x;
00082 
00083     /// Array storing the exponents of y in coefficient order.
00084     int *m_y;
00085 
00086     /// Array storing the exponents of z in coefficient order.
00087     int *m_z;
00088 
00089     /// Cached array of powers of input value of x in coefficient order.
00090     double *m_xPow;
00091 
00092     /// Cached array of powers of input value of y in coefficient order.
00093     double *m_yPow;
00094 
00095     /// Cached array of powers of input value of z in coefficient order.
00096     double *m_zPow;
00097 
00098     void initPowerArrays();
00099     void initXYZPowerArrays(gmVector3 v);
00100     void initDerivCoefs(void);
00101     void calcNumCoef();
00102 
00103     double dx(gmVector3 v);
00104     double dy(gmVector3 v);
00105     double dz(gmVector3 v);
00106 
00107     double dx2(gmVector3 v); 
00108     double dy2(gmVector3 v);
00109     double dz2(gmVector3 v);
00110 
00111     double dxdy(gmVector3 v);
00112     double dxdz(gmVector3 v);
00113     double dydz(gmVector3 v);
00114 };
00115 
00116 #endif
00117 

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