15 #ifndef GEOS_OP_RECTANGLE_INTERSECTION_H
16 #define GEOS_OP_RECTANGLE_INTERSECTION_H
18 #include <geos/export.h>
24 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
35 class MultiLineString;
37 class GeometryCollection;
38 class GeometryFactory;
39 class CoordinateSequenceFactory;
42 namespace intersection {
44 class RectangleIntersectionBuilder;
51 namespace intersection {
75 class GEOS_DLL RectangleIntersection {
86 static std::unique_ptr<geom::Geometry> clip(
const geom::Geometry& geom,
87 const Rectangle& rect);
100 static std::unique_ptr<geom::Geometry> clipBoundary(
const geom::Geometry& geom,
101 const Rectangle& rect);
105 RectangleIntersection(
const geom::Geometry& geom,
const Rectangle& rect);
107 std::unique_ptr<geom::Geometry> clipBoundary();
109 std::unique_ptr<geom::Geometry> clip();
111 const geom::Geometry& _geom;
112 const Rectangle& _rect;
113 const geom::GeometryFactory* _gf;
114 const geom::CoordinateSequenceFactory* _csf;
116 void clip_geom(
const geom::Geometry* g,
117 RectangleIntersectionBuilder& parts,
118 const Rectangle& rect,
121 void clip_point(
const geom::Point* g,
122 RectangleIntersectionBuilder& parts,
123 const Rectangle& rect);
125 void clip_multipoint(
const geom::MultiPoint* g,
126 RectangleIntersectionBuilder& parts,
127 const Rectangle& rect);
129 void clip_linestring(
const geom::LineString* g,
130 RectangleIntersectionBuilder& parts,
131 const Rectangle& rect);
133 void clip_multilinestring(
const geom::MultiLineString* g,
134 RectangleIntersectionBuilder& parts,
135 const Rectangle& rect);
137 void clip_polygon(
const geom::Polygon* g,
138 RectangleIntersectionBuilder& parts,
139 const Rectangle& rect,
142 void clip_multipolygon(
const geom::MultiPolygon* g,
143 RectangleIntersectionBuilder& parts,
144 const Rectangle& rect,
147 void clip_geometrycollection(
148 const geom::GeometryCollection* g,
149 RectangleIntersectionBuilder& parts,
150 const Rectangle& rect,
153 void clip_polygon_to_linestrings(
const geom::Polygon* g,
154 RectangleIntersectionBuilder& parts,
155 const Rectangle& rect);
157 void clip_polygon_to_polygons(
const geom::Polygon* g,
158 RectangleIntersectionBuilder& parts,
159 const Rectangle& rect);
168 bool clip_linestring_parts(
const geom::LineString* gi,
169 RectangleIntersectionBuilder& parts,
170 const Rectangle& rect);
178 #endif // GEOS_OP_RECTANGLE_INTERSECTION_H