RectangleIntersectionBuilder.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>
#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
#include <memory>
#include <list>
#include <vector>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
class CoordinateSequence;
class Geometry;
class GeometryFactory;
class Polygon;
class LineString;
class Point;
}
namespace operation {
namespace intersection {
class Rectangle;
}
}
}
namespace geos {
namespace operation { // geos::operation
namespace intersection { // geos::operation::intersection
class GEOS_DLL RectangleIntersectionBuilder {
// Regular users are not supposed to use this utility class.
friend class RectangleIntersection;
public:
~RectangleIntersectionBuilder();
private:
std::unique_ptr<geom::Geometry> build();
void reconnectPolygons(const Rectangle& rect);
void reconnect();
void reverseLines();
void release(RectangleIntersectionBuilder& parts);
// Adding Geometry components
void add(geom::Polygon* g);
void add(geom::LineString* g);
void add(geom::Point* g);
// Trivial methods
bool empty() const;
void clear();
// Added components
std::list<geom::Polygon*> polygons;
std::list<geom::LineString*> lines;
std::list<geom::Point*> points;
void close_boundary(
const Rectangle& rect,
geom::CoordinateSequence* ring,
double x1, double y1,
double x2, double y2);
void close_ring(const Rectangle& rect, geom::CoordinateSequence* ring);
RectangleIntersectionBuilder(const geom::GeometryFactory& f)
: _gf(f) {}
const geom::GeometryFactory& _gf;
}; // class RectangleIntersectionBuilder
} // namespace geos::operation::intersection
} // namespace geos::operation
} // namespace geos
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
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::Point
Definition Point.h:61
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
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