00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00022 #define GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00023
00024 #include <geos/operation/overlay/OverlayOp.h>
00025 #include <geos/operation/overlay/FuzzyPointLocator.h>
00026 #include <geos/geom/Location.h>
00027
00028 #include <vector>
00029
00030
00031 namespace geos {
00032 namespace geom {
00033 class Geometry;
00034 class Coordinate;
00035 }
00036 }
00037
00038 namespace geos {
00039 namespace operation {
00040 namespace overlay {
00041
00055 class OverlayResultValidator {
00056
00057 public:
00058
00059 static bool isValid(
00060 const geom::Geometry& geom0,
00061 const geom::Geometry& geom1,
00062 OverlayOp::OpCode opCode,
00063 const geom::Geometry& result);
00064
00065 OverlayResultValidator(
00066 const geom::Geometry& geom0,
00067 const geom::Geometry& geom1,
00068 const geom::Geometry& result);
00069
00070 bool isValid(OverlayOp::OpCode opCode);
00071
00072 geom::Coordinate& getInvalidLocation() {
00073 return invalidLocation;
00074 }
00075
00076 private:
00077
00078 const geom::Geometry& g0;
00079
00080 const geom::Geometry& g1;
00081
00082 const geom::Geometry& gres;
00083
00084 FuzzyPointLocator fpl0;
00085
00086 FuzzyPointLocator fpl1;
00087
00088 FuzzyPointLocator fplres;
00089
00090 geom::Coordinate invalidLocation;
00091
00092 static double _TOLERANCE;
00093
00094 std::vector<geom::Coordinate> testCoords;
00095
00096 void addTestPts(const geom::Geometry& g);
00097
00098 void addVertices(const geom::Geometry& g);
00099
00100 bool testValid(OverlayOp::OpCode overlayOp);
00101
00102 bool testValid(OverlayOp::OpCode overlayOp, const geom::Coordinate& pt);
00103
00104 bool isValidResult(OverlayOp::OpCode overlayOp,
00105 std::vector<geom::Location::Value>& location);
00106 };
00107
00108 }
00109 }
00110 }
00111
00112 #endif // ndef GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00113
00114
00115
00116
00117