GEOS  3.3.3
LinearGeometryBuilder.h
1 /**********************************************************************
2  * $Id: LinearGeometryBuilder.h 2809 2009-12-06 01:05:24Z mloskot $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2005-2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: linearref/LinearGeometryBuilder.java rev. 1.1
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
22 #define GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
23 
24 #include <geos/geom/Coordinate.h>
25 #include <geos/geom/CoordinateList.h>
26 #include <geos/geom/Geometry.h>
27 #include <geos/geom/GeometryFactory.h>
28 #include <geos/linearref/LinearLocation.h>
29 
30 #include <vector>
31 
32 namespace geos
33 {
34 namespace linearref // geos::linearref
35 {
36 
44 {
45 private:
46  const geom::GeometryFactory* geomFact;
47 
48  typedef std::vector<geom::Geometry *> GeomPtrVect;
49 
50  // Geometry elements owned by this class
51  GeomPtrVect lines;
52 
53  bool ignoreInvalidLines;
54  bool fixInvalidLines;
55  geom::CoordinateSequence* coordList;
56 
57  geom::Coordinate lastPt;
58 
59 public:
61 
63 
71  void setIgnoreInvalidLines(bool ignoreInvalidLines);
72 
80  void setFixInvalidLines(bool fixInvalidLines);
81 
87  void add(const geom::Coordinate& pt);
88 
94  void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
95 
98 
100  void endLine();
101 
102  geom::Geometry *getGeometry();
103 };
104 
105 } // namespace geos.linearref
106 } // namespace geos
107 
108 #endif