]> git.mxchange.org Git - flightgear.git/blobdiff - src/WeatherCM/linintp2.cpp
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / WeatherCM / linintp2.cpp
index 10f610410ebcda2fca98c38f100197ec1f4585d7..41a43daebf85b1e6d13bc956f85ac0493dbe85dc 100644 (file)
 
 #include <simgear/compiler.h>
 #include STL_IOSTREAM
+#include <simgear/debug/logstream.hxx>
 
 #include <float.h>
 #include <math.h>
 #include <stdlib.h>
 #include "linintp2.h"
 
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
 SG_USING_NAMESPACE(std);
 SG_USING_STD(cout);
-#endif
 
 //---------------------------------------------------------------------------
 mgcLinInterp2D::mgcLinInterp2D (int _numPoints, double* x, double* y, 
@@ -55,7 +54,7 @@ mgcLinInterp2D::mgcLinInterp2D (int _numPoints, double* x, double* y,
         return;
     }
 
-    cout << "[ 20%] allocating memory                                              \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 20%] allocating memory");
 
     point = new double*[numPoints];
     tmppoint = new double*[numPoints+3];
@@ -73,7 +72,7 @@ mgcLinInterp2D::mgcLinInterp2D (int _numPoints, double* x, double* y,
        f[i] = _f[i];
     }
 
-    cout << "[ 30%] creating delaunay diagram                                      \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 30%] creating delaunay diagram");
 
     Delaunay2D();
 }
@@ -292,7 +291,7 @@ int mgcLinInterp2D::Delaunay2D ()
     nts = 1;  // number of triangles
     i4 = 1;
 
-    cout << "[ 40%] create triangulation                                           \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 40%] create triangulation");
 
     // compute triangulation
     for (i0 = 0; i0 < numPoints; i0++)
@@ -385,7 +384,7 @@ Corner3:;
     }
 
     // count the number of triangles
-    cout << "[ 50%] count the number of triangles                                  \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 50%] count the number of triangles");
 
     numTriangles = 0;
     i0 = -1;
@@ -407,7 +406,7 @@ Corner3:;
     }
 
     // create the triangles
-    cout << "[ 60%] create the triangles                                         \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 60%] create the triangles");
 
     triangle = new Triangle[numTriangles];
 
@@ -441,7 +440,7 @@ Corner3:;
     }
 
     // build edge table
-    cout << "[ 70%] build the edge table                                       \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 70%] build the edge table");
 
     numEdges = 0;
     edge = new Edge[3*numTriangles];
@@ -450,7 +449,7 @@ Corner3:;
     for (i = 0; i < numTriangles; i++)
     {
        if ( (i%500) == 0)
-           cout << "[ 7" << 10*i/numTriangles << "%] build the edge table                     \r";
+           SG_LOG(SG_MATH, SG_BULK, "[ 7" << 10*i/numTriangles << "%] build the edge table");
 
         Triangle& t = triangle[i];
 
@@ -483,7 +482,7 @@ Corner3:;
     }
 
     // establish links between adjacent triangles
-    cout << "[ 80%] establishing links between adjacent triangles                   \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 80%] establishing links between adjacent triangles");
 
     for (i = 0; i < numEdges; i++)
     {
@@ -507,7 +506,7 @@ ExitDelaunay:;
     delete[] ccr[0];
     delete[] ccr;
 
-    cout << "[ 90%] finsishes delauney triangulation                            \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 90%] finsishes delauney triangulation");
 
     return result;
 }