GeometryLocation.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: operation/distance/GeometryLocation.java rev. 1.7 (JTS-1.10)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Coordinate.h> // for composition
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
}
}
namespace geos {
namespace operation { // geos::operation
namespace distance { // geos::operation::distance
class GEOS_DLL GeometryLocation {
private:
const geom::Geometry* component;
std::size_t segIndex;
bool inside_area;
geom::CoordinateXY pt;
public:
static const int INSIDE_AREA = -1;
GeometryLocation() :
component(nullptr),
segIndex(0),
inside_area(false),
pt()
{}
GeometryLocation(const geom::Geometry* component,
std::size_t segIndex, const geom::CoordinateXY& pt);
GeometryLocation(const geom::Geometry* component,
const geom::CoordinateXY& pt);
const geom::Geometry* getGeometryComponent();
std::size_t getSegmentIndex();
geom::CoordinateXY& getCoordinate();
bool isInsideArea();
std::string toString();
};
} // namespace geos::operation::distance
} // namespace geos::operation
} // namespace geos
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::operation::distance::GeometryLocation::getSegmentIndex
std::size_t getSegmentIndex()
geos::operation::distance::GeometryLocation::getCoordinate
geom::CoordinateXY & getCoordinate()
geos::operation::distance::GeometryLocation::isInsideArea
bool isInsideArea()
Tests whether this location represents a point inside an area geometry.
geos::operation::distance::GeometryLocation::GeometryLocation
GeometryLocation(const geom::Geometry *component, const geom::CoordinateXY &pt)
Constructs a GeometryLocation specifying a point inside an area geometry.
geos::operation::distance::GeometryLocation::GeometryLocation
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...
geos::operation::distance::GeometryLocation::INSIDE_AREA
static const int INSIDE_AREA
A Special value of segmentIndex used for locations inside area geometries.
Definition GeometryLocation.h:63
geos::operation::distance::GeometryLocation::getGeometryComponent
const geom::Geometry * getGeometryComponent()
geos::geom
Definition Angle.h:26
geos::operation::distance
Provides classes for computing the distance between geometries.
Definition namespaces.h:185
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38