GEOS
3.2.3
|
00001 /********************************************************************** 00002 * $Id: AbstractPreparedPolygonContains.h 2420 2009-04-29 08:56:14Z strk $ 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 * 00017 * Last port: geom/prep/AbstractPreparedPolygonContains.java rev 1.7 (JTS-1.10) 00018 * (2007-12-12) 00019 * 00020 **********************************************************************/ 00021 00022 #ifndef GEOS_GEOM_PREP_ABSTRACTPREPAREDPOLYGONCONTAINS_H 00023 #define GEOS_GEOM_PREP_ABSTRACTPREPAREDPOLYGONCONTAINS_H 00024 00025 #include <geos/geom/prep/PreparedPolygonPredicate.h> // inherited 00026 00027 00028 // forward declarations 00029 namespace geos { 00030 namespace geom { 00031 class Geometry; 00032 00033 namespace prep { 00034 class PreparedPolygon; 00035 } 00036 } 00037 } 00038 00039 00040 namespace geos { 00041 namespace geom { // geos::geom 00042 namespace prep { // geos::geom::prep 00043 00067 class AbstractPreparedPolygonContains : public PreparedPolygonPredicate 00068 { 00069 private: 00070 // information about geometric situation 00071 bool hasSegmentIntersection; 00072 bool hasProperIntersection; 00073 bool hasNonProperIntersection; 00074 00075 bool isProperIntersectionImpliesNotContainedSituation( const geom::Geometry * testGeom); 00076 00082 bool isSingleShell( const geom::Geometry & geom); 00083 00084 void findAndClassifyIntersections( const geom::Geometry * geom); 00085 00086 protected: 00093 bool requireSomePointInInterior; 00094 00102 bool eval( const geom::Geometry * geom); 00103 00111 virtual bool fullTopologicalPredicate( const geom::Geometry * geom) =0; 00112 00113 public: 00114 AbstractPreparedPolygonContains( const PreparedPolygon * const prepPoly) 00115 : PreparedPolygonPredicate( prepPoly), 00116 hasSegmentIntersection( false), 00117 hasProperIntersection( false), 00118 hasNonProperIntersection( false), 00119 requireSomePointInInterior(true) 00120 { } 00121 00122 AbstractPreparedPolygonContains( const PreparedPolygon * const prepPoly, bool requireSomePointInInterior) 00123 : PreparedPolygonPredicate( prepPoly), 00124 hasSegmentIntersection( false), 00125 hasProperIntersection( false), 00126 hasNonProperIntersection( false), 00127 requireSomePointInInterior(requireSomePointInInterior) 00128 { } 00129 00130 virtual ~AbstractPreparedPolygonContains() 00131 { } 00132 00133 }; 00134 00135 } // geos::geom::prep 00136 } // geos::geom 00137 } // geos 00138 00139 #endif // GEOS_GEOM_PREP_ABSTRACTPREPAREDPOLYGONCONTAINS_H 00140 /********************************************************************** 00141 * $Log$ 00142 **********************************************************************/ 00143