GEOS  3.13.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
21 namespace geos {
22 namespace geom {
23 class Coordinate;
24 class GeometryFactory;
25 class Polygon;
26 }
27 }
28 
29 using geos::geom::CoordinateXY;
33 
34 namespace geos {
35 namespace algorithm {
36 
37 class GEOS_DLL Rectangle {
38 
39 public:
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 
73 private:
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:65
Definition: LineSegment.h:61
Represents a linear polygon, which may include holes.
Definition: Polygon.h:60
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25