GEOS 3.9.1
HCoordinate.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7 * Copyright (C) 2005-2006 Refractions Research Inc.
8 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************
16 *
17 * Last port: algorithm/HCoordinate.java r386 (JTS-1.12+)
18 *
19 **********************************************************************/
20
21#ifndef GEOS_ALGORITHM_HCOORDINATE_H
22#define GEOS_ALGORITHM_HCOORDINATE_H
23
24#include <geos/export.h>
25#include <iosfwd>
26
27// Forward declarations
28namespace geos {
29namespace geom {
30class Coordinate;
31}
32}
33
34namespace geos {
35namespace algorithm { // geos::algorithm
36
37
44class GEOS_DLL HCoordinate {
45
46public:
47
48 friend std::ostream& operator<< (std::ostream& o, const HCoordinate& c);
49
60 static void intersection(const geom::Coordinate& p1,
61 const geom::Coordinate& p2,
62 const geom::Coordinate& q1,
63 const geom::Coordinate& q2,
64 geom::Coordinate& ret);
65
66 double x, y, w;
67
69
70 HCoordinate(double _x, double _y, double _w);
71
73
83
85 const geom::Coordinate& q1, const geom::Coordinate& q2);
86
87 HCoordinate(const HCoordinate& p1, const HCoordinate& p2);
88
89 double getX() const;
90
91 double getY() const;
92
93 void getCoordinate(geom::Coordinate& ret) const;
94
95};
96
97std::ostream& operator<< (std::ostream& o, const HCoordinate& c);
98
99} // namespace geos::algorithm
100} // namespace geos
101
102#endif // GEOS_ALGORITHM_HCOORDINATE_H
103
Represents a homogeneous coordinate in a 2-D coordinate space.
Definition HCoordinate.h:44
HCoordinate(const geom::Coordinate &p1, const geom::Coordinate &p2)
Constructs a homogeneous coordinate which is the intersection of the lines define by the homogenous c...
static void intersection(const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q1, const geom::Coordinate &q2, geom::Coordinate &ret)
Computes the (approximate) intersection point between two line segments using homogeneous coordinates...
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26