[geos-commits] r3603 - in trunk: include/geos/geom src/geom

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Apr 6 15:03:02 EDT 2012


Author: strk
Date: 2012-04-06 12:03:02 -0700 (Fri, 06 Apr 2012)
New Revision: 3603

Modified:
   trunk/include/geos/geom/CoordinateArraySequence.h
   trunk/include/geos/geom/CoordinateArraySequenceFactory.h
   trunk/include/geos/geom/CoordinateArraySequenceFactory.inl
   trunk/include/geos/geom/CoordinateSequenceFactory.h
   trunk/src/geom/CoordinateArraySequence.cpp
   trunk/src/geom/CoordinateArraySequenceFactory.cpp
   trunk/src/geom/CoordinateSequenceFactory.cpp
Log:
Add CoordinateSequence deep copy trhough CoordinateSequenceFactory

Modified: trunk/include/geos/geom/CoordinateArraySequence.h
===================================================================
--- trunk/include/geos/geom/CoordinateArraySequence.h	2012-04-05 17:07:37 UTC (rev 3602)
+++ trunk/include/geos/geom/CoordinateArraySequence.h	2012-04-06 19:03:02 UTC (rev 3603)
@@ -37,8 +37,10 @@
 class GEOS_DLL CoordinateArraySequence : public CoordinateSequence {
 public:
 
-    CoordinateArraySequence(const CoordinateArraySequence &cl);
+	CoordinateArraySequence(const CoordinateArraySequence &cl);
 
+	CoordinateArraySequence(const CoordinateSequence &cl);
+
 	CoordinateSequence *clone() const;
 
 	//const Coordinate& getCoordinate(int pos) const;

Modified: trunk/include/geos/geom/CoordinateArraySequenceFactory.h
===================================================================
--- trunk/include/geos/geom/CoordinateArraySequenceFactory.h	2012-04-05 17:07:37 UTC (rev 3602)
+++ trunk/include/geos/geom/CoordinateArraySequenceFactory.h	2012-04-06 19:03:02 UTC (rev 3603)
@@ -55,6 +55,8 @@
    	/** @see CoordinateSequenceFactory::create(std::size_t, int) */
 	CoordinateSequence *create(std::size_t size, std::size_t dimension=0) const;
 
+	CoordinateSequence *create(const CoordinateSequence &coordSeq) const;
+
 	/** \brief
 	 * Returns the singleton instance of CoordinateArraySequenceFactory
 	 */
@@ -72,19 +74,3 @@
 #endif
 
 #endif // ndef GEOS_GEOM_COORDINATEARRAYSEQUENCEFACTORY_H
-
-/**********************************************************************
- * $Log$
- * Revision 1.4  2006/06/12 11:29:23  strk
- * unsigned int => size_t
- *
- * Revision 1.3  2006/06/12 10:10:39  strk
- * Fixed getGeometryN() to take size_t rather then int, changed unsigned int parameters to size_t.
- *
- * Revision 1.2  2006/03/24 09:52:41  strk
- * USE_INLINE => GEOS_INLINE
- *
- * Revision 1.1  2006/03/09 16:46:49  strk
- * geos::geom namespace definition, first pass at headers split
- *
- **********************************************************************/

Modified: trunk/include/geos/geom/CoordinateArraySequenceFactory.inl
===================================================================
--- trunk/include/geos/geom/CoordinateArraySequenceFactory.inl	2012-04-05 17:07:37 UTC (rev 3602)
+++ trunk/include/geos/geom/CoordinateArraySequenceFactory.inl	2012-04-06 19:03:02 UTC (rev 3603)
@@ -42,7 +42,14 @@
 	return new CoordinateArraySequence(size,dimension);
 }
 
+INLINE CoordinateSequence *
+CoordinateArraySequenceFactory::create(const CoordinateSequence& seq)
+		const
+{
+	return new CoordinateArraySequence(seq);
+}
 
+
 } // namespace geos::geom
 } // namespace geos
 

Modified: trunk/include/geos/geom/CoordinateSequenceFactory.h
===================================================================
--- trunk/include/geos/geom/CoordinateSequenceFactory.h	2012-04-05 17:07:37 UTC (rev 3602)
+++ trunk/include/geos/geom/CoordinateSequenceFactory.h	2012-04-06 19:03:02 UTC (rev 3603)
@@ -12,7 +12,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/CoordinateSequenceFactory.java rev 1.14 (JTS-1.10)
+ * Last port: geom/CoordinateSequenceFactory.java r591 (JTS-1.12)
  *
  **********************************************************************/
 
@@ -79,6 +79,15 @@
 	virtual CoordinateSequence *create(std::size_t size,
                                            std::size_t dimension) const=0;
 
