21 #ifndef GEOS_GEOM_POLYGON_H 22 #define GEOS_GEOM_POLYGON_H 24 #include <geos/export.h> 27 #include <geos/geom/Geometry.h> 28 #include <geos/geom/Envelope.h> 29 #include <geos/geom/LinearRing.h> 30 #include <geos/geom/Dimension.h> 32 #include <geos/inline.h> 40 class CoordinateArraySequence;
41 class CoordinateSequenceFilter;
81 std::unique_ptr<Polygon>
clone()
const 83 return std::unique_ptr<Polygon>(cloneImpl());
86 std::unique_ptr<CoordinateSequence> getCoordinates()
const override;
88 std::size_t getNumPoints()
const override;
94 uint8_t getCoordinateDimension()
const override;
97 int getBoundaryDimension()
const override;
105 std::unique_ptr<Geometry> getBoundary()
const override;
107 bool isEmpty()
const override;
120 std::unique_ptr<LinearRing> releaseExteriorRing();
123 std::size_t getNumInteriorRing()
const;
126 const LinearRing* getInteriorRingN(std::size_t n)
const;
136 std::vector<std::unique_ptr<LinearRing>> releaseInteriorRings();
138 std::string getGeometryType()
const override;
140 bool equalsExact(
const Geometry* other,
double tolerance = 0)
const override;
150 std::unique_ptr<Geometry> convexHull()
const override;
152 void normalize()
override;
154 std::unique_ptr<Polygon> reverse()
const {
return std::unique_ptr<Polygon>(reverseImpl()); }
156 const Coordinate* getCoordinate()
const override;
158 double getArea()
const override;
161 double getLength()
const override;
163 bool isRectangle()
const override;
168 Polygon(
const Polygon& p);
170 int compareToSameClass(
const Geometry* p)
const override;
190 Polygon(LinearRing* newShell, std::vector<LinearRing*>* newHoles,
191 const GeometryFactory* newFactory);
193 Polygon(std::unique_ptr<LinearRing> && newShell,
194 const GeometryFactory& newFactory);
196 Polygon(std::unique_ptr<LinearRing> && newShell,
197 std::vector<std::unique_ptr<LinearRing>> && newHoles,
198 const GeometryFactory& newFactory);
202 Polygon* reverseImpl()
const override;
204 std::unique_ptr<LinearRing> shell;
206 std::vector<std::unique_ptr<LinearRing>> holes;
208 Envelope::Ptr computeEnvelopeInternal()
const override;
211 getSortIndex()
const override 213 return SORTINDEX_POLYGON;
219 void normalize(LinearRing* ring,
bool clockwise);
225 #endif // ndef GEOS_GEOM_POLYGON_H Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition: GeometryFilter.h:47
std::vector< const Polygon * > ConstVect
A vector of const Polygon pointers.
Definition: Polygon.h:71
std::unique_ptr< Polygon > clone() const
Definition: Polygon.h:81
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition: CoordinateSequenceFilter.h:57
GeometryTypeId
Geometry types.
Definition: Geometry.h:75
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition: CoordinateFilter.h:43
Represents a linear polygon, which may include holes.
Definition: Polygon.h:64
Polygon * cloneImpl() const override
Make a deep-copy of this Geometry.
Definition: Polygon.h:200
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple...
Definition: LinearRing.h:57
DimensionType
Definition: Dimension.h:31
Definition: GeometryComponentFilter.h:43