[geos-commits] r2873 - in trunk: capi src/geomgraph src/operation/overlay src/operation/valid tests/unit/algorithm/distance tests/unit/geom tests/unit/linearref tests/unit/operation/valid

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Jan 18 13:15:40 EST 2010


Author: mloskot
Date: 2010-01-18 13:15:40 -0500 (Mon, 18 Jan 2010)
New Revision: 2873

Modified:
   trunk/capi/geos_ts_c.cpp
   trunk/src/geomgraph/Node.cpp
   trunk/src/operation/overlay/ElevationMatrix.cpp
   trunk/src/operation/overlay/ElevationMatrixCell.cpp
   trunk/src/operation/overlay/LineBuilder.cpp
   trunk/src/operation/overlay/OverlayOp.cpp
   trunk/src/operation/valid/IsValidOp.cpp
   trunk/tests/unit/algorithm/distance/DiscreteHausdorffDistanceTest.cpp
   trunk/tests/unit/geom/CoordinateTest.cpp
   trunk/tests/unit/geom/TriangleTest.cpp
   trunk/tests/unit/linearref/LengthIndexedLineTest.cpp
   trunk/tests/unit/operation/valid/IsValidTest.cpp
Log:
Added missing headers platform.h and <cmath> where ISNAN or FINITE macros are expanded

Modified: trunk/capi/geos_ts_c.cpp
===================================================================
--- trunk/capi/geos_ts_c.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/capi/geos_ts_c.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -16,6 +16,7 @@
  *
  ***********************************************************************/
 
+#include <geos/platform.h>  // for FINITE
 #include <geos/geom/Geometry.h> 
 #include <geos/geom/prep/PreparedGeometry.h> 
 #include <geos/geom/prep/PreparedGeometryFactory.h> 
@@ -54,9 +55,9 @@
 #include <geos/util/IllegalArgumentException.h>
 #include <geos/util/Machine.h>
 #include <geos/version.h> 
-#include <geos/platform.h>  // for FINITE
 
 // This should go away
+#include <cmath> // finite
 #include <cstddef>
 #include <cstdio>
 #include <cstdlib>

Modified: trunk/src/geomgraph/Node.cpp
===================================================================
--- trunk/src/geomgraph/Node.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/src/geomgraph/Node.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -18,6 +18,7 @@
  *
  **********************************************************************/
 
+#include <geos/platform.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geomgraph/Node.h>
 #include <geos/geomgraph/Edge.h>
@@ -26,6 +27,7 @@
 #include <geos/geomgraph/DirectedEdge.h>
 #include <geos/geom/Location.h>
 
+#include <cmath>
 #include <string>
 #include <sstream>
 #include <vector>

Modified: trunk/src/operation/overlay/ElevationMatrix.cpp
===================================================================
--- trunk/src/operation/overlay/ElevationMatrix.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/src/operation/overlay/ElevationMatrix.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -17,18 +17,19 @@
  *
  **********************************************************************/
 
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <cassert>
-
+#include <geos/platform.h>
 #include <geos/operation/overlay/ElevationMatrix.h>
-
 #include <geos/util/IllegalArgumentException.h>
 #include <geos/geom/Geometry.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
 
+#include <cassert>
+#include <cmath>
+#include <iostream>
+#include <sstream>
+#include <string>
+
 #ifndef GEOS_DEBUG
 #define GEOS_DEBUG 0
 #endif

Modified: trunk/src/operation/overlay/ElevationMatrixCell.cpp
===================================================================
--- trunk/src/operation/overlay/ElevationMatrixCell.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/src/operation/overlay/ElevationMatrixCell.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -17,14 +17,15 @@
  *
  **********************************************************************/
 
+#include <geos/platform.h>
+#include <geos/geom/Coordinate.h>
+#include <geos/operation/overlay/ElevationMatrixCell.h>
+
 #include <sstream>
 #include <string>
 #include <vector>
