GEOS 3.14.0dev
RectangleIntersectionBuilder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2014 Mika Heiskanen <mika.heiskanen@fmi.fi>
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
19#ifdef _MSC_VER
20#pragma warning(push)
21#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
22#endif
23
24#include <memory>
25#include <list>
26#include <vector>
27
28
29// Forward declarations
30namespace geos {
31namespace geom {
32class Coordinate;
33class CoordinateSequence;
34class Geometry;
35class GeometryFactory;
36class Polygon;
37class LineString;
38class Point;
39}
40namespace operation {
41namespace intersection {
42class Rectangle;
43}
44}
45}
46
47namespace geos {
48namespace operation { // geos::operation
49namespace intersection { // geos::operation::intersection
50
64 // Regular users are not supposed to use this utility class.
65 friend class RectangleIntersection;
66
67public:
68
70
71private:
72
76 std::unique_ptr<geom::Geometry> build();
77
84 void reconnectPolygons(const Rectangle& rect);
85
106 void reconnect();
107
108 void reverseLines();
109
113 void release(RectangleIntersectionBuilder& parts);
114
115 // Adding Geometry components
116 void add(geom::Polygon* g);
117 void add(geom::LineString* g);
118 void add(geom::Point* g);
119
120 // Trivial methods
121 bool empty() const;
122 void clear();
123
124 // Added components
125 std::list<geom::Polygon*> polygons;
126 std::list<geom::LineString*> lines;
127 std::list<geom::Point*> points;
128
141 void close_boundary(
142 const Rectangle& rect,
144 double x1, double y1,
145 double x2, double y2);
146
147 void close_ring(const Rectangle& rect, geom::CoordinateSequence* ring);
148
150 : _gf(f) {}
151
152 const geom::GeometryFactory& _gf;
153
154}; // class RectangleIntersectionBuilder
155
156} // namespace geos::operation::intersection
157} // namespace geos::operation
158} // namespace geos
159
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
Definition LineString.h:66
Definition Point.h:61
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
Rebuild geometries from subpaths left by clipping with a rectangle.
Definition RectangleIntersectionBuilder.h:63
Speed-optimized clipping of a Geometry with a rectangle.
Definition RectangleIntersection.h:73
Clipping rectangle.
Definition operation/intersection/Rectangle.h:51
Basic namespace for all GEOS functionalities.
Definition geos.h:39