GEOS 3.6.2
MonotoneChainEdge.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#ifndef GEOS_GEOMGRAPH_INDEX_MONOTONECHAINEDGE_H
17#define GEOS_GEOMGRAPH_INDEX_MONOTONECHAINEDGE_H
18
19#include <geos/export.h>
20#include <geos/geom/Envelope.h> // for composition
21
22#ifdef _MSC_VER
23#pragma warning(push)
24#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
25#endif
26
27// Forward declarations
28namespace geos {
29 namespace geom {
31 }
32 namespace geomgraph {
33 class Edge;
34 namespace index {
35 class SegmentIntersector;
36 }
37 }
38}
39
40namespace geos {
41namespace geomgraph { // geos::geomgraph
42namespace index { // geos::geomgraph::index
43
44class GEOS_DLL MonotoneChainEdge {
45public:
46 //MonotoneChainEdge();
47 ~MonotoneChainEdge();
48 MonotoneChainEdge(Edge *newE);
49 const geom::CoordinateSequence* getCoordinates();
50 std::vector<int>& getStartIndexes();
51 double getMinX(int chainIndex);
52 double getMaxX(int chainIndex);
53
54 void computeIntersects(const MonotoneChainEdge &mce,
55 SegmentIntersector &si);
56
57 void computeIntersectsForChain(int chainIndex0,
58 const MonotoneChainEdge &mce, int chainIndex1,
59 SegmentIntersector &si);
60
61protected:
62 Edge *e;
63 const geom::CoordinateSequence* pts; // cache a reference to the coord array, for efficiency
64 // the lists of start/end indexes of the monotone chains.
65 // Includes the end point of the edge as a sentinel
66 std::vector<int> startIndex;
67 // these envelopes are created once and reused
68 geom::Envelope env1;
69 geom::Envelope env2;
70private:
71 void computeIntersectsForChain(int start0, int end0,
72 const MonotoneChainEdge &mce,
73 int start1, int end1,
74 SegmentIntersector &ei);
75};
76
77} // namespace geos.geomgraph.index
78} // namespace geos.geomgraph
79} // namespace geos
80
81#ifdef _MSC_VER
82#pragma warning(pop)
83#endif
84
85#endif
86
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
Definition geomgraph/Edge.h:66
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement topology graphs.
Definition IndexedNestedRingTester.h:34
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25