GEOS  3.13.0dev
InputGeometry.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
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/algorithm/locate/IndexedPointInAreaLocator.h>
18 #include <geos/algorithm/locate/PointOnGeometryLocator.h>
19 #include <geos/geom/Coordinate.h>
20 #include <geos/geom/Envelope.h>
21 #include <geos/geom/Geometry.h>
22 #include <geos/geom/Location.h>
23 #include <geos/export.h>
24 
25 #include <array>
26 
27 namespace geos { // geos.
28 namespace operation { // geos.operation
29 namespace overlayng { // geos.operation.overlayng
30 
31 
41 using namespace geos::algorithm::locate;
42 using namespace geos::geom;
43 
44 class GEOS_DLL InputGeometry {
45 
46 private:
47 
48  // Members
49  std::array<const Geometry*, 2> geom;
50  std::unique_ptr<PointOnGeometryLocator> ptLocatorA;
51  std::unique_ptr<PointOnGeometryLocator> ptLocatorB;
52  std::array<bool, 2> isCollapsed;
53 
54 
55 
56 public:
57 
58  InputGeometry(const Geometry* geomA, const Geometry* geomB);
59 
60  bool isSingle() const;
61  int getDimension(uint8_t index) const;
62  const Geometry* getGeometry(uint8_t geomIndex) const;
63  const Envelope* getEnvelope(uint8_t geomIndex) const;
64  bool isEmpty(uint8_t geomIndex) const;
65  bool isArea(uint8_t geomIndex) const;
66  int getAreaIndex() const;
67  bool isLine(uint8_t geomIndex) const;
68  bool isAllPoints() const;
69  bool hasPoints() const;
70 
78  bool hasEdges(uint8_t geomIndex) const;
79 
91  Location locatePointInArea(uint8_t geomIndex, const Coordinate& pt);
92 
93  PointOnGeometryLocator* getLocator(uint8_t geomIndex);
94  void setCollapsed(uint8_t geomIndex, bool isGeomCollapsed);
95 
96 
97 };
98 
99 
100 } // namespace geos.operation.overlayng
101 } // namespace geos.operation
102 } // namespace geos
103 
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition: PointOnGeometryLocator.h:36
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:216
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Classes which determine the Location of points in geometries.
Definition: IndexedPointInAreaLocator.h:40
Definition: Angle.h:26
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:32
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25