GEOS 3.6.2
RayCrossingCounter.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 *
14 **********************************************************************
15 *
16 * Last port: algorithm/RayCrossingCounter.java rev. 1.2 (JTS-1.9)
17 *
18 **********************************************************************/
19
20#ifndef GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
21#define GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
22
23#include <geos/export.h>
24
25#include <vector>
26
27// forward declarations
28namespace geos {
29 namespace geom {
30 class Coordinate;
32 }
33}
34
35
36namespace geos {
37namespace algorithm {
38
66class GEOS_DLL RayCrossingCounter
67{
68private:
69 const geom::Coordinate& point;
70
71 int crossingCount;
72
73 // true if the test point lies on an input segment
74 bool isPointOnSegment;
75
76 // Declare type as noncopyable
77 RayCrossingCounter(const RayCrossingCounter& other);
78 RayCrossingCounter& operator=(const RayCrossingCounter& rhs);
79
80public:
90 const geom::CoordinateSequence& ring);
91
94 const std::vector<const geom::Coordinate*>& ring);
95
108 static int orientationIndex(const geom::Coordinate& p1,
109 const geom::Coordinate& p2,
110 const geom::Coordinate& q);
111
112 RayCrossingCounter(const geom::Coordinate& point)
113 : point( point),
114 crossingCount( 0),
115 isPointOnSegment( false)
116 { }
117
125 const geom::Coordinate& p2);
126
137 {
138 return isPointOnSegment;
139 }
140
152
164
165};
166
167} // geos::algorithm
168} // geos
169
170#endif // GEOS_ALGORITHM_RAYCROSSINGCOUNTER_H
static int locatePointInRing(const geom::Coordinate &p, const geom::CoordinateSequence &ring)
static int orientationIndex(const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q)
Returns the index of the direction of the point q relative to a vector specified by p1-p2.
bool isOnSegment()
Definition RayCrossingCounter.h:136
void countSegment(const geom::Coordinate &p1, const geom::Coordinate &p2)
static int locatePointInRing(const geom::Coordinate &p, const std::vector< const geom::Coordinate * > &ring)
Semantically equal to the above, just different args encoding.
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
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:33
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25