GEOS: LinearIterator.h Source File

GEOS 3.5.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

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
30 namespace geos { namespace linearref
31 {
32
50 class LinearIterator
51 {
52 public:
58 LinearIterator(const geom::Geometry *linear);
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
122 geom::Coordinate getSegmentStart() const;
123
131 geom::Coordinate getSegmentEnd() const;
132
133 private:
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
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:167
geos::linearref::LinearIterator::next
void next()
geos::geom::LineString
Definition: LineString.h:70
geos::linearref::LinearLocation
Represents a location along a LineString or MultiLineString.
Definition: LinearLocation.h:43
geos::linearref::LinearIterator::hasNext
bool hasNext() const
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::linearref::LinearIterator::isEndOfLine
bool isEndOfLine() const
geos::linearref::LinearIterator::getLine
const geom::LineString * getLine() const
geos::linearref::LinearIterator::getComponentIndex
unsigned int getComponentIndex() const
geos::linearref::LinearIterator::getVertexIndex
unsigned int getVertexIndex() const
geos::linearref::LinearIterator::getSegmentEnd
geom::Coordinate getSegmentEnd() const
geos::linearref::LinearIterator::getSegmentStart
geom::Coordinate getSegmentStart() const
geos::linearref::LinearIterator::LinearIterator
LinearIterator(const geom::Geometry *linear)
geos::linearref::LinearIterator
An iterator over the components and coordinates of a linear geometry (LineString or MultiLineString)...
Definition: LinearIterator.h:50