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.
12  * See the COPYING file for more information.
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;
51  geom::CoordinateSequence* coordList;
52 
53  geom::Coordinate lastPt;
54 
55 public:
57 
59 
67  void setIgnoreInvalidLines(bool ignoreInvalidLines);
68 
76  void setFixInvalidLines(bool fixInvalidLines);
77 
83  void add(const geom::Coordinate& pt);
84 
90  void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
91 
94 
96  void endLine();
97 
98  geom::Geometry* getGeometry();
99 };
100 
101 } // namespace geos.linearref
102 } // namespace geos
103 
104 #endif
void endLine()
Terminate the current LineString.
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
void add(const geom::Coordinate &pt)
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:187
void setIgnoreInvalidLines(bool ignoreInvalidLines)
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:67
Definition: LinearGeometryBuilder.h:40
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
void setFixInvalidLines(bool fixInvalidLines)
geom::Coordinate getLastCoordinate() const
NOTE strk: why return by value ?