GEOS  3.3.3
GeometryCombiner.h
1 /**********************************************************************
2  * $Id: GeometryCombiner.h 3177 2011-02-03 19:58:51Z strk $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2006-2011 Refractions Research Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************
15  *
16  * Last port: geom/util/GeometryCombiner.java r320 (JTS-1.12)
17  *
18  **********************************************************************/
19 
20 #ifndef GEOS_GEOM_UTIL_GEOMETRYCOMBINER_H
21 #define GEOS_GEOM_UTIL_GEOMETRYCOMBINER_H
22 
23 #include <vector>
24 
25 // Forward declarations
26 namespace geos {
27  namespace geom {
28  class Geometry;
29  class GeometryFactory;
30  }
31 }
32 
33 namespace geos {
34 namespace geom { // geos.geom
35 namespace util { // geos.geom.util
36 
49 {
50 public:
57  static Geometry* combine(std::vector<Geometry*> const& geoms);
58 
66  static Geometry* combine(const Geometry* g0, const Geometry* g1);
67 
76  static Geometry* combine(const Geometry* g0, const Geometry* g1, const Geometry* g2);
77 
78 private:
79  GeometryFactory const* geomFactory;
80  bool skipEmpty;
81  std::vector<Geometry*> const& inputGeoms;
82 
83 public:
89  GeometryCombiner(std::vector<Geometry*> const& geoms);
90 
97  static GeometryFactory const* extractFactory(std::vector<Geometry*> const& geoms);
98 
105  Geometry* combine();
106 
107 private:
108  void extractElements(Geometry* geom, std::vector<Geometry*>& elems);
109 
110  // Declare type as noncopyable
111  GeometryCombiner(const GeometryCombiner& other);
112  GeometryCombiner& operator=(const GeometryCombiner& rhs);
113 };
114 
115 } // namespace geos.geom.util
116 } // namespace geos.geom
117 } // namespace geos
118 
119 #endif
120 
121 /**********************************************************************
122  * $Log$
123  *
124  **********************************************************************/