GEOS  3.13.1
Surface.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2024 ISciences, LLC
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14 
15 #pragma once
16 
17 #include <geos/geom/Geometry.h>
18 
19 namespace geos {
20 namespace geom {
21 
22 class Curve;
23 
27 class GEOS_DLL Surface : public Geometry {
28 
29 private:
30 
31 protected:
32  using Geometry::Geometry;
33 
34 public:
35 
36  void apply_ro(CoordinateFilter* filter) const override;
37 
38  void apply_ro(CoordinateSequenceFilter& filter) const override;
39 
40  void apply_ro(GeometryComponentFilter* filter) const override;
41 
42  void apply_ro(GeometryFilter* filter) const override;
43 
44  void apply_rw(CoordinateSequenceFilter& filter) override;
45 
46  void apply_rw(GeometryComponentFilter* filter) override;
47 
48  void apply_rw(GeometryFilter* filter) override;
49 
50  void apply_rw(const CoordinateFilter* filter) override;
51 
52  std::unique_ptr<Geometry> convexHull() const override;
53 
54  bool
55  equalsExact(const Geometry* other, double tolerance = 0.0) const override;
56 
57  bool
58  equalsIdentical(const Geometry* other) const override;
59 
60  int
61  getBoundaryDimension() const override
62  {
63  return 1;
64  }
65 
66  const CoordinateXY* getCoordinate() const override;
67 
68  uint8_t getCoordinateDimension() const override;
69 
71  getDimension() const override
72  {
73  return Dimension::A; // area
74  }
75 
76  const Envelope* getEnvelopeInternal() const override;
77 
79  virtual const Curve* getExteriorRing() const = 0;
80 
82  virtual const Curve* getInteriorRingN(std::size_t n) const = 0;
83 
85  double getLength() const override;
86 
88  virtual size_t getNumInteriorRing() const = 0;
89 
90  size_t getNumPoints() const override;
91 
92  bool hasM() const override;
93 
94  bool hasZ() const override;
95 
96  bool isEmpty() const override;
97 
98 protected:
99 
100  int
101  compareToSameClass(const Geometry* g) const override;
102 
103  // Helper method allowing PolygonImpl to use GeometryFactory without circular imports
104  static std::unique_ptr<Geometry> createEmptyRing(const GeometryFactory&);
105 
106  virtual Curve* getExteriorRing() = 0;
107 
108  virtual Curve* getInteriorRingN(std::size_t i) = 0;
109 
110  void geometryChangedAction() override {}
111 
112 };
113 
114 }
115 }
Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition: GeometryFilter.h:45
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:59
int getBoundaryDimension() const override
Returns the dimension of this Geometrys inherent boundary.
Definition: Surface.h:61
Dimension::DimensionType getDimension() const override
Returns the dimension of this Geometry (0=point, 1=line, 2=surface)
Definition: Surface.h:71
void geometryChangedAction() override
Notifies this Geometry that its Coordinates have been changed by an external party.
Definition: Surface.h:110
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition: CoordinateSequenceFilter.h:55
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition: CoordinateFilter.h:43
Dimension value of a surface (2).
Definition: Dimension.h:46
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:70
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25
Definition: Surface.h:27
DimensionType
Definition: Dimension.h:29
Definition: GeometryComponentFilter.h:41