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()));
74 validateConstruction();
77 SurfaceImpl(std::unique_ptr<RingType>&& newShell,
78 std::vector<std::unique_ptr<RingType>>&& newHoles,
79 const GeometryFactory& newFactory) :
81 shell(std::move(newShell)),
82 holes(std::move(newHoles))
84 if (shell ==
nullptr) {
85 shell.reset(
static_cast<RingType*
>(createEmptyRing(newFactory).release()));
88 validateConstruction();
94 getExteriorRing()
const override
100 getExteriorRing()
override
106 getInteriorRingN(std::size_t n)
const override
108 return holes[n].get();
112 getInteriorRingN(std::size_t n)
override
114 return holes[n].get();
117 size_t getNumInteriorRing()
const override
130 std::unique_ptr<RingType>
131 releaseExteriorRing()
133 return std::move(shell);
144 std::vector<std::unique_ptr<RingType>> releaseInteriorRings()
146 return std::move(holes);
150 std::unique_ptr<RingType> shell;
151 std::vector<std::unique_ptr<RingType>> holes;
std::unique_ptr< Geometry > clone() const
Make a deep-copy of this Geometry.
Definition Geometry.h:212
Basic namespace for all GEOS functionalities.
Definition geos.h:38