MultiPolygon.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
* Copyright (C) 2001-2002 Vivid Solutions Inc.
* Copyright (C) 2005 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: geom/MultiPolygon.java r320 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <string>
#include <vector>
#include <geos/geom/GeometryCollection.h> // for inheritance
#include <geos/geom/Polygon.h> // for inheritance
#include <geos/geom/Dimension.h> // for Dimension::DimensionType
#include <geos/geom/GeometryCollection.h>
// Forward declarations
namespace geos {
namespace geom { // geos::geom
class Coordinate;
class MultiPoint;
class Polygon;
}
}
namespace geos {
namespace geom { // geos::geom
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4250) // T1 inherits T2 via dominance
#endif
class GEOS_DLL MultiPolygon: public GeometryCollection {
public:
friend class GeometryFactory;
~MultiPolygon() override;
Dimension::DimensionType getDimension() const override;
bool hasDimension(Dimension::DimensionType d) const override {
return d == Dimension::A;
}
bool isDimensionStrict(Dimension::DimensionType d) const override {
return d == Dimension::A;
}
int getBoundaryDimension() const override;
std::unique_ptr<Geometry> getBoundary() const override;
const Polygon* getGeometryN(std::size_t n) const override;
std::string getGeometryType() const override;
GeometryTypeId getGeometryTypeId() const override;
std::unique_ptr<MultiPolygon> clone() const
{
return std::unique_ptr<MultiPolygon>(cloneImpl());
};
std::unique_ptr<MultiPolygon> reverse() const { return std::unique_ptr<MultiPolygon>(reverseImpl()); }
protected:
MultiPolygon(std::vector<std::unique_ptr<Polygon>> && newPolys,
const GeometryFactory& newFactory);
MultiPolygon(std::vector<std::unique_ptr<Geometry>> && newPolys,
const GeometryFactory& newFactory);
MultiPolygon(const MultiPolygon& mp)
: GeometryCollection(mp)
{};
MultiPolygon* cloneImpl() const override { return new MultiPolygon(*this); }
MultiPolygon* reverseImpl() const override;
int
getSortIndex() const override
{
return SORTINDEX_MULTIPOLYGON;
};
bool hasCurvedComponents() const override
{
return false;
}
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace geos::geom
} // namespace geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::Dimension::DimensionType
DimensionType
Definition Dimension.h:29
geos::geom::Dimension::A
@ A
Dimension value of a surface (2).
Definition Dimension.h:46
geos::geom::MultiPoint
Definition MultiPoint.h:50
geos::geom::MultiPolygon::MultiPolygon
MultiPolygon(std::vector< std::unique_ptr< Polygon > > &&newPolys, const GeometryFactory &newFactory)
Construct a MultiPolygon.
geos::geom::MultiPolygon::getBoundary
std::unique_ptr< Geometry > getBoundary() const override
Computes the boundary of this geometry.
geos::geom::MultiPolygon::getBoundaryDimension
int getBoundaryDimension() const override
Returns 1 (MultiPolygon boundary is MultiLineString).
geos::geom::MultiPolygon::getDimension
Dimension::DimensionType getDimension() const override
Returns surface dimension (2).
geos::geom::MultiPolygon::getGeometryType
std::string getGeometryType() const override
Return a string representation of this Geometry type.
geos::geom::MultiPolygon::getGeometryTypeId
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
geos::geom::MultiPolygon::getGeometryN
const Polygon * getGeometryN(std::size_t n) const override
Returns a pointer to the nth Geometry in this collection.
geos::geom::MultiPolygon::hasCurvedComponents
bool hasCurvedComponents() const override
Returns whether the Geometry contains curved components.
Definition MultiPolygon.h:143
geos::geom::MultiPolygon::reverseImpl
MultiPolygon * reverseImpl() const override
Make a geometry with coordinates in reverse order.
geos::geom::MultiPolygon::isDimensionStrict
bool isDimensionStrict(Dimension::DimensionType d) const override
Checks whether this Geometry consists only of components having dimension d.
Definition MultiPolygon.h:72
geos::geom::MultiPolygon::cloneImpl
MultiPolygon * cloneImpl() const override
Make a deep-copy of this Geometry.
Definition MultiPolygon.h:133
geos::geom::MultiPolygon::hasDimension
bool hasDimension(Dimension::DimensionType d) const override
Checks whether any component of this geometry has dimension d.
Definition MultiPolygon.h:68
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::geom
Definition Angle.h:26
geos::geom::GeometryTypeId
GeometryTypeId
Geometry types.
Definition Geometry.h:73
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38