GEOS 3.9.1
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
34namespace geos {
35namespace geom { // geos::geom
36class Coordinate;
37class CoordinateArraySequence;
38class MultiPoint;
39}
40}
41
42
43namespace geos {
44namespace 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
59class GEOS_DLL MultiPolygon: public GeometryCollection {
60public:
61
62 friend class GeometryFactory;
63
64 ~MultiPolygon() override;
65
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
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
96protected:
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
DimensionType
Definition Dimension.h:31
Represents a collection of heterogeneous Geometry objects.
Definition GeometryCollection.h:55
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:68
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:188
Definition MultiPolygon.h:59
std::unique_ptr< Geometry > getBoundary() const override
Computes the boundary of this geometry.
int getBoundaryDimension() const override
Returns 1 (MultiPolygon boundary is MultiLineString)
MultiPolygon(std::vector< Geometry * > *newPolys, const GeometryFactory *newFactory)
Construct a MultiPolygon.
Dimension::DimensionType getDimension() const override
Returns surface dimension (2)
std::unique_ptr< Geometry > reverse() const override
std::string getGeometryType() const override
Return a string representation of this Geometry type.
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
const Polygon * getGeometryN(std::size_t n) const override
Returns a pointer to the nth Geometry in this collection.
bool equalsExact(const Geometry *other, double tolerance=0) const override
Returns true iff the two Geometrys are of the same type and their vertices corresponding by index are...
bool isDimensionStrict(Dimension::DimensionType d) const override
Checks whether this Geometry consists only of components having dimension d.
Definition MultiPolygon.h:69
std::unique_ptr< Geometry > clone() const override
Represents a linear polygon, which may include holes.
Definition Polygon.h:64
GeometryTypeId
Geometry types.
Definition Geometry.h:75
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26