+#include <cmath>
 
-#include <geos/operation/overlay/ElevationMatrixCell.h>
-#include <geos/platform.h> // ISNAN
-#include <geos/geom/Coordinate.h>
-
 using namespace std;
 using namespace geos::geom;
 

Modified: trunk/src/operation/overlay/LineBuilder.cpp
===================================================================
--- trunk/src/operation/overlay/LineBuilder.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/src/operation/overlay/LineBuilder.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -18,22 +18,21 @@
  *
  **********************************************************************/
 
-#include <map>
-#include <vector>
-#include <cassert>
-
+#include <geos/platform.h>
 #include <geos/operation/overlay/LineBuilder.h>
 #include <geos/operation/overlay/OverlayOp.h>
-
 #include <geos/algorithm/PointLocator.h>
-
 #include <geos/geom/GeometryFactory.h>
-
 #include <geos/geomgraph/Node.h>
 #include <geos/geomgraph/Edge.h>
 #include <geos/geomgraph/DirectedEdge.h>
 #include <geos/geomgraph/DirectedEdgeStar.h>
 
+#include <map>
+#include <vector>
+#include <cassert>
+#include <cmath>
+
 #ifndef GEOS_DEBUG
 #define GEOS_DEBUG 0
 #endif

Modified: trunk/src/operation/overlay/OverlayOp.cpp
===================================================================
--- trunk/src/operation/overlay/OverlayOp.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/src/operation/overlay/OverlayOp.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -20,6 +20,7 @@
  *
  **********************************************************************/
 
+#include <geos/platform.h>
 #include <geos/operation/overlay/OverlayOp.h>
 #include <geos/operation/overlay/validate/OverlayResultValidator.h>
 #include <geos/operation/overlay/ElevationMatrix.h>
@@ -48,6 +49,7 @@
 #include <geos/geomgraph/EdgeNodingValidator.h>
 
 #include <cassert>
+#include <cmath>
 #include <functional>
 #include <vector>
 #include <sstream>

Modified: trunk/src/operation/valid/IsValidOp.cpp
===================================================================
--- trunk/src/operation/valid/IsValidOp.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/src/operation/valid/IsValidOp.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -18,8 +18,9 @@
  *
  **********************************************************************/
 
-#include "IndexedNestedRingTester.h"
+#include "IndexedNestedRingTester.h" // TODO: private header>? --mloskot
 
+#include <geos/platform.h>
 #include <geos/operation/valid/IsValidOp.h>
 #include <geos/operation/valid/ConsistentAreaTester.h>
 #include <geos/operation/valid/ConnectedInteriorTester.h>
@@ -39,9 +40,10 @@
 #include <geos/geom/MultiPolygon.h>
 #include <geos/geom/GeometryCollection.h>
 
+#include <cassert>
+#include <cmath>
 #include <typeinfo>
 #include <set>
-#include <cassert>
 
 using namespace std;
 using namespace geos::algorithm;

Modified: trunk/tests/unit/algorithm/distance/DiscreteHausdorffDistanceTest.cpp
===================================================================
--- trunk/tests/unit/algorithm/distance/DiscreteHausdorffDistanceTest.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/tests/unit/algorithm/distance/DiscreteHausdorffDistanceTest.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -6,6 +6,7 @@
 
 #include <tut.hpp>
 // geos
+#include <geos/platform.h>
 #include <geos/io/WKTReader.h>
 #include <geos/algorithm/distance/DiscreteHausdorffDistance.h>
 #include <geos/geom/PrecisionModel.h>
@@ -13,6 +14,7 @@
 #include <geos/geom/Geometry.h> // required for use in auto_ptr
 #include <geos/geom/Coordinate.h>
 // std
+#include <cmath>
 #include <sstream>
 #include <string>
 #include <memory>
