GEOS 3.13.0beta1
TopologyPredicate.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#include <geos/geom/Location.h>
19#include <geos/export.h>
20
21
22// Forward declarations
23namespace geos {
24namespace geom {
25 class Envelope;
26}
27}
28
29
32
33
34namespace geos { // geos.
35namespace operation { // geos.operation
36namespace relateng { // geos.operation.relateng
37
38
39class GEOS_DLL TopologyPredicate {
40
41public:
42
43 /* Virtual destructor to ensure proper cleanup of derived classes */
44 virtual ~TopologyPredicate() {};
45
51 virtual std::string name() const = 0;
52
57 virtual void finish() = 0;
58
64 virtual bool isKnown() const = 0;
65
72 virtual bool value() const = 0;
73
90 virtual bool requireSelfNoding() const {
91 return true;
92 };
93
106 virtual bool requireInteraction() const {
107 return true;
108 };
109
123 virtual bool requireCovers(bool isSourceA) {
124 (void)isSourceA;
125 return false;
126 }
127
140 virtual bool requireExteriorCheck(bool isSourceA) const {
141 (void)isSourceA;
142 return true;
143 }
144
155 virtual void init(int dimA, int dimB) {
156 (void)dimA;
157 (void)dimB;
158 };
159
168 virtual void init(const Envelope& envA, const Envelope& envB)
169 {
170 //-- default if envelopes provide no information
171 (void)envA;
172 (void)envB;
173 };
174
191 virtual void updateDimension(Location locA, Location locB, int dimension) = 0;
192
193
194 friend std::ostream&
195 operator<<(std::ostream& os, const TopologyPredicate& ns)
196 {
197 os << ns.name();
198 return os;
199 }
200
201};
202
203} // namespace geos.operation.relateng
204} // namespace geos.operation
205} // namespace geos
206
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
Basic namespace for all GEOS functionalities.
Definition geos.h:39