RectangleIntersection.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2014 Mika Heiskanen <mika.heiskanen@fmi.fi>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <memory>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
#endif
// Forward declarations
namespace geos {
namespace geom {
class Point;
class MultiPoint;
class Polygon;
class MultiPolygon;
class LineString;
class MultiLineString;
class Geometry;
class GeometryCollection;
class GeometryFactory;
}
namespace operation {
namespace intersection {
class Rectangle;
class RectangleIntersectionBuilder;
}
}
}
namespace geos {
namespace operation { // geos::operation
namespace intersection { // geos::operation::intersection
class GEOS_DLL RectangleIntersection {
public:
static std::unique_ptr<geom::Geometry> clip(const geom::Geometry& geom,
const Rectangle& rect);
static std::unique_ptr<geom::Geometry> clipBoundary(const geom::Geometry& geom,
const Rectangle& rect);
private:
RectangleIntersection(const geom::Geometry& geom, const Rectangle& rect);
std::unique_ptr<geom::Geometry> clipBoundary();
std::unique_ptr<geom::Geometry> clip();
const geom::Geometry& _geom;
const Rectangle& _rect;
const geom::GeometryFactory* _gf;
void clip_geom(const geom::Geometry* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect,
bool keep_polygons);
void clip_point(const geom::Point* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect);
void clip_multipoint(const geom::MultiPoint* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect);
void clip_linestring(const geom::LineString* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect);
void clip_multilinestring(const geom::MultiLineString* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect);
void clip_polygon(const geom::Polygon* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect,
bool keep_polygons);
void clip_multipolygon(const geom::MultiPolygon* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect,
bool keep_polygons);
void clip_geometrycollection(
const geom::GeometryCollection* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect,
bool keep_polygons);
void clip_polygon_to_linestrings(const geom::Polygon* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect);
void clip_polygon_to_polygons(const geom::Polygon* g,
RectangleIntersectionBuilder& parts,
const Rectangle& rect);
bool clip_linestring_parts(const geom::LineString* gi,
RectangleIntersectionBuilder& parts,
const Rectangle& rect);
}; // class RectangleIntersection
} // namespace geos::operation::intersection
} // namespace geos::operation
} // namespace geos
geos::geom::GeometryCollection
Represents a collection of heterogeneous Geometry objects.
Definition GeometryCollection.h:51
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::LineString
Definition LineString.h:66
geos::geom::MultiLineString
Models a collection of LineStrings.
Definition MultiLineString.h:49
geos::geom::MultiPoint
Definition MultiPoint.h:50
geos::geom::MultiPolygon
Definition MultiPolygon.h:58
geos::geom::Point
Definition Point.h:61
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::operation::intersection::RectangleIntersectionBuilder
Rebuild geometries from subpaths left by clipping with a rectangle.
Definition RectangleIntersectionBuilder.h:63
geos::operation::intersection::RectangleIntersection::clipBoundary
static std::unique_ptr< geom::Geometry > clipBoundary(const geom::Geometry &geom, const Rectangle &rect)
Clip boundary of a geometry with a rectangle.
geos::operation::intersection::RectangleIntersection::clip
static std::unique_ptr< geom::Geometry > clip(const geom::Geometry &geom, const Rectangle &rect)
Clip geometry with a rectangle.
geos::operation::intersection::Rectangle
Clipping rectangle.
Definition operation/intersection/Rectangle.h:51
geos::geom
Definition Angle.h:26
geos::operation::intersection
Provides classes for computing the intersection of a Geometry and a clipping Rectangle.
Definition namespaces.h:189
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38