GEOS 3.6.2
LinearIterator.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 * Last port: linearref/LinearIterator.java r463
17 *
18 **********************************************************************/
19
20#ifndef GEOS_LINEARREF_LINEARITERATOR_H
21#define GEOS_LINEARREF_LINEARITERATOR_H
22
23#include <string>
24
25#include <geos/geom/Coordinate.h>
26#include <geos/geom/Geometry.h>
27#include <geos/geom/LineSegment.h>
28#include <geos/linearref/LinearLocation.h>
29
30namespace geos { namespace linearref
31{
32
51{
52public:
59
67 LinearIterator(const geom::Geometry *linear, const LinearLocation& start);
68
77 LinearIterator(const geom::Geometry *linear, unsigned int componentIndex, unsigned int vertexIndex);
78
83 bool hasNext() const;
84
85
89 void next();
90
97 bool isEndOfLine() const;
98
103 unsigned int getComponentIndex() const;
104
109 unsigned int getVertexIndex() const;
110
115 const geom::LineString* getLine() const;
116
123
132
133private:
134
135 static unsigned int segmentEndVertexIndex(const LinearLocation& loc);
136
137 const geom::LineString *currentLine;
138 unsigned int vertexIndex;
139 unsigned int componentIndex;
140 const geom::Geometry *linear;
141 const unsigned int numLines;
142
149 void loadCurrentLine();
150
151 // Declare type as noncopyable
152 LinearIterator(const LinearIterator& other);
153 LinearIterator& operator=(const LinearIterator& rhs);
154};
155
156}} // namespace geos::linearref
157
158#endif // GEOS_LINEARREF_LINEARITERATOR_H
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
Definition LineString.h:70
geom::Coordinate getSegmentEnd() const
LinearIterator(const geom::Geometry *linear)
geom::Coordinate getSegmentStart() const
unsigned int getVertexIndex() const
LinearIterator(const geom::Geometry *linear, unsigned int componentIndex, unsigned int vertexIndex)
LinearIterator(const geom::Geometry *linear, const LinearLocation &start)
const geom::LineString * getLine() const
unsigned int getComponentIndex() const
Represents a location along a LineString or MultiLineString.
Definition LinearLocation.h:44
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25