20#include <geos/geom/CoordinateSequenceFilter.h>
21#include <geos/geom/Curve.h>
22#include <geos/geom/GeometryComponentFilter.h>
23#include <geos/geom/GeometryFilter.h>
24#include <geos/geom/LinearRing.h>
25#include <geos/geom/Surface.h>
26#include <geos/util/IllegalArgumentException.h>
31template<
typename RingType>
32class SurfaceImpl :
public Surface {
36 SurfaceImpl(
const SurfaceImpl& p)
39 shell(static_cast<RingType*>(p.shell->
clone().release())),
42 for (std::size_t i = 0; i < holes.size(); ++i) {
43 holes[i].reset(
static_cast<RingType*
>(p.holes[i]->clone().release()));
65 SurfaceImpl(std::unique_ptr<RingType>&& newShell,
66 const GeometryFactory& newFactory) :
68 shell(std::move(newShell))
70 if (shell ==
nullptr) {
71 shell.reset(
static_cast<RingType*
>(createEmptyRing(newFactory).release()));
75 SurfaceImpl(std::unique_ptr<RingType>&& newShell,
76 std::vector<std::unique_ptr<RingType>>&& newHoles,
77 const GeometryFactory& newFactory) :
79 shell(std::move(newShell)),
80 holes(std::move(newHoles))
82 if (shell ==
nullptr) {
83 shell.reset(
static_cast<RingType*
>(createEmptyRing(newFactory).release()));
97 getExteriorRing()
const override
103 getExteriorRing()
override
109 getInteriorRingN(std::size_t n)
const override
111 return holes[n].get();
115 getInteriorRingN(std::size_t n)
override
117 return holes[n].get();
120 size_t getNumInteriorRing()
const override
133 std::unique_ptr<RingType>
134 releaseExteriorRing()
136 return std::move(shell);
147 std::vector<std::unique_ptr<RingType>> releaseInteriorRings()
149 return std::move(holes);
153 std::unique_ptr<RingType> shell;
154 std::vector<std::unique_ptr<RingType>> holes;
static bool hasNullElements(const CoordinateSequence *list)
Returns true if the CoordinateSequence contains any null elements.
static bool hasNonEmptyElements(const std::vector< T > *geometries)
Returns true if the array contains any non-empty Geometrys.
Definition Geometry.h:903
std::unique_ptr< Geometry > clone() const
Make a deep-copy of this Geometry.
Definition Geometry.h:213
Indicates one or more illegal arguments.
Definition IllegalArgumentException.h:33
Basic namespace for all GEOS functionalities.
Definition geos.h:39