Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

RectangleIntersects.h

00001 /**********************************************************************
00002  * $Id: RectangleIntersects.h 2570 2009-06-08 17:15:46Z 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  * 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 public:
00057 
00065         static const size_t MAXIMUM_SCAN_SEGMENT_COUNT;
00066 
00072         RectangleIntersects(const geom::Polygon &newRect)
00073                 :
00074                 rectangle(newRect),
00075                 rectEnv(*(newRect.getEnvelopeInternal()))
00076         {}
00077 
00078         bool intersects(const geom::Geometry& geom);
00079 
00080         static bool intersects(const geom::Polygon &rectangle,
00081                         const geom::Geometry &b)
00082         {
00083                 RectangleIntersects rp(rectangle); 
00084                 return rp.intersects(b);
00085         }
00086 
00087 };
00088 
00089 
00090 } // namespace geos::operation::predicate
00091 } // namespace geos::operation
00092 } // namespace geos
00093 
00094 #endif // ifndef GEOS_OP_PREDICATE_RECTANGLEINTERSECTS_H

Generated on Thu Jun 11 06:17:01 2009 for GEOS by  doxygen 1.4.4