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<Geometry>
84 return std::unique_ptr<Geometry>(
new Polygon(*
this));
87 std::unique_ptr<CoordinateSequence> getCoordinates()
const override;
89 size_t getNumPoints()
const override;
95 int getCoordinateDimension()
const override;
98 int getBoundaryDimension()
const override;
106 std::unique_ptr<Geometry> getBoundary()
const override;
108 bool isEmpty()
const override;
114 size_t getNumInteriorRing()
const;
117 const LinearRing* getInteriorRingN(std::size_t n)
const;
119 std::string getGeometryType()
const override;
121 bool equalsExact(
const Geometry* other,
double tolerance = 0)
const override;
131 std::unique_ptr<Geometry> convexHull()
const override;
133 void normalize()
override;
135 std::unique_ptr<Geometry> reverse()
const override;
137 int compareToSameClass(
const Geometry* p)
const override;
139 const Coordinate* getCoordinate()
const override;
141 double getArea()
const override;
144 double getLength()
const override;
146 bool isRectangle()
const override;
174 Polygon(std::unique_ptr<LinearRing> && newShell,
177 Polygon(std::unique_ptr<LinearRing> && newShell,
178 std::vector<std::unique_ptr<LinearRing>> && newHoles,
181 std::unique_ptr<LinearRing> shell;
183 std::vector<std::unique_ptr<LinearRing>> holes;
185 Envelope::Ptr computeEnvelopeInternal()
const override;
188 getSortIndex()
const override
190 return SORTINDEX_POLYGON;
196 void normalize(LinearRing* ring,
bool clockwise);
202 #endif // ndef GEOS_GEOM_POLYGON_H