GEOS 3.2.2
|
00001 /********************************************************************** 00002 * $Id: RectangleIntersects.h 2781 2009-12-03 19:48:04Z 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/predicate/RectangleIntersects.java rev 1.4 (JTS-1.10) 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef GEOS_OP_PREDICATE_RECTANGLEINTERSECTS_H 00021 #define GEOS_OP_PREDICATE_RECTANGLEINTERSECTS_H 00022 00023 #include <geos/export.h> 00024 00025 #include <geos/geom/Polygon.h> // for inlines 00026 00027 // Forward declarations 00028 namespace geos { 00029 namespace geom { 00030 class Envelope; 00031 //class Polygon; 00032 } 00033 } 00034 00035 namespace geos { 00036 namespace operation { // geos::operation 00037 namespace predicate { // geos::operation::predicate 00038 00048 class GEOS_DLL RectangleIntersects { 00049 00050 private: 00051 00052 const geom::Polygon &rectangle; 00053 00054 const geom::Envelope &rectEnv; 00055 00056 // Declare type as noncopyable 00057 RectangleIntersects(const RectangleIntersects& other); 00058 RectangleIntersects& operator=(const RectangleIntersects& rhs); 00059 00060 public: 00061 00069 static const size_t MAXIMUM_SCAN_SEGMENT_COUNT; 00070 00076 RectangleIntersects(const geom::Polygon &newRect) 00077 : 00078 rectangle(newRect), 00079 rectEnv(*(newRect.getEnvelopeInternal())) 00080 {} 00081 00082 bool intersects(const geom::Geometry& geom); 00083 00084 static bool intersects(const geom::Polygon &rectangle, 00085 const geom::Geometry &b) 00086 { 00087 RectangleIntersects rp(rectangle); 00088 return rp.intersects(b); 00089 } 00090 00091 }; 00092 00093 00094 } // namespace geos::operation::predicate 00095 } // namespace geos::operation 00096 } // namespace geos 00097 00098 #endif // ifndef GEOS_OP_PREDICATE_RECTANGLEINTERSECTS_H