GEOS 3.14.0dev
OverlayResultValidator.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/overlay/validate/OverlayResultValidator.java rev. 1.4 (JTS-1.10)
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22#include <geos/operation/overlay/validate/FuzzyPointLocator.h> // composition
23#include <geos/geom/Location.h> // for Location::Value type
24
25#include <vector>
26
27#ifdef _MSC_VER
28#pragma warning(push)
29#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
30#endif
31
32// Forward declarations
33namespace geos {
34namespace geom {
35class Geometry;
36class Coordinate;
37}
38}
39
40namespace geos {
41namespace operation { // geos::operation
42namespace overlay { // geos::operation::overlay
43namespace validate { // geos::operation::overlay::validate
44
62class GEOS_DLL OverlayResultValidator {
63
64public:
65
66 static bool isValid(
67 const geom::Geometry& geom0,
68 const geom::Geometry& geom1,
69 int opCode,
70 const geom::Geometry& result);
71
73 const geom::Geometry& geom0,
74 const geom::Geometry& geom1,
75 const geom::Geometry& result);
76
77 bool isValid(int opCode);
78
80 getInvalidLocation()
81 {
82 return invalidLocation;
83 }
84
85private:
86
87 double boundaryDistanceTolerance;
88
89 const geom::Geometry& g0;
90
91 const geom::Geometry& g1;
92
93 const geom::Geometry& gres;
94
96
98
99 FuzzyPointLocator fplres;
100
101 geom::Coordinate invalidLocation;
102
103 std::vector<geom::Coordinate> testCoords;
104
105 void addTestPts(const geom::Geometry& g);
106
107 void addVertices(const geom::Geometry& g);
108
109 bool testValid(int overlayOp);
110
111 bool testValid(int overlayOp, const geom::Coordinate& pt);
112
113 bool isValidResult(int overlayOp, std::vector<geom::Location>& location);
114
115 static double computeBoundaryDistanceTolerance(
116 const geom::Geometry& g0, const geom::Geometry& g1);
117
118 // Declare type as noncopyable
119 OverlayResultValidator(const OverlayResultValidator& other) = delete;
120 OverlayResultValidator& operator=(const OverlayResultValidator& rhs) = delete;
121};
122
123} // namespace geos::operation::overlay::validate
124} // namespace geos::operation::overlay
125} // namespace geos::operation
126} // namespace geos
127
128#ifdef _MSC_VER
129#pragma warning(pop)
130#endif
131
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Finds the most likely Location of a point relative to the polygonal components of a geometry,...
Definition FuzzyPointLocator.h:57
Validates that the result of an overlay operation is geometrically correct within a determined tolera...
Definition OverlayResultValidator.h:62
Basic namespace for all GEOS functionalities.
Definition geos.h:39