algorithm/Rectangle.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2023 Paul Ramsey <pramsey@cleverelephant.ca>
*
* 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 <geos/geom/LineSegment.h>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
class GeometryFactory;
class Polygon;
}
}
namespace geos {
namespace algorithm {
class GEOS_DLL Rectangle {
using CoordinateXY = geos::geom::CoordinateXY;
using GeometryFactory = geos::geom::GeometryFactory;
using LineSegment = geos::geom::LineSegment;
using Polygon = geos::geom::Polygon;
public:
static std::unique_ptr<Polygon>
createFromSidePts(
const CoordinateXY& baseRightPt,
const CoordinateXY& baseLeftPt,
const CoordinateXY& oppositePt,
const CoordinateXY& leftSidePt,
const CoordinateXY& rightSidePt,
const GeometryFactory* factory);
private:
static double
computeLineEquationC(double a, double b, const CoordinateXY& p);
static LineSegment
createLineForStandardEquation(double a, double b, double c);
};
} // namespace geos::algorithm
} // namespace geos
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::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos::geom
Definition Angle.h:26
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38