GEOS  3.8.0dev
LinearGeometryBuilder.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.
13  *
14  **********************************************************************
15  *
16  * Last port: linearref/LinearGeometryBuilder.java rev. 1.1
17  *
18  **********************************************************************/
19
20 #ifndef GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
21 #define GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
22
23 #include <geos/geom/Coordinate.h>
24 #include <geos/geom/CoordinateList.h>
25 #include <geos/geom/Geometry.h>
26 #include <geos/geom/GeometryFactory.h>
27 #include <geos/linearref/LinearLocation.h>
28
29 #include <vector>
30
31 namespace geos {
32 namespace linearref { // geos::linearref
33
41 private:
42  const geom::GeometryFactory* geomFact;
43
44  typedef std::vector<geom::Geometry*> GeomPtrVect;
45
46  // Geometry elements owned by this class
47  GeomPtrVect lines;
48
49  bool ignoreInvalidLines;
50  bool fixInvalidLines;
52
53  geom::Coordinate lastPt;
54
55 public:
57
59
68  void setIgnoreInvalidLines(bool ignoreInvalidLines);
69
78  void setFixInvalidLines(bool fixInvalidLines);
79
86
94  void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
95
96  // NOTE strk: why return by value ?
97  geom::Coordinate getLastCoordinate() const;
98
100  void endLine();
101
102  geom::Geometry* getGeometry();
103 };
104
105 } // namespace geos.linearref
106 } // namespace geos
107
108 #endif
void endLine()
Terminate the current LineString.
The default implementation of CoordinateSequence.
Definition: CoordinateArraySequence.h:37
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60