[geos-commits] r4098 - in trunk/src: algorithm algorithm/locate geom io noding/snapround operation/buffer operation/overlay/snap operation/overlay/validate

svn_geos at osgeo.org svn_geos at osgeo.org
Sat Oct 3 14:37:16 PDT 2015


Author: mloskot
Date: 2015-10-03 14:37:16 -0700 (Sat, 03 Oct 2015)
New Revision: 4098

Modified:
   trunk/src/algorithm/CGAlgorithms.cpp
   trunk/src/algorithm/LineIntersector.cpp
   trunk/src/algorithm/locate/IndexedPointInAreaLocator.cpp
   trunk/src/geom/LineSegment.cpp
   trunk/src/io/WKTWriter.cpp
   trunk/src/noding/snapround/HotPixel.cpp
   trunk/src/operation/buffer/BufferBuilder.cpp
   trunk/src/operation/buffer/BufferOp.cpp
   trunk/src/operation/overlay/snap/GeometrySnapper.cpp
   trunk/src/operation/overlay/validate/OverlayResultValidator.cpp
Log:
Clean up Windows-specific extra parenthesis around std::min/std::max which worked around min/max macros causing syntax error. The workaround is no loner necessary since NOMINMAX placement has been corrected.

Modified: trunk/src/algorithm/CGAlgorithms.cpp
===================================================================
--- trunk/src/algorithm/CGAlgorithms.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/algorithm/CGAlgorithms.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -277,17 +277,17 @@
 	double s_top=(A.y-C.y)*(B.x-A.x)-(A.x-C.x)*(B.y-A.y);
 	double s_bot=(B.x-A.x)*(D.y-C.y)-(B.y-A.y)*(D.x-C.x);
 	if ((r_bot==0)||(s_bot==0)) {
-		return (std::min)(distancePointLine(A,C,D),
-						(std::min)(distancePointLine(B,C,D),
-						(std::min)(distancePointLine(C,A,B), distancePointLine(D,A,B))));
+		return std::min(distancePointLine(A,C,D),
+						std::min(distancePointLine(B,C,D),
+						std::min(distancePointLine(C,A,B), distancePointLine(D,A,B))));
 	}
 	double s=s_top/s_bot;
 	double r=r_top/r_bot;
 	if ((r<0)||( r>1)||(s<0)||(s>1)) {
 		//no intersection
-		return (std::min)(distancePointLine(A,C,D),
-						(std::min)(distancePointLine(B,C,D),
-						(std::min)(distancePointLine(C,A,B), distancePointLine(D,A,B))));
+		return std::min(distancePointLine(A,C,D),
+						std::min(distancePointLine(B,C,D),
+						std::min(distancePointLine(C,A,B), distancePointLine(D,A,B))));
 	}
 	return 0.0; //intersection exists
 }

Modified: trunk/src/algorithm/LineIntersector.cpp
===================================================================
--- trunk/src/algorithm/LineIntersector.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/algorithm/LineIntersector.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -127,7 +127,7 @@
 		// <FIX>
 		// hack to ensure that non-endpoints always have a non-zero distance
 		if (dist == 0.0 && !(p==p0)) {
-			dist=(std::max)(pdx,pdy);
+			dist=std::max(pdx,pdy);
 		}
 	}
 	assert(!(dist == 0.0 && !(p==p0))); // Bad distance calculation

Modified: trunk/src/algorithm/locate/IndexedPointInAreaLocator.cpp
===================================================================
--- trunk/src/algorithm/locate/IndexedPointInAreaLocator.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/algorithm/locate/IndexedPointInAreaLocator.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -74,8 +74,8 @@
 	for ( size_t i = 1, ni = pts->size(); i < ni; i++ ) 
 	{
 		geom::LineSegment * seg = new geom::LineSegment( (*pts)[ i - 1 ], (*pts)[ i ]);
-		double const min = (std::min)( seg->p0.y, seg->p1.y);
-		double const max = (std::max)( seg->p0.y, seg->p1.y);
+		double const min = std::min( seg->p0.y, seg->p1.y);
+		double const max = std::max( seg->p0.y, seg->p1.y);
 		
 		// NOTE: seg ownership still ours
 		allocatedSegments.push_back(seg);

Modified: trunk/src/geom/LineSegment.cpp
===================================================================
--- trunk/src/geom/LineSegment.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/geom/LineSegment.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -169,10 +169,10 @@
 	int orient1 = algorithm::CGAlgorithms::orientationIndex(p0, p1, seg.p1);
 	// this handles the case where the points are L or collinear
 	if (orient0 >= 0 && orient1 >= 0)
-		return (std::max)(orient0, orient1);
+		return std::max(orient0, orient1);
 	// this handles the case where the points are R or collinear
 	if (orient0 <= 0 && orient1 <= 0)
-        return (std::max)(orient0, orient1);
+        return std::max(orient0, orient1);
 	// points lie on opposite sides ==> indeterminate orientation
 	return 0;
 }

