GEOS
3.3.8
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.refractions.net 00005 * 00006 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net> 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 r378 (JTS-1.12) 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 00052 class GEOS_DLL RectangleIntersects { 00053 00054 private: 00055 00056 const geom::Polygon &rectangle; 00057 00058 const geom::Envelope &rectEnv; 00059 00060 // Declare type as noncopyable 00061 RectangleIntersects(const RectangleIntersects& other); 00062 RectangleIntersects& operator=(const RectangleIntersects& rhs); 00063 00064 public: 00065 00071 RectangleIntersects(const geom::Polygon &newRect) 00072 : 00073 rectangle(newRect), 00074 rectEnv(*(newRect.getEnvelopeInternal())) 00075 {} 00076 00077 bool intersects(const geom::Geometry& geom); 00078 00086 static bool intersects(const geom::Polygon &rectangle, 00087 const geom::Geometry &b) 00088 { 00089 RectangleIntersects rp(rectangle); 00090 return rp.intersects(b); 00091 } 00092 00093 }; 00094 00095 00096 } // namespace geos::operation::predicate 00097 } // namespace geos::operation 00098 } // namespace geos 00099 00100 #endif // ifndef GEOS_OP_PREDICATE_RECTANGLEINTERSECTS_H