]> git.mxchange.org Git - flightgear.git/blobdiff - src/WeatherCM/sphrintp.cpp
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / WeatherCM / sphrintp.cpp
index 9740a8b7b72c4f6720235678f7de863759d0085f..52b43db86ae58242388ea556e5ad8b2174909da9 100644 (file)
 
 #include <simgear/compiler.h>
 #include STL_IOSTREAM
+#include <simgear/debug/logstream.hxx>
 
 #include <math.h>
 #include "sphrintp.h"
 
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
 SG_USING_NAMESPACE(std);
 SG_USING_STD(cout);
-#endif
 
 
 static const double PI = 4.0*atan(1.0);
@@ -53,8 +52,8 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
     // For complete spherical coverage, include the two antipodal points
     // (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set.
     
-    cout << "Initialising spherical interpolator.\n";
-    cout << "[  0%] Allocating memory                                           \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "Initialising spherical interpolator.");
+    SG_LOG(SG_MATH, SG_DEBUG, "[  0%] Allocating memory");
 
     theta = new double[3*n];
     phi = new double[3*n];
@@ -70,7 +69,7 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
     }
     
     // use periodicity to get wrap-around in the Delaunay triangulation
-    cout << "[ 10%] copying vertices for wrap-around\r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 10%] copying vertices for wrap-aroundr");
     int j, k;
     for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++)
     {
@@ -84,7 +83,7 @@ SphereInterpolate::SphereInterpolate (int n, const double* x,
     
     pInterp = new mgcLinInterp2D(3*n,theta,phi,func);
 
-    cout << "[100%] Finished initialising spherical interpolator.                   \n";
+    SG_LOG(SG_MATH, SG_DEBUG, "[100%] Finished initialising spherical interpolator.");
 }
 
 SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int* f)
@@ -92,15 +91,15 @@ SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int
     // Assumes (x[i],y[i],z[i]) is unit length for all 0 <= i < n.
     // For complete spherical coverage, include the two antipodal points
     // (0,0,1,f(0,0,1)) and (0,0,-1,f(0,0,-1)) in the data set.
-    cout << "Initialising spherical interpolator.\n";
-    cout << "[  0%] Allocating memory                                           \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "Initialising spherical interpolator.");
+    SG_LOG(SG_MATH, SG_DEBUG, "[  0%] Allocating memory");
 
     theta = new double[3*n];
     phi = new double[3*n];
     func = new unsigned int[3*n];
 
     // convert data to spherical coordinates
-    cout << "[ 10%] copying vertices for wrap-around                              \r";
+    SG_LOG(SG_MATH, SG_DEBUG, "[ 10%] copying vertices for wrap-around");
 
     int i, j, k;
     for (i = 0, j = n, k = 2*n; i < n; i++, j++, k++)
@@ -120,7 +119,7 @@ SphereInterpolate::SphereInterpolate (int n, const sgVec2* p, const unsigned int
     
     pInterp = new mgcLinInterp2D(3*n,theta,phi,func);
 
-    cout << "[100%] Finished initialising spherical interpolator.                   \n";
+    SG_LOG(SG_MATH, SG_DEBUG, "[100%] Finished initialising spherical interpolator.");
 }
 //---------------------------------------------------------------------------
 SphereInterpolate::~SphereInterpolate ()