GEOS  3.13.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
25 namespace geos {
26 namespace geom {
27 class Coordinate;
28 class Geometry;
29 class GeometryCollection;
30 class Polygon;
31 class LinearRing;
32 }
33 namespace operation {
34 }
35 }
36 
37 namespace geos { // geos.
38 namespace operation { // geos.operation
39 namespace overlayng { // geos.operation.overlayng
40 
41 using namespace geos::geom;
42 
53 
54 private:
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 
70 public:
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:216
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:51
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:54
Represents a linear polygon, which may include holes.
Definition: Polygon.h:60
Definition: RobustClipEnvelopeComputer.h:52
Definition: Angle.h:26
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25