Modified: trunk/src/io/WKTWriter.cpp
===================================================================
--- trunk/src/io/WKTWriter.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/io/WKTWriter.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -181,7 +181,7 @@
 WKTWriter::appendGeometryTaggedText(const Geometry *geometry, int level,
 		Writer *writer)
 {
-  outputDimension = (std::min)( defaultOutputDimension,
+  outputDimension = std::min( defaultOutputDimension,
                          geometry->getCoordinateDimension() );
 
   indent(level, writer);

Modified: trunk/src/noding/snapround/HotPixel.cpp
===================================================================
--- trunk/src/noding/snapround/HotPixel.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/noding/snapround/HotPixel.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -104,10 +104,10 @@
 		const Coordinate& p1) const
 {
 
-	double const segMinx = (std::min)(p0.x, p1.x);
-	double const segMaxx = (std::max)(p0.x, p1.x);
-	double const segMiny = (std::min)(p0.y, p1.y);
-	double const segMaxy = (std::max)(p0.y, p1.y);
+	double const segMinx = std::min(p0.x, p1.x);
+	double const segMaxx = std::max(p0.x, p1.x);
+	double const segMiny = std::min(p0.y, p1.y);
+	double const segMaxy = std::max(p0.y, p1.y);
 
 	bool isOutsidePixelEnv =  maxx < segMinx
                          || minx > segMaxx

Modified: trunk/src/operation/buffer/BufferBuilder.cpp
===================================================================
--- trunk/src/operation/buffer/BufferBuilder.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/operation/buffer/BufferBuilder.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -266,7 +266,7 @@
          // Let the length of the line play a factor in the distance, which is still 
          // going to be bounded by 98%. Take 10% of the length of the line  from the buffer distance
          // to try and minimize any artifacts.
-         const double ptDistAllowance = (std::max)(distance - l->getLength()*0.1, distance * 0.98);
+         const double ptDistAllowance = std::max(distance - l->getLength()*0.1, distance * 0.98);
          // Use 102% of the buffer width as the line-length requirement - this
          // is to ensure that line segments that is length "distance" +/-
          // epsilon is removed.

Modified: trunk/src/operation/buffer/BufferOp.cpp
===================================================================
--- trunk/src/operation/buffer/BufferOp.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/operation/buffer/BufferOp.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -66,7 +66,7 @@
 	double distance, int maxPrecisionDigits)
 {
 	const Envelope *env=g->getEnvelopeInternal();
-	double envSize=(std::max)(env->getHeight(), env->getWidth());
+	double envSize=std::max(env->getHeight(), env->getWidth());
 	double expandByDistance=distance > 0.0 ? distance : 0.0;
 	double bufEnvSize=envSize + 2 * expandByDistance;
 	// the smallest power of 10 greater than the buffer envelope

Modified: trunk/src/operation/overlay/snap/GeometrySnapper.cpp
===================================================================
--- trunk/src/operation/overlay/snap/GeometrySnapper.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/operation/overlay/snap/GeometrySnapper.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -148,7 +148,7 @@
 GeometrySnapper::computeSizeBasedSnapTolerance(const geom::Geometry& g)
 {
 	const Envelope* env = g.getEnvelopeInternal();
-	double minDimension = (std::min)(env->getHeight(), env->getWidth());
+	double minDimension = std::min(env->getHeight(), env->getWidth());
 	double snapTol = minDimension * snapPrecisionFactor;
 	return snapTol;
 }
@@ -184,7 +184,7 @@
 GeometrySnapper::computeOverlaySnapTolerance(const geom::Geometry& g1,
 		const geom::Geometry& g2)
 {
-        return (std::min)(computeOverlaySnapTolerance(g1), computeOverlaySnapTolerance(g2));
+        return std::min(computeOverlaySnapTolerance(g1), computeOverlaySnapTolerance(g2));
 }
 
 /* public static */

Modified: trunk/src/operation/overlay/validate/OverlayResultValidator.cpp
===================================================================
--- trunk/src/operation/overlay/validate/OverlayResultValidator.cpp	2015-10-03 21:21:11 UTC (rev 4097)
+++ trunk/src/operation/overlay/validate/OverlayResultValidator.cpp	2015-10-03 21:37:16 UTC (rev 4098)
@@ -238,7 +238,7 @@
 {
     using geos::operation::overlay::snap::GeometrySnapper;
 
-    return (std::min)(GeometrySnapper::computeSizeBasedSnapTolerance(g0),
+    return std::min(GeometrySnapper::computeSizeBasedSnapTolerance(g0),
                       GeometrySnapper::computeSizeBasedSnapTolerance(g1));
 }
 



More information about the geos-commits mailing list