00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00021 #define GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00022
00023 #include <geos/export.h>
00024 #include <geos/operation/overlay/OverlayOp.h>
00025 #include <geos/operation/overlay/validate/FuzzyPointLocator.h>
00026 #include <geos/geom/Location.h>
00027
00028 #include <vector>
00029
00030 #ifdef _MSC_VER
00031 #pragma warning(push)
00032 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00033 #endif
00034
00035
00036 namespace geos {
00037 namespace geom {
00038 class Geometry;
00039 class Coordinate;
00040 }
00041 }
00042
00043 namespace geos {
00044 namespace operation {
00045 namespace overlay {
00046 namespace validate {
00047
00065 class GEOS_DLL OverlayResultValidator {
00066
00067 public:
00068
00069 static bool isValid(
00070 const geom::Geometry& geom0,
00071 const geom::Geometry& geom1,
00072 OverlayOp::OpCode opCode,
00073 const geom::Geometry& result);
00074
00075 OverlayResultValidator(
00076 const geom::Geometry& geom0,
00077 const geom::Geometry& geom1,
00078 const geom::Geometry& result);
00079
00080 bool isValid(OverlayOp::OpCode opCode);
00081
00082 geom::Coordinate& getInvalidLocation() {
00083 return invalidLocation;
00084 }
00085
00086 private:
00087
00088 double boundaryDistanceTolerance;
00089
00090 const geom::Geometry& g0;
00091
00092 const geom::Geometry& g1;
00093
00094 const geom::Geometry& gres;
00095
00096 FuzzyPointLocator fpl0;
00097
00098 FuzzyPointLocator fpl1;
00099
00100 FuzzyPointLocator fplres;
00101
00102 geom::Coordinate invalidLocation;
00103
00104 std::vector<geom::Coordinate> testCoords;
00105
00106 void addTestPts(const geom::Geometry& g);
00107
00108 void addVertices(const geom::Geometry& g);
00109
00110 bool testValid(OverlayOp::OpCode overlayOp);
00111
00112 bool testValid(OverlayOp::OpCode overlayOp, const geom::Coordinate& pt);
00113
00114 bool isValidResult(OverlayOp::OpCode overlayOp,
00115 std::vector<geom::Location::Value>& location);
00116
00117 static double computeBoundaryDistanceTolerance(
00118 const geom::Geometry& g0, const geom::Geometry& g1);
00119
00120
00121 OverlayResultValidator(const OverlayResultValidator& other);
00122 OverlayResultValidator& operator=(const OverlayResultValidator& rhs);
00123 };
00124
00125 }
00126 }
00127 }
00128 }
00129
00130 #ifdef _MSC_VER
00131 #pragma warning(pop)
00132 #endif
00133
00134 #endif // ndef GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00135
00136
00137
00138
00139