GEOS 3.14.0dev
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
57
58private:
59
60 // Members
61 const Envelope* targetEnv;
62 Envelope clipEnv;
63
64 // Methods
65 void add(const Geometry* g);
66 void addCollection(const GeometryCollection* gc);
67 void addPolygon(const Polygon* poly);
68 void addPolygonRing(const LinearRing* ring);
69 void addSegment(const Coordinate& p1, const Coordinate& p2);
70 bool intersectsSegment(const Envelope* env, const Coordinate& p1, const Coordinate& p2);
71
72
73
74public:
75
76 RobustClipEnvelopeComputer(const Envelope* p_targetEnv);
77
78 static Envelope getEnvelope(const Geometry* a, const Geometry* b, const Envelope* targetEnv);
79
80 Envelope getEnvelope();
81
82};
83
84
85} // namespace geos.operation.overlayng
86} // namespace geos.operation
87} // namespace geos
88
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
Represents a collection of heterogeneous Geometry objects.
Definition GeometryCollection.h:51
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
Definition RobustClipEnvelopeComputer.h:50
Basic namespace for all GEOS functionalities.
Definition geos.h:39