GEOS
3.4.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2006-2011 Refractions Research Inc. 00007 * 00008 * This is free software; you can redistribute and/or modify it under 00009 * the terms of the GNU Lesser General Public Licence as published 00010 * by the Free Software Foundation. 00011 * See the COPYING file for more information. 00012 * 00013 ********************************************************************** 00014 * 00015 * Last port: geom/util/GeometryCombiner.java r320 (JTS-1.12) 00016 * 00017 **********************************************************************/ 00018 00019 #ifndef GEOS_GEOM_UTIL_GEOMETRYCOMBINER_H 00020 #define GEOS_GEOM_UTIL_GEOMETRYCOMBINER_H 00021 00022 #include <vector> 00023 00024 // Forward declarations 00025 namespace geos { 00026 namespace geom { 00027 class Geometry; 00028 class GeometryFactory; 00029 } 00030 } 00031 00032 namespace geos { 00033 namespace geom { // geos.geom 00034 namespace util { // geos.geom.util 00035 00047 class GeometryCombiner 00048 { 00049 public: 00056 static Geometry* combine(std::vector<Geometry*> const& geoms); 00057 00065 static Geometry* combine(const Geometry* g0, const Geometry* g1); 00066 00075 static Geometry* combine(const Geometry* g0, const Geometry* g1, const Geometry* g2); 00076 00077 private: 00078 GeometryFactory const* geomFactory; 00079 bool skipEmpty; 00080 std::vector<Geometry*> const& inputGeoms; 00081 00082 public: 00088 GeometryCombiner(std::vector<Geometry*> const& geoms); 00089 00096 static GeometryFactory const* extractFactory(std::vector<Geometry*> const& geoms); 00097 00104 Geometry* combine(); 00105 00106 private: 00107 void extractElements(Geometry* geom, std::vector<Geometry*>& elems); 00108 00109 // Declare type as noncopyable 00110 GeometryCombiner(const GeometryCombiner& other); 00111 GeometryCombiner& operator=(const GeometryCombiner& rhs); 00112 }; 00113 00114 } // namespace geos.geom.util 00115 } // namespace geos.geom 00116 } // namespace geos 00117 00118 #endif