GEOS 3.6.2
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#ifndef GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
20#define GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
21
22#include <geos/export.h>
23#include <geos/operation/overlay/OverlayOp.h> // for OpCode enum
24#include <geos/operation/overlay/validate/FuzzyPointLocator.h> // composition
25#include <geos/geom/Location.h> // for Location::Value type
26
27#include <vector>
28
29#ifdef _MSC_VER
30#pragma warning(push)
31#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
32#endif
33
34// Forward declarations
35namespace geos {
36 namespace geom {
37 class Geometry;
38 class Coordinate;
39 }
40}
41
42namespace geos {
43namespace operation { // geos::operation
44namespace overlay { // geos::operation::overlay
45namespace validate { // geos::operation::overlay::validate
46
64class GEOS_DLL OverlayResultValidator {
65
66public:
67
68 static bool isValid(
69 const geom::Geometry& geom0,
70 const geom::Geometry& geom1,
71 OverlayOp::OpCode opCode,
72 const geom::Geometry& result);
73
74 OverlayResultValidator(
75 const geom::Geometry& geom0,
76 const geom::Geometry& geom1,
77 const geom::Geometry& result);
78
79 bool isValid(OverlayOp::OpCode opCode);
80
81 geom::Coordinate& getInvalidLocation() {
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(OverlayOp::OpCode overlayOp);
110
111 bool testValid(OverlayOp::OpCode overlayOp, const geom::Coordinate& pt);
112
113 bool isValidResult(OverlayOp::OpCode overlayOp,
114 std::vector<geom::Location::Value>& location);
115
116 static double computeBoundaryDistanceTolerance(
117 const geom::Geometry& g0, const geom::Geometry& g1);
118
119 // Declare type as noncopyable
120 OverlayResultValidator(const OverlayResultValidator& other);
121 OverlayResultValidator& operator=(const OverlayResultValidator& rhs);
122};
123
124} // namespace geos::operation::overlay::validate
125} // namespace geos::operation::overlay
126} // namespace geos::operation
127} // namespace geos
128
129#ifdef _MSC_VER
130#pragma warning(pop)
131#endif
132
133#endif // ndef GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
OpCode
The spatial functions supported by this class.
Definition OverlayOp.h:77
Finds the most likely Location of a point relative to the polygonal components of a geometry,...
Definition FuzzyPointLocator.h:58
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that perform a topological overlay to compute boolean spatial functions.
Definition BufferBuilder.h:62
Provides classes for implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25
OverlayOp::overlayOp Adapter for use with geom::BinaryOp.
Definition OverlayOp.h:376