GEOS 3.6.2
MCPointInRing.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_ALGORITHM_MCPOINTINRING_H
17#define GEOS_ALGORITHM_MCPOINTINRING_H
18
19#include <geos/export.h>
20#include <geos/index/chain/MonotoneChainSelectAction.h> // for inheritance
21#include <geos/algorithm/PointInRing.h> // for inheritance
22#include <geos/geom/Coordinate.h> // for composition
23#include <geos/index/bintree/Interval.h> // for composition
24
25#include <vector>
26
27// Forward declarations
28namespace geos {
29 namespace geom {
30 class Coordinate;
31 class LineSegment;
32 class LinearRing;
35 }
36 namespace index {
37 namespace bintree {
38 class Bintree;
39 class Interval;
40 }
41 namespace chain {
42 class MonotoneChain;
43 }
44 }
45}
46
47namespace geos {
48namespace algorithm { // geos::algorithm
49
50class GEOS_DLL MCPointInRing: public PointInRing {
51public:
52 MCPointInRing(const geom::LinearRing *newRing);
53 ~MCPointInRing();
54 bool isInside(const geom::Coordinate& pt);
55
56 void testLineSegment(const geom::Coordinate& p,
57 const geom::LineSegment& seg);
58
59 class MCSelecter: public index::chain::MonotoneChainSelectAction {
60 using MonotoneChainSelectAction::select;
61 private:
62 geom::Coordinate p;
63 MCPointInRing *parent;
64 public:
65 MCSelecter(const geom::Coordinate& newP, MCPointInRing *prt);
66 void select(const geom::LineSegment& ls);
67 };
68
69private:
70 const geom::LinearRing *ring;
71 index::bintree::Interval interval;
72 geom::CoordinateSequence *pts;
73 index::bintree::Bintree *tree;
74 int crossings; // number of segment/ray crossings
75 void buildIndex();
76 void testMonotoneChain(geom::Envelope *rayEnv,
77 MCSelecter *mcSelecter,
78 index::chain::MonotoneChain *mc);
79};
80
81} // namespace geos::algorithm
82} // namespace geos
83
84#endif // GEOS_ALGORITHM_MCPOINTINRING_H
85
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Definition LineSegment.h:57
Models an OGC SFS LinearRing.
Definition LinearRing.h:57
An BinTree (or "Binary Interval Tree") is a 1-dimensional version of a quadtree.
Definition Bintree.h:56
Represents an (1-dimensional) closed interval on the Real number line.
Definition bintree/Interval.h:25
Monotone Chains are a way of partitioning the segments of a linestring to allow for fast searching of...
Definition index/chain/MonotoneChain.h:86
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement a Binary Interval Tree index.
Definition MCPointInRing.h:37
Contains classes that implement Monotone Chains.
Definition MCPointInRing.h:41
Provides classes for various kinds of spatial indexes.
Definition IndexedNestedRingTester.h:31
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25