LinearGeometryBuilder.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2005-2006 Refractions Research Inc.
00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation.
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************
00015  *
00016  * Last port: linearref/LinearGeometryBuilder.java rev. 1.1
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
00021 #define GEOS_LINEARREF_LINEARGEOMETRYBUILDER_H
00022 
00023 #include <geos/geom/Coordinate.h>
00024 #include <geos/geom/CoordinateList.h>
00025 #include <geos/geom/Geometry.h>
00026 #include <geos/geom/GeometryFactory.h>
00027 #include <geos/linearref/LinearLocation.h>
00028 
00029 #include <vector>
00030 
00031 namespace geos
00032 {
00033 namespace linearref   // geos::linearref
00034 {
00035 
00042 class LinearGeometryBuilder
00043 {
00044 private:
00045         const geom::GeometryFactory* geomFact;
00046 
00047         typedef std::vector<geom::Geometry *> GeomPtrVect;
00048 
00049         // Geometry elements owned by this class
00050         GeomPtrVect lines;
00051 
00052         bool ignoreInvalidLines;
00053         bool fixInvalidLines;
00054         geom::CoordinateSequence* coordList;
00055 
00056         geom::Coordinate lastPt;
00057 
00058 public:
00059         LinearGeometryBuilder(const geom::GeometryFactory* geomFact);
00060 
00061         ~LinearGeometryBuilder();
00062 
00070         void setIgnoreInvalidLines(bool ignoreInvalidLines);
00071 
00079         void setFixInvalidLines(bool fixInvalidLines);
00080 
00086         void add(const geom::Coordinate& pt);
00087 
00093         void add(const geom::Coordinate& pt, bool allowRepeatedPoints);
00094 
00096         geom::Coordinate getLastCoordinate() const;
00097 
00099         void endLine();
00100 
00101         geom::Geometry *getGeometry();
00102 };
00103 
00104 } // namespace geos.linearref
00105 } // namespace geos
00106 
00107 #endif

Generated on 30 Dec 2015 for GEOS by  doxygen 1.4.7