GEOS  3.9.1dev
MultiPolygon.h
Go to the documentation of this file.
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 
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  const Polygon* getGeometryN(std::size_t n) const override;
85 
86  std::string getGeometryType() const override;
87 
88  GeometryTypeId getGeometryTypeId() const override;
89 
90  bool equalsExact(const Geometry* other, double tolerance = 0) const override;
91 
92  std::unique_ptr<Geometry> clone() const override;
93 
94  std::unique_ptr<Geometry> reverse() const override;
95 
96 protected:
97 
119  MultiPolygon(std::vector<Geometry*>* newPolys, const GeometryFactory* newFactory);
120 
121  MultiPolygon(std::vector<std::unique_ptr<Polygon>> && newPolys,
122  const GeometryFactory& newFactory);
123 
124  MultiPolygon(std::vector<std::unique_ptr<Geometry>> && newPolys,
125  const GeometryFactory& newFactory);
126 
127  MultiPolygon(const MultiPolygon& mp);
128 
129  int
130  getSortIndex() const override
131  {
132  return SORTINDEX_MULTIPOLYGON;
133  };
134 
135 };
136 
137 #ifdef _MSC_VER
138 #pragma warning(pop)
139 #endif
140 
141 } // namespace geos::geom
142 } // namespace geos
143 
144 #ifdef GEOS_INLINE
145 # include "geos/geom/MultiPolygon.inl"
146 #endif
147 
148 #endif // ndef GEOS_GEOS_MULTIPOLYGON_H
#define GEOS_DLL
Definition: export.h:28
int getSortIndex() const override
Definition: MultiPolygon.h:130
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
Represents a linear polygon, which may include holes.
Definition: Polygon.h:64
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...
Represents a collection of heterogeneous Geometry objects.
Basic namespace for all GEOS functionalities.