GEOS 3.14.0dev
GeometryLocation.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
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 * Last port: operation/distance/GeometryLocation.java rev. 1.7 (JTS-1.10)
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22
23#include <geos/geom/Coordinate.h> // for composition
24
25// Forward declarations
26namespace geos {
27namespace geom {
28class Geometry;
29}
30}
31
32
33namespace geos {
34namespace operation { // geos::operation
35namespace distance { // geos::operation::distance
36
37
49class GEOS_DLL GeometryLocation {
50private:
51 const geom::Geometry* component;
52 std::size_t segIndex;
53 bool inside_area;
54 geom::CoordinateXY pt;
55public:
63 static const int INSIDE_AREA = -1;
64
66 component(nullptr),
67 segIndex(0),
68 inside_area(false),
69 pt()
70 {}
71
82 std::size_t segIndex, const geom::CoordinateXY& pt);
83
92 const geom::CoordinateXY& pt);
93
98
107 std::size_t getSegmentIndex();
108
112 geom::CoordinateXY& getCoordinate();
113
119
120 std::string toString();
121};
122
123} // namespace geos::operation::distance
124} // namespace geos::operation
125} // namespace geos
126
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Represents the location of a point on a Geometry.
Definition GeometryLocation.h:49
bool isInsideArea()
Tests whether this location represents a point inside an area geometry.
GeometryLocation(const geom::Geometry *component, const geom::CoordinateXY &pt)
Constructs a GeometryLocation specifying a point inside an area geometry.
GeometryLocation(const geom::Geometry *component, std::size_t segIndex, const geom::CoordinateXY &pt)
Constructs a GeometryLocation specifying a point on a geometry, as well as the segment that the point...
const geom::Geometry * getGeometryComponent()
Basic namespace for all GEOS functionalities.
Definition geos.h:39