+	/** \brief
+	 * Creates a CoordinateSequence which is a copy of the given one.
+	 *
+	 * This method must handle null arguments by creating an empty sequence.
+	 *
+	 * @param coordSeq the coordinate sequence to copy
+	 */
+	virtual CoordinateSequence *create(const CoordinateSequence &coordSeq) const=0;
+
 	virtual ~CoordinateSequenceFactory();
 };
 
@@ -90,19 +99,3 @@
 //#endif
 
 #endif // ndef GEOS_GEOM_COORDINATESEQUENCEFACTORY_H
-
-/**********************************************************************
- * $Log$
- * Revision 1.4  2006/06/12 10:10:39  strk
- * Fixed getGeometryN() to take size_t rather then int, changed unsigned int parameters to size_t.
- *
- * Revision 1.3  2006/06/08 11:20:24  strk
- * Added missing virtual destructor to abstract classes.
- *
- * Revision 1.2  2006/03/24 09:52:41  strk
- * USE_INLINE => GEOS_INLINE
- *
- * Revision 1.1  2006/03/09 16:46:49  strk
- * geos::geom namespace definition, first pass at headers split
- *
- **********************************************************************/

Modified: trunk/src/geom/CoordinateArraySequence.cpp
===================================================================
--- trunk/src/geom/CoordinateArraySequence.cpp	2012-04-05 17:07:37 UTC (rev 3602)
+++ trunk/src/geom/CoordinateArraySequence.cpp	2012-04-06 19:03:02 UTC (rev 3603)
@@ -59,6 +59,18 @@
 {
 }
 
+CoordinateArraySequence::CoordinateArraySequence(
+    const CoordinateSequence &c )
+	:
+	CoordinateSequence(c),
+	vect(new vector<Coordinate>(c.size())),
+  dimension(c.getDimension())
+{
+  for (size_t i = 0, n = vect->size(); i < n; ++i) {
+      (*vect)[i] = c.getAt(i);
+  }
+}
+
 CoordinateSequence *
 CoordinateArraySequence::clone() const
 {

Modified: trunk/src/geom/CoordinateArraySequenceFactory.cpp
===================================================================
--- trunk/src/geom/CoordinateArraySequenceFactory.cpp	2012-04-05 17:07:37 UTC (rev 3602)
+++ trunk/src/geom/CoordinateArraySequenceFactory.cpp	2012-04-06 19:03:02 UTC (rev 3603)
@@ -34,34 +34,3 @@
 } // namespace geos::geom
 } // namespace geos
 
-/**********************************************************************
- * $Log$
- * Revision 1.3  2006/03/24 09:52:41  strk
- * USE_INLINE => GEOS_INLINE
- *
- * Revision 1.2  2006/03/09 16:46:47  strk
- * geos::geom namespace definition, first pass at headers split
- *
- * Revision 1.1  2006/01/31 19:07:33  strk
- * - Renamed DefaultCoordinateSequence to CoordinateArraySequence.
- * - Moved GetNumGeometries() and GetGeometryN() interfaces
- *   from GeometryCollection to Geometry class.
- * - Added getAt(int pos, Coordinate &to) funtion to CoordinateSequence class.
- * - Reworked automake scripts to produce a static lib for each subdir and
- *   then link all subsystem's libs togheter
- * - Moved C-API in it's own top-level dir capi/
- * - Moved source/bigtest and source/test to tests/bigtest and test/xmltester
- * - Fixed PointLocator handling of LinearRings
- * - Changed CoordinateArrayFilter to reduce memory copies
- * - Changed UniqueCoordinateArrayFilter to reduce memory copies
- * - Added CGAlgorithms::isPointInRing() version working with
- *   Coordinate::ConstVect type (faster!)
- * - Ported JTS-1.7 version of ConvexHull with big attention to
- *   memory usage optimizations.
- * - Improved XMLTester output and user interface
- * - geos::geom::util namespace used for geom/util stuff
- * - Improved memory use in geos::geom::util::PolygonExtractor
- * - New ShortCircuitedGeometryVisitor class
- * - New operation/predicate package
- *
- **********************************************************************/

Modified: trunk/src/geom/CoordinateSequenceFactory.cpp
===================================================================
--- trunk/src/geom/CoordinateSequenceFactory.cpp	2012-04-05 17:07:37 UTC (rev 3602)
+++ trunk/src/geom/CoordinateSequenceFactory.cpp	2012-04-06 19:03:02 UTC (rev 3603)
@@ -12,7 +12,7 @@
  *
  **********************************************************************
  *
- * Last port: geom/CoordinateSequenceFactory.java rev 1.14 (JTS-1.10)
+ * Last port: geom/CoordinateSequenceFactory.java r591 (JTS-1.12)
  *
  **********************************************************************/
 



More information about the geos-commits mailing list