[geos-commits] r2778 - trunk/source/headers/geos/noding
svn_geos at osgeo.org
svn_geos at osgeo.org
Thu Dec 3 14:44:01 EST 2009
Author: mloskot
Date: 2009-12-03 14:44:00 -0500 (Thu, 03 Dec 2009)
New Revision: 2778
Modified:
trunk/source/headers/geos/noding/FastNodingValidator.h
trunk/source/headers/geos/noding/IntersectionAdder.h
trunk/source/headers/geos/noding/IntersectionFinderAdder.h
trunk/source/headers/geos/noding/MCIndexNoder.h
trunk/source/headers/geos/noding/MCIndexSegmentSetMutualIntersector.h
trunk/source/headers/geos/noding/NodedSegmentString.h
trunk/source/headers/geos/noding/NodingValidator.h
trunk/source/headers/geos/noding/OrientedCoordinateArray.h
trunk/source/headers/geos/noding/ScaledNoder.h
trunk/source/headers/geos/noding/SegmentNode.h
trunk/source/headers/geos/noding/SegmentNodeList.h
trunk/source/headers/geos/noding/SegmentString.h
trunk/source/headers/geos/noding/SingleInteriorIntersectionFinder.h
Log:
Part 17 of larger changeset - source/headers/geos/noding/snapround:
* Declare noncopyable types as such explicitly (Ticket #304).
* Added Visual C++ pragmas.
* Tidy up.
* Unified EOL and style.
Modified: trunk/source/headers/geos/noding/FastNodingValidator.h
===================================================================
--- trunk/source/headers/geos/noding/FastNodingValidator.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/FastNodingValidator.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -111,7 +111,9 @@
void checkInteriorIntersections();
-
+ // Declare type as noncopyable
+ FastNodingValidator(const FastNodingValidator& other);
+ FastNodingValidator& operator=(const FastNodingValidator& rhs);
};
} // namespace geos.noding
Modified: trunk/source/headers/geos/noding/IntersectionAdder.h
===================================================================
--- trunk/source/headers/geos/noding/IntersectionAdder.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/IntersectionAdder.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -85,7 +85,9 @@
bool isTrivialIntersection(const SegmentString* e0, int segIndex0,
const SegmentString* e1, int segIndex1);
-
+ // Declare type as noncopyable
+ IntersectionAdder(const IntersectionAdder& other);
+ IntersectionAdder& operator=(const IntersectionAdder& rhs);
public:
Modified: trunk/source/headers/geos/noding/IntersectionFinderAdder.h
===================================================================
--- trunk/source/headers/geos/noding/IntersectionFinderAdder.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/IntersectionFinderAdder.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -53,10 +53,6 @@
*/
class GEOS_DLL IntersectionFinderAdder: public SegmentIntersector {
-private:
- algorithm::LineIntersector& li;
- std::vector<geom::Coordinate>& interiorIntersections;
-
public:
/**
@@ -99,6 +95,14 @@
virtual bool isDone() const {
return false;
}
+
+private:
+ algorithm::LineIntersector& li;
+ std::vector<geom::Coordinate>& interiorIntersections;
+
+ // Declare type as noncopyable
+ IntersectionFinderAdder(const IntersectionFinderAdder& other);
+ IntersectionFinderAdder& operator=(const IntersectionFinderAdder& rhs);
};
} // namespace geos.noding
Modified: trunk/source/headers/geos/noding/MCIndexNoder.h
===================================================================
--- trunk/source/headers/geos/noding/MCIndexNoder.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/MCIndexNoder.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -92,8 +92,6 @@
void computeNodes(std::vector<SegmentString*>* inputSegmentStrings);
class SegmentOverlapAction : public index::chain::MonotoneChainOverlapAction {
- private:
- SegmentIntersector& si;
public:
SegmentOverlapAction(SegmentIntersector& newSi)
:
@@ -102,8 +100,13 @@
{}
void overlap(index::chain::MonotoneChain& mc1, size_t start1,
- index::chain::MonotoneChain& mc2, size_t start2);
+ index::chain::MonotoneChain& mc2, size_t start2);
+ private:
+ SegmentIntersector& si;
+ // Declare type as noncopyable
+ SegmentOverlapAction(const SegmentOverlapAction& other);
+ SegmentOverlapAction& operator=(const SegmentOverlapAction& rhs);
};
};
Modified: trunk/source/headers/geos/noding/MCIndexSegmentSetMutualIntersector.h
===================================================================
--- trunk/source/headers/geos/noding/MCIndexSegmentSetMutualIntersector.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/MCIndexSegmentSetMutualIntersector.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -70,22 +70,23 @@
void process(SegmentString::ConstVect* segStrings);
- class SegmentOverlapAction : public index::chain::MonotoneChainOverlapAction
- {
- private:
- SegmentIntersector & si;
+ class SegmentOverlapAction : public index::chain::MonotoneChainOverlapAction
+ {
+ private:
+ SegmentIntersector & si;
- public:
+ // Declare type as noncopyable
+ SegmentOverlapAction(const SegmentOverlapAction& other);
+ SegmentOverlapAction& operator=(const SegmentOverlapAction& rhs);
- SegmentOverlapAction(SegmentIntersector & si)
- :
- index::chain::MonotoneChainOverlapAction(),
- si(si)
- {}
+ public:
+ SegmentOverlapAction(SegmentIntersector & si) :
+ index::chain::MonotoneChainOverlapAction(), si(si)
+ {}
- void overlap(index::chain::MonotoneChain& mc1, size_t start1,
- index::chain::MonotoneChain& mc2, size_t start2);
- };
+ void overlap(index::chain::MonotoneChain& mc1, size_t start1,
+ index::chain::MonotoneChain& mc2, size_t start2);
+ };
private:
Modified: trunk/source/headers/geos/noding/NodedSegmentString.h
===================================================================
--- trunk/source/headers/geos/noding/NodedSegmentString.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/NodedSegmentString.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -30,7 +30,10 @@
//#include <geos/noding/Octant.h>
#include <geos/geom/Coordinate.h>
-//using namespace
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4355) // warning C4355: 'this' : used in base member initializer list
+#endif
namespace geos {
namespace noding { // geos::noding
@@ -190,6 +193,10 @@
} // namespace geos::noding
} // namespace geos
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif // GEOS_NODING_NODEDSEGMENTSTRING_H
/**********************************************************************
* $Log$
Modified: trunk/source/headers/geos/noding/NodingValidator.h
===================================================================
--- trunk/source/headers/geos/noding/NodingValidator.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/NodingValidator.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -91,6 +91,10 @@
bool hasInteriorIntersection(const algorithm::LineIntersector& aLi,
const geom::Coordinate& p0, const geom::Coordinate& p1) const;
+ // Declare type as noncopyable
+ NodingValidator(const NodingValidator& other);
+ NodingValidator& operator=(const NodingValidator& rhs);
+
public:
NodingValidator(const std::vector<SegmentString*>& newSegStrings):
Modified: trunk/source/headers/geos/noding/OrientedCoordinateArray.h
===================================================================
--- trunk/source/headers/geos/noding/OrientedCoordinateArray.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/OrientedCoordinateArray.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -1,107 +1,110 @@
-/**********************************************************************
- * $Id$
- *
- * GEOS - Geometry Engine Open Source
- * http://geos.refractions.net
- *
- * Copyright (C) 2009 Sandro Santilli <strk at keybit.net>
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Public Licence as published
- * by the Free Software Foundation.
- * See the COPYING file for more information.
- *
- **********************************************************************
- *
- * Last port: noding/OrientedCoordinateArray.java rev. 1.1 (JTS-1.9)
- *
- **********************************************************************/
-
-#ifndef GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
-#define GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
-
-#include <geos/export.h>
-
-//#include <vector>
-//#include <iostream>
-
-//#include <geos/inline.h>
-
-// Forward declarations
-namespace geos {
- namespace geom {
- class CoordinateSequence;
- }
- namespace noding {
- //class SegmentString;
- }
-}
-
-namespace geos {
-namespace noding { // geos.noding
-
-/** \brief
- * Allows comparing {@link geom::CoordinateSequence}s
- * in an orientation-independent way.
- */
-class GEOS_DLL OrientedCoordinateArray
-{
-public:
-
- /**
- * Creates a new {@link OrientedCoordinateArray}
- * for the given {@link geom::CoordinateSequence}.
- *
- * @param pts the coordinates to orient
- */
- OrientedCoordinateArray(const geom::CoordinateSequence& pts)
- :
- pts(pts),
- orientationVar(orientation(pts))
- {
- }
-
- /** \brief
- * Compares two {@link OrientedCoordinateArray}s for their
- * relative order
- *
- * @return -1 this one is smaller
- * @return 0 the two objects are equal
- * @return 1 this one is greater
- *
- * In JTS, this is used automatically by ordered lists.
- * In C++, operator< would be used instead....
- */
- int compareTo(const OrientedCoordinateArray& o1) const;
-
-
-private:
-
- static int compareOriented(const geom::CoordinateSequence& pts1,
- bool orientation1,
- const geom::CoordinateSequence& pts2,
- bool orientation2);
-
-
- /**
- * Computes the canonical orientation for a coordinate array.
- *
- * @param pts the array to test
- * @return <code>true</code> if the points are oriented forwards
- * @return <code>false</code if the points are oriented in reverse
- */
- static bool orientation(const geom::CoordinateSequence& pts);
-
- /// Externally owned
- const geom::CoordinateSequence& pts;
-
- bool orientationVar;
-};
-
-
-} // namespace geos.noding
-} // namespace geos
-
-
-#endif // GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
-
+/**********************************************************************
+ * $Id$
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.refractions.net
+ *
+ * Copyright (C) 2009 Sandro Santilli <strk at keybit.net>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: noding/OrientedCoordinateArray.java rev. 1.1 (JTS-1.9)
+ *
+ **********************************************************************/
+
+#ifndef GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
+#define GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
+
+#include <geos/export.h>
+
+//#include <vector>
+//#include <iostream>
+
+//#include <geos/inline.h>
+
+// Forward declarations
+namespace geos {
+ namespace geom {
+ class CoordinateSequence;
+ }
+ namespace noding {
+ //class SegmentString;
+ }
+}
+
+namespace geos {
+namespace noding { // geos.noding
+
+/** \brief
+ * Allows comparing {@link geom::CoordinateSequence}s
+ * in an orientation-independent way.
+ */
+class GEOS_DLL OrientedCoordinateArray
+{
+public:
+
+ /**
+ * Creates a new {@link OrientedCoordinateArray}
+ * for the given {@link geom::CoordinateSequence}.
+ *
+ * @param pts the coordinates to orient
+ */
+ OrientedCoordinateArray(const geom::CoordinateSequence& pts)
+ :
+ pts(pts),
+ orientationVar(orientation(pts))
+ {
+ }
+
+ /** \brief
+ * Compares two {@link OrientedCoordinateArray}s for their
+ * relative order
+ *
+ * @return -1 this one is smaller
+ * @return 0 the two objects are equal
+ * @return 1 this one is greater
+ *
+ * In JTS, this is used automatically by ordered lists.
+ * In C++, operator< would be used instead....
+ */
+ int compareTo(const OrientedCoordinateArray& o1) const;
+
+
+private:
+
+ static int compareOriented(const geom::CoordinateSequence& pts1,
+ bool orientation1,
+ const geom::CoordinateSequence& pts2,
+ bool orientation2);
+
+
+ /**
+ * Computes the canonical orientation for a coordinate array.
+ *
+ * @param pts the array to test
+ * @return <code>true</code> if the points are oriented forwards
+ * @return <code>false</code if the points are oriented in reverse
+ */
+ static bool orientation(const geom::CoordinateSequence& pts);
+
+ /// Externally owned
+ const geom::CoordinateSequence& pts;
+
+ bool orientationVar;
+
+ // Declare type as noncopyable
+ OrientedCoordinateArray(const OrientedCoordinateArray& other);
+ OrientedCoordinateArray& operator=(const OrientedCoordinateArray& rhs);
+};
+
+} // namespace geos.noding
+} // namespace geos
+
+
+#endif // GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
+
Modified: trunk/source/headers/geos/noding/ScaledNoder.h
===================================================================
--- trunk/source/headers/geos/noding/ScaledNoder.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/ScaledNoder.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -56,32 +56,6 @@
*/
class GEOS_DLL ScaledNoder : public Noder { // , public geom::CoordinateFilter { // implements Noder
-private:
-
- Noder& noder;
-
- double scaleFactor;
-
- double offsetX;
-
- double offsetY;
-
- bool isScaled;
-
- void rescale(std::vector<SegmentString*>& segStrings) const;
-
- void scale(std::vector<SegmentString*>& segStrings) const;
-
- class Scaler;
-
- class ReScaler;
-
- friend class ScaledNoder::Scaler;
-
- friend class ScaledNoder::ReScaler;
-
- mutable std::vector<geom::CoordinateSequence*> newCoordSeq;
-
public:
bool isIntegerPrecision() { return (scaleFactor == 1.0); }
@@ -112,6 +86,35 @@
void filter_rw(geom::Coordinate* c) const;
+private:
+
+ Noder& noder;
+
+ double scaleFactor;
+
+ double offsetX;
+
+ double offsetY;
+
+ bool isScaled;
+
+ void rescale(std::vector<SegmentString*>& segStrings) const;
+
+ void scale(std::vector<SegmentString*>& segStrings) const;
+
+ class Scaler;
+
+ class ReScaler;
+
+ friend class ScaledNoder::Scaler;
+
+ friend class ScaledNoder::ReScaler;
+
+ mutable std::vector<geom::CoordinateSequence*> newCoordSeq;
+
+ // Declare type as noncopyable
+ ScaledNoder(const ScaledNoder& other);
+ ScaledNoder& operator=(const ScaledNoder& rhs);
};
} // namespace geos.noding
Modified: trunk/source/headers/geos/noding/SegmentNode.h
===================================================================
--- trunk/source/headers/geos/noding/SegmentNode.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/SegmentNode.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -51,6 +51,10 @@
bool isInteriorVar;
+ // Declare type as noncopyable
+ SegmentNode(const SegmentNode& other);
+ SegmentNode& operator=(const SegmentNode& rhs);
+
public:
friend std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
Modified: trunk/source/headers/geos/noding/SegmentNodeList.h
===================================================================
--- trunk/source/headers/geos/noding/SegmentNodeList.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/SegmentNodeList.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -107,6 +107,11 @@
bool findCollapseIndex(SegmentNode& ei0, SegmentNode& ei1,
size_t& collapsedVertexIndex);
+
+ // Declare type as noncopyable
+ SegmentNodeList(const SegmentNodeList& other);
+ SegmentNodeList& operator=(const SegmentNodeList& rhs);
+
public:
friend std::ostream& operator<< (std::ostream& os, const SegmentNodeList& l);
Modified: trunk/source/headers/geos/noding/SegmentString.h
===================================================================
--- trunk/source/headers/geos/noding/SegmentString.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/SegmentString.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -103,6 +103,9 @@
const void* context;
+ // Declare type as noncopyable
+ SegmentString(const SegmentString& other);
+ SegmentString& operator=(const SegmentString& rhs);
};
std::ostream& operator<< (std::ostream& os, const SegmentString& ss);
Modified: trunk/source/headers/geos/noding/SingleInteriorIntersectionFinder.h
===================================================================
--- trunk/source/headers/geos/noding/SingleInteriorIntersectionFinder.h 2009-12-03 19:41:15 UTC (rev 2777)
+++ trunk/source/headers/geos/noding/SingleInteriorIntersectionFinder.h 2009-12-03 19:44:00 UTC (rev 2778)
@@ -44,11 +44,6 @@
class SingleInteriorIntersectionFinder: public SegmentIntersector
{
-private:
- algorithm::LineIntersector& li;
- geom::Coordinate interiorIntersection;
- std::vector<geom::Coordinate> intSegments;
-
public:
/** \brief
@@ -112,6 +107,15 @@
{
return !interiorIntersection.isNull();
}
+
+private:
+ algorithm::LineIntersector& li;
+ geom::Coordinate interiorIntersection;
+ std::vector<geom::Coordinate> intSegments;
+
+ // Declare type as noncopyable
+ SingleInteriorIntersectionFinder(const SingleInteriorIntersectionFinder& other);
+ SingleInteriorIntersectionFinder& operator=(const SingleInteriorIntersectionFinder& rhs);
};
} // namespace geos.noding
More information about the geos-commits
mailing list