[geos-commits] r2158 - trunk/source/geom/prep
svn_geos at osgeo.org
svn_geos at osgeo.org
Mon Aug 18 12:24:18 EDT 2008
Author: mloskot
Date: 2008-08-18 12:24:18 -0400 (Mon, 18 Aug 2008)
New Revision: 2158
Modified:
trunk/source/geom/prep/AbstractPreparedPolygonContains.cpp
trunk/source/geom/prep/BasicPreparedGeometry.cpp
trunk/source/geom/prep/PreparedGeometry.cpp
trunk/source/geom/prep/PreparedGeometryFactory.cpp
trunk/source/geom/prep/PreparedLineString.cpp
trunk/source/geom/prep/PreparedLineStringIntersects.cpp
trunk/source/geom/prep/PreparedPoint.cpp
trunk/source/geom/prep/PreparedPolygon.cpp
trunk/source/geom/prep/PreparedPolygonContains.cpp
trunk/source/geom/prep/PreparedPolygonContainsProperly.cpp
trunk/source/geom/prep/PreparedPolygonCovers.cpp
trunk/source/geom/prep/PreparedPolygonIntersects.cpp
trunk/source/geom/prep/PreparedPolygonPredicate.cpp
Log:
geom/prep: Refactored kamikaze casts to more readable form. Fixed svn:keywords.
Modified: trunk/source/geom/prep/AbstractPreparedPolygonContains.cpp
===================================================================
--- trunk/source/geom/prep/AbstractPreparedPolygonContains.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/AbstractPreparedPolygonContains.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/BasicPreparedGeometry.cpp
===================================================================
--- trunk/source/geom/prep/BasicPreparedGeometry.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/BasicPreparedGeometry.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedGeometry.cpp
===================================================================
--- trunk/source/geom/prep/PreparedGeometry.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedGeometry.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedGeometryFactory.cpp
===================================================================
--- trunk/source/geom/prep/PreparedGeometryFactory.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedGeometryFactory.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedLineString.cpp
===================================================================
--- trunk/source/geom/prep/PreparedLineString.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedLineString.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
@@ -46,9 +46,14 @@
bool
PreparedLineString::intersects(const geom::Geometry * g) const
{
- if (! envelopesIntersect(g)) return false;
-
- return PreparedLineStringIntersects::intersects( *(const_cast<PreparedLineString*>(this)), g);
+ if (! envelopesIntersect(g))
+ {
+ return false;
+ }
+
+ PreparedLineString& prep = *(const_cast<PreparedLineString*>(this));
+
+ return PreparedLineStringIntersects::intersects(prep, g);
}
} // namespace geos.geom.prep
@@ -59,3 +64,4 @@
* $Log$
*
**********************************************************************/
+
Modified: trunk/source/geom/prep/PreparedLineStringIntersects.cpp
===================================================================
--- trunk/source/geom/prep/PreparedLineStringIntersects.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedLineStringIntersects.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedPoint.cpp
===================================================================
--- trunk/source/geom/prep/PreparedPoint.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedPoint.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedPolygon.cpp
===================================================================
--- trunk/source/geom/prep/PreparedPolygon.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedPolygon.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
@@ -91,7 +91,12 @@
// optimization for rectangles
if ( isRectangle )
- return operation::predicate::RectangleContains::contains( *((geom::Polygon *)&getGeometry()), *g);
+ {
+ geom::Geometry const& geom = getGeometry();
+ geom::Polygon const& poly = static_cast<geom::Polygon const&>(geom);
+
+ return operation::predicate::RectangleContains::contains(poly, *g);
+ }
return PreparedPolygonContains::contains( this, g);
}
@@ -132,7 +137,12 @@
// optimization for rectangles
if ( isRectangle )
- return operation::predicate::RectangleIntersects::intersects( *((geom::Polygon *)&getGeometry()), *g);
+ {
+ geom::Geometry const& geom = getGeometry();
+ geom::Polygon const& poly = static_cast<geom::Polygon const&>(geom);
+
+ return operation::predicate::RectangleIntersects::intersects(poly, *g);
+ }
return PreparedPolygonIntersects::intersects( this, g);
}
@@ -145,3 +155,4 @@
* $Log$
*
**********************************************************************/
+
Modified: trunk/source/geom/prep/PreparedPolygonContains.cpp
===================================================================
--- trunk/source/geom/prep/PreparedPolygonContains.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedPolygonContains.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedPolygonContainsProperly.cpp
===================================================================
--- trunk/source/geom/prep/PreparedPolygonContainsProperly.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedPolygonContainsProperly.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedPolygonCovers.cpp
===================================================================
--- trunk/source/geom/prep/PreparedPolygonCovers.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedPolygonCovers.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedPolygonIntersects.cpp
===================================================================
--- trunk/source/geom/prep/PreparedPolygonIntersects.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedPolygonIntersects.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
Modified: trunk/source/geom/prep/PreparedPolygonPredicate.cpp
===================================================================
--- trunk/source/geom/prep/PreparedPolygonPredicate.cpp 2008-08-12 00:25:16 UTC (rev 2157)
+++ trunk/source/geom/prep/PreparedPolygonPredicate.cpp 2008-08-18 16:24:18 UTC (rev 2158)
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id:
+ * $Id$
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
More information about the geos-commits
mailing list