GEOS 3.14.0dev
EdgeSegmentIntersector.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (c) 2024 Martin Davis
7 * Copyright (C) 2024 Paul Ramsey <pramsey@cleverelephant.ca>
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#pragma once
17
18
19#include <geos/noding/SegmentIntersector.h>
20#include <geos/algorithm/LineIntersector.h>
21#include <geos/export.h>
22
23
24// Forward declarations
25namespace geos {
26namespace noding {
27 class SegmentString;
28}
29namespace operation {
30namespace relateng {
31 class RelateSegmentString;
32 class TopologyComputer;
33}
34}
35}
36
37namespace geos { // geos.
38namespace operation { // geos.operation
39namespace relateng { // geos.operation.relateng
40
41class GEOS_DLL EdgeSegmentIntersector : public geos::noding::SegmentIntersector {
42 using SegmentString = geos::noding::SegmentString;
43 using LineIntersector = geos::algorithm::LineIntersector;
44
45private:
46
47 // Members
48 LineIntersector li;
49 TopologyComputer& topoComputer;
50
51 // Methods
52
53
54 void addIntersections(
55 RelateSegmentString* ssA, std::size_t segIndexA,
56 RelateSegmentString* ssB, std::size_t segIndexB);
57
58
59public:
60
61 EdgeSegmentIntersector(TopologyComputer& p_topoComputer)
62 : topoComputer(p_topoComputer)
63 {};
64
65 void processIntersections(
66 SegmentString* ss0, std::size_t segIndex0,
67 SegmentString* ss1, std::size_t segIndex1) override;
68
69 bool isDone() const override;
70
71};
72
73} // namespace geos.operation.relateng
74} // namespace geos.operation
75} // namespace geos
76
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:53
Processes possible intersections detected by a Noder.
Definition noding/SegmentIntersector.h:45
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:47
Basic namespace for all GEOS functionalities.
Definition geos.h:39