Surface.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2024 ISciences, LLC
*
* 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.
*
**********************************************************************/
#pragma once
#include <geos/geom/Geometry.h>
namespace geos {
namespace geom {
class Curve;
class GEOS_DLL Surface : public Geometry {
private:
protected:
using Geometry::Geometry;
public:
void apply_ro(CoordinateFilter* filter) const override;
void apply_ro(CoordinateSequenceFilter& filter) const override;
void apply_ro(GeometryComponentFilter* filter) const override;
void apply_ro(GeometryFilter* filter) const override;
void apply_rw(CoordinateSequenceFilter& filter) override;
void apply_rw(GeometryComponentFilter* filter) override;
void apply_rw(GeometryFilter* filter) override;
void apply_rw(const CoordinateFilter* filter) override;
std::unique_ptr<Geometry> convexHull() const override;
bool
equalsExact(const Geometry* other, double tolerance = 0.0) const override;
bool
equalsIdentical(const Geometry* other) const override;
int
getBoundaryDimension() const override
{
return 1;
}
const CoordinateXY* getCoordinate() const override;
uint8_t getCoordinateDimension() const override;
Dimension::DimensionType
getDimension() const override
{
return Dimension::A; // area
}
const Envelope* getEnvelopeInternal() const override;
virtual const Curve* getExteriorRing() const = 0;
virtual const Curve* getInteriorRingN(std::size_t n) const = 0;
double getLength() const override;
virtual size_t getNumInteriorRing() const = 0;
size_t getNumPoints() const override;
bool hasM() const override;
bool hasZ() const override;
bool isEmpty() const override;
protected:
int
compareToSameClass(const Geometry* g) const override;
// Helper method allowing PolygonImpl to use GeometryFactory without circular imports
static std::unique_ptr<Geometry> createEmptyRing(const GeometryFactory&);
virtual Curve* getExteriorRing() = 0;
virtual Curve* getInteriorRingN(std::size_t i) = 0;
void geometryChangedAction() override {}
};
}
}
geos::geom::CoordinateFilter
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition CoordinateFilter.h:43
geos::geom::CoordinateSequenceFilter
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition CoordinateSequenceFilter.h:56
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::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::geom::GeometryComponentFilter
Definition GeometryComponentFilter.h:41
geos::geom::GeometryFilter
Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition GeometryFilter.h:45
geos::geom::Surface
Definition Surface.h:27
geos::geom::Surface::convexHull
std::unique_ptr< Geometry > convexHull() const override
Returns the smallest convex Polygon that contains all the points in the Geometry.
geos::geom::Surface::isEmpty
bool isEmpty() const override
Returns whether or not the set of points in this Geometry is empty.
geos::geom::Surface::getCoordinateDimension
uint8_t getCoordinateDimension() const override
Returns the coordinate dimension of this Geometry (2=XY, 3=XYZ or XYM, 4=XYZM).
geos::geom::Surface::getCoordinate
const CoordinateXY * getCoordinate() const override
Returns a vertex of this Geometry, or NULL if this is the empty geometry.
geos::geom::Surface::equalsIdentical
bool equalsIdentical(const Geometry *other) const override
Returns true if the two geometries are of the same type and their vertices corresponding by index are...
geos::geom::Surface::equalsExact
bool equalsExact(const Geometry *other, double tolerance=0.0) const override
Returns true iff the two Geometrys are of the same type and their vertices corresponding by index are...
geos::geom::Surface::geometryChangedAction
void geometryChangedAction() override
Notifies this Geometry that its Coordinates have been changed by an external party.
Definition Surface.h:110
geos::geom::Surface::getDimension
Dimension::DimensionType getDimension() const override
Returns the dimension of this Geometry (0=point, 1=line, 2=surface).
Definition Surface.h:71
geos::geom::Surface::apply_rw
void apply_rw(CoordinateSequenceFilter &filter) override
geos::geom::Surface::getNumInteriorRing
virtual size_t getNumInteriorRing() const =0
Returns number of interior rings (holes).
geos::geom::Surface::getBoundaryDimension
int getBoundaryDimension() const override
Returns the dimension of this Geometrys inherent boundary.
Definition Surface.h:61
geos::geom::Surface::getExteriorRing
virtual const Curve * getExteriorRing() const =0
Returns the exterior ring (shell).
geos::geom::Surface::getNumPoints
size_t getNumPoints() const override
Returns the count of this Geometrys vertices.
geos::geom::Surface::getEnvelopeInternal
const Envelope * getEnvelopeInternal() const override
Returns the minimum and maximum x and y values in this Geometry, or a null Envelope if this Geometry ...
geos::geom::Surface::apply_ro
void apply_ro(CoordinateSequenceFilter &filter) const override
geos::geom::Surface::getLength
double getLength() const override
Returns the perimeter of this Surface.
geos::geom::Surface::getInteriorRingN
virtual const Curve * getInteriorRingN(std::size_t n) const =0
Get nth interior ring (hole).
geos::geom
Definition Angle.h:26
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38