GEOS 3.4.2

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

- File List

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 {
33 namespace linearref // geos::linearref
34 {
35
42 class LinearGeometryBuilder
43 {
44 private:
45 const geom::GeometryFactory* geomFact;
46
47 typedef std::vector<geom::Geometry *> GeomPtrVect;
48
49 // Geometry elements owned by this class
50 GeomPtrVect lines;
51
52 bool ignoreInvalidLines;
53 bool fixInvalidLines;
54 geom::CoordinateSequence* coordList;
55
56 geom::Coordinate lastPt;
57
58 public:
59 LinearGeometryBuilder(const geom::GeometryFactory* geomFact);
60
61 ~LinearGeometryBuilder();
62
70 void setIgnoreInvalidLines(bool ignoreInvalidLines);
71
79 void setFixInvalidLines(bool fixInvalidLines);
80
86 void add(const geom::Coordinate& pt);
87
93 void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
94
96 geom::Coordinate getLastCoordinate() const;
97
99 void endLine();
100
101 geom::Geometry *getGeometry();
102 };
103
104 } // namespace geos.linearref
105 } // namespace geos
106
107 #endif