MonotoneChainEdge.h

00001 /**********************************************************************
00002  * $Id: MonotoneChainEdge.h 3255 2011-03-01 17:56:10Z mloskot $
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 #include <geos/export.h>
00021 #include <geos/geom/Envelope.h> // for composition
00022 
00023 #ifdef _MSC_VER
00024 #pragma warning(push)
00025 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00026 #endif
00027 
00028 // Forward declarations
00029 namespace geos {
00030         namespace geom {
00031                 class CoordinateSequence;
00032         }
00033         namespace geomgraph {
00034                 class Edge;
00035                 namespace index {
00036                         class SegmentIntersector;
00037                 }
00038         }
00039 }
00040 
00041 namespace geos {
00042 namespace geomgraph { // geos::geomgraph
00043 namespace index { // geos::geomgraph::index
00044 
00045 class GEOS_DLL MonotoneChainEdge {
00046 public:
00047         //MonotoneChainEdge();
00048         ~MonotoneChainEdge();
00049         MonotoneChainEdge(Edge *newE);
00050         const geom::CoordinateSequence* getCoordinates();
00051         std::vector<int>& getStartIndexes();
00052         double getMinX(int chainIndex);
00053         double getMaxX(int chainIndex);
00054 
00055         void computeIntersects(const MonotoneChainEdge &mce,
00056                 SegmentIntersector &si);
00057 
00058         void computeIntersectsForChain(int chainIndex0,
00059                 const MonotoneChainEdge &mce, int chainIndex1,
00060                 SegmentIntersector &si);
00061 
00062 protected:
00063         Edge *e;
00064         const geom::CoordinateSequence* pts; // cache a reference to the coord array, for efficiency
00065         // the lists of start/end indexes of the monotone chains.
00066         // Includes the end point of the edge as a sentinel
00067         std::vector<int> startIndex;
00068         // these envelopes are created once and reused
00069         geom::Envelope env1;
00070         geom::Envelope env2;
00071 private:
00072         void computeIntersectsForChain(int start0, int end0,
00073                 const MonotoneChainEdge &mce,
00074                 int start1, int end1,
00075                 SegmentIntersector &ei);
00076 };
00077 
00078 } // namespace geos.geomgraph.index
00079 } // namespace geos.geomgraph
00080 } // namespace geos
00081 
00082 #ifdef _MSC_VER
00083 #pragma warning(pop)
00084 #endif
00085 
00086 #endif
00087 
00088 /**********************************************************************
00089  * $Log$
00090  * Revision 1.1  2006/03/14 12:55:55  strk
00091  * Headers split: geomgraphindex.h, nodingSnapround.h
00092  *
00093  **********************************************************************/
00094 

Generated on 14 Mar 2013 for GEOS by  doxygen 1.4.7