head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.38; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.54; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.01; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.57; 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

# linintp2.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 LININTP2_H
    00033 #define LININTP2_H
    00034
    00035 template<class T>
    00036 class mgcLinInterp2D
    00037 {
    00038 public:
    00039     mgcLinInterp2D (int _numPoints, double* x, double* y, T* _f);
    00040
    00041     ~mgcLinInterp2D ();
    00042
    00043     double XMin () { return xmin; }
    00044     double XMax () { return xmax; }
    00045     double XRange () { return xmax-xmin; }
    00046     double YMin () { return ymin; }
    00047     double YMax () { return ymax; }
    00048     double YRange () { return ymax-ymin; }
    00049
    00050     int PointCount () { return numPoints; }
    00051     void GetPoint (int i, double& x, double& y);
    00052
    00053     int EdgeCount () { return numEdges; }
    00054     void GetEdge (int i, double& x0, double& y0, double& x1, double& y1);
    00055
    00056     int TriangleCount () { return numTriangles; }
    00057     void GetTriangle (int i, double& x0, double& y0, double& x1, double& y1,
    00058         double& x2, double& y2);
    00059
    00060     int Evaluate (double x, double y, T& F);
    00061
    00062 private:
    00063     typedef struct
    00064     {
    00065         double x, y;
    00066     }
    00067     Vertex;
    00068
    00069     typedef struct
    00070     {
    00071         int vertex[3];  // listed in counterclockwise order
    00072
    00073         int adj[3];
    00074             // adj[0] points to triangle sharing edge (vertex[0],vertex[1])
    00075             // adj[1] points to triangle sharing edge (vertex[1],vertex[2])
    00076             // adj[2] points to triangle sharing edge (vertex[2],vertex[0])
    00077     }
    00078     Triangle;
    00079
    00080     typedef struct
    00081     {
    00082         int vertex[2];
    00083         int triangle[2];
    00084         int index[2];
    00085     }
    00086     Edge;
    00087
    00088     int numPoints;
    00089     double** point;
    00090     double** tmppoint;
    00091     T* f;
    00092
    00093     double xmin, xmax, ymin, ymax;
    00094
    00095
    00096     int numEdges;
    00097     Edge* edge;
    00098
    00099     int numTriangles;
    00100     Triangle* triangle;
    00101
    00102     int Delaunay2D ();
    00103     void ComputeBarycenter (Vertex& v0, Vertex& v1, Vertex& v2, Vertex& ver,
    00104                             double c[3]);
    00105     int InTriangle (Vertex& v0, Vertex& v1, Vertex& v2, Vertex& test);
    00106 };
    00107
    00108 #include "linintp2.inl"
    00109
    00110 #endif

@ 1.3 log @Oops, try again. @ text @d119 1 a119 1