GEOS 3.14.0dev
algorithm/Rectangle.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2023 Paul Ramsey <pramsey@cleverelephant.ca>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************/
14
15#pragma once
16
17#include <geos/export.h>
18#include <geos/geom/LineSegment.h>
19
20// Forward declarations
21namespace geos {
22namespace geom {
23class Coordinate;
24class GeometryFactory;
25class Polygon;
26}
27}
28
29namespace geos {
30namespace algorithm {
31
32class GEOS_DLL Rectangle {
33 using CoordinateXY = geos::geom::CoordinateXY;
34 using GeometryFactory = geos::geom::GeometryFactory;
35 using LineSegment = geos::geom::LineSegment;
36 using Polygon = geos::geom::Polygon;
37
38public:
39
63 static std::unique_ptr<Polygon>
64 createFromSidePts(
65 const CoordinateXY& baseRightPt,
66 const CoordinateXY& baseLeftPt,
67 const CoordinateXY& oppositePt,
68 const CoordinateXY& leftSidePt,
69 const CoordinateXY& rightSidePt,
70 const GeometryFactory* factory);
71
72private:
73
83 static double
84 computeLineEquationC(double a, double b, const CoordinateXY& p);
85
86 static LineSegment
87 createLineForStandardEquation(double a, double b, double c);
88
89};
90
91
92} // namespace geos::algorithm
93} // namespace geos
94
95
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
Definition LineSegment.h:61
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
Basic namespace for all GEOS functionalities.
Definition geos.h:39