• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

OverlayResultValidator.h

00001 /**********************************************************************
00002  * $Id: OverlayResultValidator.h 2780 2009-12-03 19:46:43Z mloskot $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2006 Refractions Research Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  ***********************************************************************
00015  *
00016  * Last port: operation/overlay/validate/OverlayResultValidator.java rev. 1.4 (JTS-1.10)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00021 #define GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00022 
00023 #include <geos/operation/overlay/OverlayOp.h> // for OpCode enum
00024 #include <geos/operation/overlay/validate/FuzzyPointLocator.h> // composition
00025 #include <geos/geom/Location.h> // for Location::Value type
00026 
00027 #include <vector>
00028 
00029 // Forward declarations
00030 namespace geos {
00031         namespace geom {
00032                 class Geometry;
00033                 class Coordinate;
00034         }
00035 }
00036 
00037 namespace geos {
00038 namespace operation { // geos::operation
00039 namespace overlay { // geos::operation::overlay
00040 namespace validate { // geos::operation::overlay::validate
00041 
00059 class OverlayResultValidator {
00060 
00061 public:
00062 
00063         static bool isValid(
00064                         const geom::Geometry& geom0,
00065                         const geom::Geometry& geom1,
00066                         OverlayOp::OpCode opCode,
00067                         const geom::Geometry& result);
00068 
00069         OverlayResultValidator(
00070                         const geom::Geometry& geom0,
00071                         const geom::Geometry& geom1,
00072                         const geom::Geometry& result);
00073 
00074         bool isValid(OverlayOp::OpCode opCode);
00075 
00076         geom::Coordinate& getInvalidLocation() {
00077                 return invalidLocation;
00078         }
00079 
00080 private:
00081 
00082         double boundaryDistanceTolerance;
00083 
00084         const geom::Geometry& g0;
00085 
00086         const geom::Geometry& g1;
00087 
00088         const geom::Geometry& gres;
00089 
00090         FuzzyPointLocator fpl0;
00091 
00092         FuzzyPointLocator fpl1;
00093 
00094         FuzzyPointLocator fplres;
00095 
00096         geom::Coordinate invalidLocation;
00097 
00098         std::vector<geom::Coordinate> testCoords;
00099 
00100         void addTestPts(const geom::Geometry& g);
00101 
00102         void addVertices(const geom::Geometry& g);
00103 
00104         bool testValid(OverlayOp::OpCode overlayOp);
00105 
00106         bool testValid(OverlayOp::OpCode overlayOp, const geom::Coordinate& pt);
00107 
00108         bool isValidResult(OverlayOp::OpCode overlayOp,
00109                         std::vector<geom::Location::Value>& location);
00110 
00111         static double computeBoundaryDistanceTolerance(
00112                 const geom::Geometry& g0, const geom::Geometry& g1);
00113 
00114     // Declare type as noncopyable
00115     OverlayResultValidator(const OverlayResultValidator& other);
00116     OverlayResultValidator& operator=(const OverlayResultValidator& rhs);
00117 };
00118 
00119 } // namespace geos::operation::overlay::validate
00120 } // namespace geos::operation::overlay
00121 } // namespace geos::operation
00122 } // namespace geos
00123 
00124 #endif // ndef GEOS_OP_OVERLAY_OVERLAYRESULTVALIDATOR_H
00125 
00126 /**********************************************************************
00127  * $Log$
00128  **********************************************************************/
00129 

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1