@@ -53,7 +55,7 @@
 		GeomPtr g2 ( reader.read(wkt2) );
 
 		double distance = DiscreteHausdorffDistance::distance(*g1, *g2);
-		double diff = fabs(distance-expectedDistance);
+		double diff = std::fabs(distance-expectedDistance);
 		//std::cerr << "expectedDistance:" << expectedDistance << " actual distance:" << distance << std::endl;
 		ensure( diff <= TOLERANCE );
 	}
@@ -66,7 +68,7 @@
 
 		double distance = DiscreteHausdorffDistance::distance(*g1,
 			*g2, densifyFactor);
-		double diff = fabs(distance-expectedDistance);
+		double diff = std::fabs(distance-expectedDistance);
 		//std::cerr << "expectedDistance:" << expectedDistance << " actual distance:" << distance << std::endl;
 		ensure( diff <= TOLERANCE );
 	}

Modified: trunk/tests/unit/geom/CoordinateTest.cpp
===================================================================
--- trunk/tests/unit/geom/CoordinateTest.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/tests/unit/geom/CoordinateTest.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -4,7 +4,10 @@
 
 #include <tut.hpp>
 // geos
+#include <geos/platform.h>
 #include <geos/geom/Coordinate.h>
+// std
+#include <cmath>
 
 namespace tut
 {

Modified: trunk/tests/unit/geom/TriangleTest.cpp
===================================================================
--- trunk/tests/unit/geom/TriangleTest.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/tests/unit/geom/TriangleTest.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -5,8 +5,11 @@
 // tut
 #include <tut.hpp>
 // geos
+#include <geos/platform.h>
 #include <geos/geom/Triangle.h>
 #include <geos/geom/Coordinate.h>
+// std
+#include <cmath>
 
 namespace tut
 {
@@ -110,7 +113,7 @@
 		// Expected: ~4.2426406871192857
 		abc.inCentre(center);
 		// 1e-16 fails sometimes
-		ensure( fabs(center.x - 6.0) < 1e-15 );
+		ensure( std::fabs(center.x - 6.0) < 1e-15 );
 		ensure( center.y > 4.2 );
 		ensure( center.y < 4.3 );
 		ensure( 0 != ISNAN( center.z ) );

Modified: trunk/tests/unit/linearref/LengthIndexedLineTest.cpp
===================================================================
--- trunk/tests/unit/linearref/LengthIndexedLineTest.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/tests/unit/linearref/LengthIndexedLineTest.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -6,6 +6,7 @@
 #include <tut.hpp>
 #include <utility.h>
 // geos
+#include <geos/platform.h>
 #include <geos/io/WKTReader.h>
 #include <geos/geom/PrecisionModel.h>
 #include <geos/geom/GeometryFactory.h>
@@ -13,11 +14,9 @@
 #include <geos/geom/LineString.h> 
 #include <geos/geom/Coordinate.h>
 #include <geos/linearref/LengthIndexedLine.h>
-#ifndef ISNAN
-#include <geos/platform.h>
-#endif
 
 // std
+#include <cmath>
 #include <sstream>
 #include <string>
 #include <memory>

Modified: trunk/tests/unit/operation/valid/IsValidTest.cpp
===================================================================
--- trunk/tests/unit/operation/valid/IsValidTest.cpp	2010-01-18 18:14:39 UTC (rev 2872)
+++ trunk/tests/unit/operation/valid/IsValidTest.cpp	2010-01-18 18:15:40 UTC (rev 2873)
@@ -5,6 +5,7 @@
 
 #include <tut.hpp>
 // geos
+#include <geos/platform.h>
 #include <geos/operation/valid/IsValidOp.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateArraySequence.h>
@@ -16,6 +17,7 @@
 #include <geos/operation/valid/TopologyValidationError.h>
 #include <geos/platform.h> // for ISNAN
 // std
+#include <cmath>
 #include <string>
 #include <memory>
 



More information about the geos-commits mailing list