RectangleIntersects.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
* Copyright (C) 2006 Refractions Research Inc.
*
* 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.
*
**********************************************************************
*
* Last port: operation/predicate/RectangleIntersects.java r378 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Polygon.h> // for inlines
// Forward declarations
namespace geos {
namespace geom {
class Envelope;
//class Polygon;
}
}
namespace geos {
namespace operation { // geos::operation
namespace predicate { // geos::operation::predicate
class GEOS_DLL RectangleIntersects {
private:
const geom::Polygon& rectangle;
const geom::Envelope& rectEnv;
// Declare type as noncopyable
RectangleIntersects(const RectangleIntersects& other) = delete;
RectangleIntersects& operator=(const RectangleIntersects& rhs) = delete;
public:
RectangleIntersects(const geom::Polygon& newRect)
:
rectangle(newRect),
rectEnv(*(newRect.getEnvelopeInternal()))
{}
bool intersects(const geom::Geometry& geom);
static bool
intersects(const geom::Polygon& rectangle,
const geom::Geometry& b)
{
RectangleIntersects rp(rectangle);
return rp.intersects(b);
}
};
} // namespace geos::operation::predicate
} // namespace geos::operation
} // namespace geos
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::operation::predicate::RectangleIntersects::RectangleIntersects
RectangleIntersects(const geom::Polygon &newRect)
Create a new intersects computer for a rectangle.
Definition RectangleIntersects.h:70
geos::operation::predicate::RectangleIntersects::intersects
static bool intersects(const geom::Polygon &rectangle, const geom::Geometry &b)
Tests whether a rectangle intersects a given geometry.
Definition RectangleIntersects.h:86
geos::geom
Definition Angle.h:26
geos::operation::predicate
Classes which implement topological predicates optimized for particular kinds of geometries.
Definition namespaces.h:236
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38