RelateComputer.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
* Copyright (C) 2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions 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/relate/RelateComputer.java rev. 1.24 (JTS-1.10)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/algorithm/PointLocator.h> // for RelateComputer composition
#include <geos/algorithm/LineIntersector.h> // for RelateComputer composition
#include <geos/geomgraph/NodeMap.h> // for RelateComputer composition
#include <geos/geom/Coordinate.h> // for RelateComputer composition
#include <geos/geom/IntersectionMatrix.h>
#include <vector>
#include <memory>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
#endif
// Forward declarations
namespace geos {
namespace algorithm {
class BoundaryNodeRule;
}
namespace geom {
class Geometry;
}
namespace geomgraph {
class GeometryGraph;
class Edge;
class EdgeEnd;
class Node;
namespace index {
class SegmentIntersector;
}
}
}
namespace geos {
namespace operation { // geos::operation
namespace relate { // geos::operation::relate
class GEOS_DLL RelateComputer {
public:
RelateComputer(std::vector<std::unique_ptr<geomgraph::GeometryGraph>>& newArg);
~RelateComputer() = default;
std::unique_ptr<geom::IntersectionMatrix> computeIM();
private:
algorithm::LineIntersector li;
algorithm::PointLocator ptLocator;
const std::vector<std::unique_ptr<geomgraph::GeometryGraph>>& arg;
geomgraph::NodeMap nodes;
std::unique_ptr<geom::IntersectionMatrix> im;
std::vector<geomgraph::Edge*> isolatedEdges;
geom::Coordinate invalidPoint;
void insertEdgeEnds(std::vector<std::unique_ptr<geomgraph::EdgeEnd>>& ee);
void computeProperIntersectionIM(
geomgraph::index::SegmentIntersector* intersector,
geom::IntersectionMatrix* imX);
void copyNodesAndLabels(uint8_t argIndex);
void computeIntersectionNodes(uint8_t argIndex);
void labelIntersectionNodes(uint8_t argIndex);
void computeDisjointIM(geom::IntersectionMatrix* imX,
const algorithm::BoundaryNodeRule& boundaryNodeRule);
void labelNodeEdges();
void updateIM(geom::IntersectionMatrix& imX);
static int getBoundaryDim(const geom::Geometry& geom,
const algorithm::BoundaryNodeRule& boundaryNodeRule);
void labelIsolatedEdges(uint8_t thisIndex, uint8_t targetIndex);
void labelIsolatedEdge(geomgraph::Edge* e, uint8_t targetIndex,
const geom::Geometry* target);
void labelIsolatedNodes();
void labelIsolatedNode(geomgraph::Node* n, uint8_t targetIndex);
};
} // namespace geos:operation:relate
} // namespace geos:operation
} // namespace geos
#ifdef _MSC_VER
#pragma warning(pop)
#endif
geos::algorithm::BoundaryNodeRule
An interface for rules which determine whether node points which are in boundaries of lineal geometry...
Definition BoundaryNodeRule.h:52
geos::algorithm::LineIntersector
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:53
geos::algorithm::PointLocator
Computes the topological relationship (Location) of a single point to a Geometry.
Definition PointLocator.h:56
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::IntersectionMatrix
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.
Definition IntersectionMatrix.h:51
geos::geomgraph::EdgeEnd
Models the end of an edge incident on a node.
Definition EdgeEnd.h:54
geos::geomgraph::Edge
Definition geomgraph/Edge.h:63
geos::geomgraph::GeometryGraph
A GeometryGraph is a graph that models a given Geometry.
Definition GeometryGraph.h:71
geos::geomgraph::Node
The node component of a geometry graph.
Definition geomgraph/Node.h:59
geos::geomgraph::index::SegmentIntersector
Computes the intersection of line segments, and adds the intersection to the edges containing the seg...
Definition geomgraph/index/SegmentIntersector.h:46
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos::geom
Definition Angle.h:26
geos::geomgraph::index
Contains classes that implement indexes for performing noding on geometry graph edges.
Definition geomgraph/Edge.h:53
geos::geomgraph
Contains classes that implement topology graphs.
Definition Depth.h:31
geos::operation::relate
Contains classes to implement the computation of the spatial relationships of Geometrys.
Definition namespaces.h:280
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38