GEOS 3.11.1
RobustClipEnvelopeComputer.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/export.h>
18#include <geos/geom/Envelope.h>
19
20#include <vector>
21#include <map>
22
23
24// Forward declarations
25namespace geos {
26namespace geom {
27class Coordinate;
28class Geometry;
29class GeometryCollection;
30class Polygon;
31class LinearRing;
32}
33namespace operation {
34}
35}
36
37namespace geos { // geos.
38namespace operation { // geos.operation
39namespace overlayng { // geos.operation.overlayng
40
41using namespace geos::geom;
42
53
54private:
55
56 // Members
57 const Envelope* targetEnv;
58 Envelope clipEnv;
59
60 // Methods
61 void add(const Geometry* g);
62 void addCollection(const GeometryCollection* gc);
63 void addPolygon(const Polygon* poly);
64 void addPolygonRing(const LinearRing* ring);
65 void addSegment(const Coordinate& p1, const Coordinate& p2);
66 bool intersectsSegment(const Envelope* env, const Coordinate& p1, const Coordinate& p2);
67
68
69
70public:
71
72 RobustClipEnvelopeComputer(const Envelope* p_targetEnv);
73
74 static Envelope getEnvelope(const Geometry* a, const Geometry* b, const Envelope* targetEnv);
75
76 Envelope getEnvelope();
77
78};
79
80
81} // namespace geos.operation.overlayng
82} // namespace geos.operation
83} // namespace geos
84
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
Represents a collection of heterogeneous Geometry objects.
Definition: GeometryCollection.h:52
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition: LinearRing.h:55
Represents a linear polygon, which may include holes.
Definition: Polygon.h:61
Definition: RobustClipEnvelopeComputer.h:52
Definition: Angle.h:26
Basic namespace for all GEOS functionalities.
Definition: geos.h:39