GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net> 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 ********************************************************************** 00016 * 00017 * Last port: noding/SegmentString.java r430 (JTS-1.12+) 00018 * 00019 **********************************************************************/ 00020 00021 #ifndef GEOS_NODING_SEGMENTSTRING_H 00022 #define GEOS_NODING_SEGMENTSTRING_H 00023 00024 #include <geos/export.h> 00025 #include <geos/noding/SegmentNodeList.h> 00026 00027 #include <vector> 00028 00029 // Forward declarations 00030 namespace geos { 00031 namespace algorithm { 00032 class LineIntersector; 00033 } 00034 } 00035 00036 namespace geos { 00037 namespace noding { // geos.noding 00038 00046 class GEOS_DLL SegmentString { 00047 public: 00048 typedef std::vector<const SegmentString*> ConstVect; 00049 typedef std::vector<SegmentString *> NonConstVect; 00050 00051 friend std::ostream& operator<< (std::ostream& os, 00052 const SegmentString& ss); 00053 00055 // 00058 SegmentString(const void* newContext) 00059 : 00060 context(newContext) 00061 {} 00062 00063 virtual ~SegmentString() {} 00064 00070 const void* getData() const { return context; } 00071 00077 void setData(const void* data) { context=data; } 00078 00079 00080 virtual unsigned int size() const=0; 00081 00082 virtual const geom::Coordinate& getCoordinate(unsigned int i) const=0; 00083 00087 // 00090 virtual geom::CoordinateSequence* getCoordinates() const=0; 00091 00092 virtual bool isClosed() const=0; 00093 00094 virtual std::ostream& print(std::ostream& os) const; 00095 00096 private: 00097 00098 const void* context; 00099 00100 // Declare type as noncopyable 00101 SegmentString(const SegmentString& other); 00102 SegmentString& operator=(const SegmentString& rhs); 00103 }; 00104 00105 std::ostream& operator<< (std::ostream& os, const SegmentString& ss); 00106 00107 } // namespace geos.noding 00108 } // namespace geos 00109 00110 #endif 00111