GEOS 3.13.1
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
29using geos::geom::CoordinateXY;
33
34namespace geos {
35namespace algorithm {
36
37class GEOS_DLL Rectangle {
38
39public:
40
64 static std::unique_ptr<Polygon>
65 createFromSidePts(
66 const CoordinateXY& baseRightPt,
67 const CoordinateXY& baseLeftPt,
68 const CoordinateXY& oppositePt,
69 const CoordinateXY& leftSidePt,
70 const CoordinateXY& rightSidePt,
71 const GeometryFactory* factory);
72
73private:
74
84 static double
85 computeLineEquationC(double a, double b, const CoordinateXY& p);
86
87 static LineSegment
88 createLineForStandardEquation(double a, double b, double c);
89
90};
91
92
93} // namespace geos::algorithm
94} // namespace geos
95
96
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