GEOS 3.2.1
|
00001 /********************************************************************** 00002 * $Id: MonotoneChainEdge.h 2556 2009-06-06 22:22:28Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 **********************************************************************/ 00016 00017 #ifndef GEOS_GEOMGRAPH_INDEX_MONOTONECHAINEDGE_H 00018 #define GEOS_GEOMGRAPH_INDEX_MONOTONECHAINEDGE_H 00019 00020 00021 #include <geos/export.h> 00022 #include <geos/geom/Envelope.h> // for composition 00023 00024 // Forward declarations 00025 namespace geos { 00026 namespace geom { 00027 class CoordinateSequence; 00028 } 00029 namespace geomgraph { 00030 class Edge; 00031 namespace index { 00032 class SegmentIntersector; 00033 } 00034 } 00035 } 00036 00037 namespace geos { 00038 namespace geomgraph { // geos::geomgraph 00039 namespace index { // geos::geomgraph::index 00040 00041 class GEOS_DLL MonotoneChainEdge { 00042 public: 00043 //MonotoneChainEdge(); 00044 ~MonotoneChainEdge(); 00045 MonotoneChainEdge(Edge *newE); 00046 const geom::CoordinateSequence* getCoordinates(); 00047 std::vector<int>& getStartIndexes(); 00048 double getMinX(int chainIndex); 00049 double getMaxX(int chainIndex); 00050 00051 void computeIntersects(const MonotoneChainEdge &mce, 00052 SegmentIntersector &si); 00053 00054 void computeIntersectsForChain(int chainIndex0, 00055 const MonotoneChainEdge &mce, int chainIndex1, 00056 SegmentIntersector &si); 00057 00058 protected: 00059 Edge *e; 00060 const geom::CoordinateSequence* pts; // cache a reference to the coord array, for efficiency 00061 // the lists of start/end indexes of the monotone chains. 00062 // Includes the end point of the edge as a sentinel 00063 std::vector<int> startIndex; 00064 // these envelopes are created once and reused 00065 geom::Envelope env1; 00066 geom::Envelope env2; 00067 private: 00068 void computeIntersectsForChain(int start0, int end0, 00069 const MonotoneChainEdge &mce, 00070 int start1, int end1, 00071 SegmentIntersector &ei); 00072 }; 00073 00074 00075 00076 } // namespace geos.geomgraph.index 00077 } // namespace geos.geomgraph 00078 } // namespace geos 00079 00080 #endif 00081 00082 /********************************************************************** 00083 * $Log$ 00084 * Revision 1.1 2006/03/14 12:55:55 strk 00085 * Headers split: geomgraphindex.h, nodingSnapround.h 00086 * 00087 **********************************************************************/ 00088