GEOS  3.8.0dev
MultiPolygon.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  * Copyright (C) 2005 2006 Refractions Research Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: geom/MultiPolygon.java r320 (JTS-1.12)
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_GEOS_MULTIPOLYGON_H
22 #define GEOS_GEOS_MULTIPOLYGON_H
23 
24 #include <geos/export.h>
25 #include <string>
26 #include <vector>
27 #include <geos/geom/GeometryCollection.h> // for inheritance
28 #include <geos/geom/Polygon.h> // for inheritance
29 #include <geos/geom/Dimension.h> // for Dimension::DimensionType
30 
31 #include <geos/inline.h>
32 
33 // Forward declarations
34 namespace geos {
35 namespace geom { // geos::geom
36 class Coordinate;
37 class CoordinateArraySequence;
38 class MultiPoint;
39 }
40 }
41 
42 
43 namespace geos {
44 namespace geom { // geos::geom
45 
46 #ifdef _MSC_VER
47 #pragma warning(push)
48 #pragma warning(disable:4250) // T1 inherits T2 via dominance
49 #endif
50 
52 //
59 class GEOS_DLL MultiPolygon: public GeometryCollection {
60 public:
61 
62  friend class GeometryFactory;
63 
64  ~MultiPolygon() override;
65 
67  Dimension::DimensionType getDimension() const override;
68 
70  return d == Dimension::A;
71  }
72 
74  int getBoundaryDimension() const override;
75 
82  std::unique_ptr<Geometry> getBoundary() const override;
83 
84  std::string getGeometryType() const override;
85 
86  GeometryTypeId getGeometryTypeId() const override;
87 
88  bool equalsExact(const Geometry* other, double tolerance = 0) const override;
89 
90  std::unique_ptr<Geometry> clone() const override;
91 
92  std::unique_ptr<Geometry> reverse() const override;
93 
94 protected:
95 
117  MultiPolygon(std::vector<Geometry*>* newPolys, const GeometryFactory* newFactory);
118 
119  MultiPolygon(std::vector<std::unique_ptr<Polygon>> && newPolys,
120  const GeometryFactory& newFactory);
121 
122  MultiPolygon(std::vector<std::unique_ptr<Geometry>> && newPolys,
123  const GeometryFactory& newFactory);
124 
125  MultiPolygon(const MultiPolygon& mp);
126 
127  int
128  getSortIndex() const override
129  {
130  return SORTINDEX_MULTIPOLYGON;
131  };
132 
133 };
134 
135 #ifdef _MSC_VER
136 #pragma warning(pop)
137 #endif
138 
139 } // namespace geos::geom
140 } // namespace geos
141 
142 #ifdef GEOS_INLINE
143 # include "geos/geom/MultiPolygon.inl"
144 #endif
145 
146 #endif // ndef GEOS_GEOS_MULTIPOLYGON_H
Models a collection of Polygons.
Definition: MultiPolygon.h:59
bool isDimensionStrict(Dimension::DimensionType d) const override
Checks whether this Geometry consists only of components having dimension d.
Definition: MultiPolygon.h:69
GeometryTypeId
Geometry types.
Definition: Geometry.h:75
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Dimension value of a surface (2).
Definition: Dimension.h:48
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:55
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
DimensionType
Definition: Dimension.h:31