head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.40; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.58; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.04; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.22.01; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# sphrintp.h

    00001 /*
    00002   WARNING - Do not remove this header.
    00003
    00004   This code is a templated version of the 'magic-software' spherical
    00005   interpolation code by Dave Eberly. The original (un-hacked) code can be
    00006   obtained from here: http://www.magic-software.com/gr_appr.htm
    00007   This code is derived from linintp2.h/cpp and sphrintp.h/cpp.
    00008
    00009   Dave Eberly says that the conditions for use are:
    00010
    00011   * You may distribute the original source code to others at no charge.
    00012
    00013   * You may modify the original source code and distribute it to others at
    00014     no charge. The modified code must be documented to indicate that it is
    00015     not part of the original package.
    00016
    00017   * You may use this code for non-commercial purposes. You may also
    00018     incorporate this code into commercial packages. However, you may not
    00019     sell any of your source code which contains my original and/or modified
    00020     source code. In such a case, you need to factor out my code and freely
    00021     distribute it.
    00022
    00023   * The original code comes with absolutely no warranty and no guarantee is
    00024     made that the code is bug-free.
    00025
    00026   This does not seem incompatible with GPL - so this modified version
    00027   is hereby placed under GPL along with the rest of FlightGear.
    00028
    00029                               Christian Mayer
    00030 */
    00031
    00032 #ifndef SPHRINTP_H
    00033 #define SPHRINTP_H
    00034
    00035 #include "linintp2.h"
    00036 #include <plib/sg.h>
    00037
    00038 template<class T>
    00039 class SphereInterpolate
    00040 {
    00041 public:
    00042     SphereInterpolate (int n, const double* x, const double* y,
    00043         const double* z, const T* f);
    00044     SphereInterpolate (int n, const sgVec2* p, const T* f);
    00045
    00046     ~SphereInterpolate ();
    00047
    00048     void GetSphericalCoords (const double x, const double y, const double z,
    00049         double& thetaAngle, double& phiAngle) const;
    00050
    00051     int Evaluate (const double x, const double y, const double z, T& f) const;
    00052     int Evaluate (const double thetaAngle, const double phiAngle, T& f) const;
    00053
    00054     T Evaluate(const sgVec2& p) const
    00055     {
    00056         T retval;
    00057         Evaluate(p[1], p[0], retval);
    00058         return retval;
    00059     }
    00060
    00061     T Evaluate(const sgVec3& p) const
    00062     {
    00063         T retval;
    00064         Evaluate(p[1], p[0], retval);
    00065         return retval;
    00066     }
    00067
    00068 protected:
    00069     int numPoints;
    00070     double* theta;
    00071     double* phi;
    00072     T* func;
    00073     mgcLinInterp2D<T>* pInterp;
    00074 };
    00075
    00076 #include "sphrintp.inl"
    00077
    00078 #endif

@ 1.3 log @Oops, try again. @ text @d87 1 a87 1