[geos-commits] r3538 - in branches/3.3: . include/geos/geom
include/geos/operation/overlay/snap src/operation/overlay/snap
svn_geos at osgeo.org
svn_geos at osgeo.org
Fri Dec 9 05:44:54 EST 2011
Author: strk
Date: 2011-12-09 02:44:54 -0800 (Fri, 09 Dec 2011)
New Revision: 3538
Modified:
branches/3.3/NEWS
branches/3.3/include/geos/geom/Geometry.h
branches/3.3/include/geos/operation/overlay/snap/GeometrySnapper.h
branches/3.3/include/geos/operation/overlay/snap/SnapOverlayOp.h
branches/3.3/src/operation/overlay/snap/GeometrySnapper.cpp
branches/3.3/src/operation/overlay/snap/SnapOverlayOp.cpp
Log:
Fix C++11 build by avoiding std::pair<auto_ptr> (#491)
Modified: branches/3.3/NEWS
===================================================================
--- branches/3.3/NEWS 2011-12-09 10:12:04 UTC (rev 3537)
+++ branches/3.3/NEWS 2011-12-09 10:44:54 UTC (rev 3538)
@@ -11,6 +11,7 @@
- Fix HotPixel original point invalidation (#498)
- Fix CascadedPolygonUnion to discard non-polygonal components (#499)
- Improve buffer robustness by reverting to non-snaprounding noder (#495)
+ - Fix C++11 build by avoiding std::pair<auto_ptr> (#491)
Changes in 3.3.1
2011-09-27
Modified: branches/3.3/include/geos/geom/Geometry.h
===================================================================
--- branches/3.3/include/geos/geom/Geometry.h 2011-12-09 10:12:04 UTC (rev 3537)
+++ branches/3.3/include/geos/geom/Geometry.h 2011-12-09 10:44:54 UTC (rev 3538)
@@ -876,6 +876,14 @@
*/
std::string jtsport();
+// We use this instead of std::pair<auto_ptr<Geometry>> because C++11
+// forbids that construct:
+// http://lwg.github.com/issues/lwg-closed.html#2068
+struct GeomPtrPair {
+ typedef std::auto_ptr<Geometry> GeomPtr;
+ GeomPtr first;
+ GeomPtr second;
+};
} // namespace geos::geom
} // namespace geos
Modified: branches/3.3/include/geos/operation/overlay/snap/GeometrySnapper.h
===================================================================
--- branches/3.3/include/geos/operation/overlay/snap/GeometrySnapper.h 2011-12-09 10:12:04 UTC (rev 3537)
+++ branches/3.3/include/geos/operation/overlay/snap/GeometrySnapper.h 2011-12-09 10:44:54 UTC (rev 3538)
@@ -32,6 +32,7 @@
//class PrecisionModel;
class Geometry;
class CoordinateSequence;
+ struct GeomPtrPair;
}
}
@@ -60,7 +61,6 @@
public:
typedef std::auto_ptr<geom::Geometry> GeomPtr;
- typedef std::pair<GeomPtr, GeomPtr> GeomPtrPair;
/**
* Snaps two geometries together with a given tolerance.
@@ -73,7 +73,7 @@
*/
static void snap(const geom::Geometry& g0,
const geom::Geometry& g1,
- double snapTolerance, GeomPtrPair& ret);
+ double snapTolerance, geom::GeomPtrPair& ret);
static GeomPtr snapToSelf(const geom::Geometry& g0,
double snapTolerance, bool cleanResult);
Modified: branches/3.3/include/geos/operation/overlay/snap/SnapOverlayOp.h
===================================================================
--- branches/3.3/include/geos/operation/overlay/snap/SnapOverlayOp.h 2011-12-09 10:12:04 UTC (rev 3537)
+++ branches/3.3/include/geos/operation/overlay/snap/SnapOverlayOp.h 2011-12-09 10:44:54 UTC (rev 3538)
@@ -34,6 +34,7 @@
namespace geos {
namespace geom {
class Geometry;
+ struct GeomPtrPair;
}
}
@@ -107,12 +108,11 @@
void computeSnapTolerance();
- typedef std::pair<GeomPtr, GeomPtr> GeomPtrPair;
+ void snap(geom::GeomPtrPair& ret);
- void snap(GeomPtrPair& ret);
-
void removeCommonBits(const geom::Geometry& geom0,
- const geom::Geometry& geom1, GeomPtrPair& ret);
+ const geom::Geometry& geom1,
+ geom::GeomPtrPair& ret);
// re-adds common bits to the given geom
void prepareResult(geom::Geometry& geom);
Modified: branches/3.3/src/operation/overlay/snap/GeometrySnapper.cpp
===================================================================
--- branches/3.3/src/operation/overlay/snap/GeometrySnapper.cpp 2011-12-09 10:12:04 UTC (rev 3537)
+++ branches/3.3/src/operation/overlay/snap/GeometrySnapper.cpp 2011-12-09 10:44:54 UTC (rev 3538)
@@ -193,7 +193,7 @@
GeometrySnapper::snap(const geom::Geometry& g0,
const geom::Geometry& g1,
double snapTolerance,
- GeometrySnapper::GeomPtrPair& snapGeom)
+ geom::GeomPtrPair& snapGeom)
{
GeometrySnapper snapper0(g0);
snapGeom.first = snapper0.snapTo(g1, snapTolerance);
Modified: branches/3.3/src/operation/overlay/snap/SnapOverlayOp.cpp
===================================================================
--- branches/3.3/src/operation/overlay/snap/SnapOverlayOp.cpp 2011-12-09 10:12:04 UTC (rev 3537)
+++ branches/3.3/src/operation/overlay/snap/SnapOverlayOp.cpp 2011-12-09 10:44:54 UTC (rev 3538)
@@ -52,7 +52,7 @@
auto_ptr<Geometry>
SnapOverlayOp::getResultGeometry(OverlayOp::OpCode opCode)
{
- GeomPtrPair prepGeom;
+ geom::GeomPtrPair prepGeom;
snap(prepGeom);
GeomPtr result ( OverlayOp::overlayOp(prepGeom.first.get(),
prepGeom.second.get(), opCode) );
@@ -62,9 +62,9 @@
/* private */
void
-SnapOverlayOp::snap(SnapOverlayOp::GeomPtrPair& snapGeom)
+SnapOverlayOp::snap(geom::GeomPtrPair& snapGeom)
{
- GeomPtrPair remGeom;
+ geom::GeomPtrPair remGeom;
removeCommonBits(geom0, geom1, remGeom);
GeometrySnapper::snap(*remGeom.first, *remGeom.second,
@@ -86,7 +86,7 @@
void
SnapOverlayOp::removeCommonBits(const geom::Geometry& geom0,
const geom::Geometry& geom1,
- SnapOverlayOp::GeomPtrPair& remGeom)
+ geom::GeomPtrPair& remGeom)
{
cbr.reset(new precision::CommonBitsRemover());
cbr->add(&geom0);
More information about the geos-commits
mailing list