GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2006 Refractions Research Inc. 00007 * 00008 * This is free software; you can redistribute and/or modify it under 00009 * the terms of the GNU Lesser General Public Licence as published 00010 * by the Free Software Foundation. 00011 * See the COPYING file for more information. 00012 * 00013 ********************************************************************** 00014 * 00015 * Last port: noding/SegmentNode.java rev. 1.6 (JTS-1.9) 00016 * 00017 **********************************************************************/ 00018 00019 #ifndef GEOS_NODING_SEGMENTNODE_H 00020 #define GEOS_NODING_SEGMENTNODE_H 00021 00022 #include <geos/export.h> 00023 00024 #include <vector> 00025 #include <iostream> 00026 00027 #include <geos/inline.h> 00028 00029 #include <geos/geom/Coordinate.h> 00030 00031 // Forward declarations 00032 namespace geos { 00033 namespace noding { 00034 class NodedSegmentString; 00035 } 00036 } 00037 00038 namespace geos { 00039 namespace noding { // geos.noding 00040 00042 // 00045 class GEOS_DLL SegmentNode { 00046 private: 00047 const NodedSegmentString& segString; 00048 00049 int segmentOctant; 00050 00051 bool isInteriorVar; 00052 00053 // Declare type as noncopyable 00054 SegmentNode(const SegmentNode& other); 00055 SegmentNode& operator=(const SegmentNode& rhs); 00056 00057 public: 00058 friend std::ostream& operator<< (std::ostream& os, const SegmentNode& n); 00059 00061 geom::Coordinate coord; 00062 00064 unsigned int segmentIndex; 00065 00067 // 00078 SegmentNode(const NodedSegmentString& ss, 00079 const geom::Coordinate& nCoord, 00080 unsigned int nSegmentIndex, int nSegmentOctant); 00081 00082 ~SegmentNode() {} 00083 00089 bool isInterior() const { return isInteriorVar; } 00090 00091 bool isEndPoint(unsigned int maxSegmentIndex) const; 00092 00100 int compareTo(const SegmentNode& other); 00101 00102 //string print() const; 00103 }; 00104 00105 std::ostream& operator<< (std::ostream& os, const SegmentNode& n); 00106 00107 struct GEOS_DLL SegmentNodeLT { 00108 bool operator()(SegmentNode *s1, SegmentNode *s2) const { 00109 return s1->compareTo(*s2)<0; 00110 } 00111 }; 00112 00113 00114 } // namespace geos.noding 00115 } // namespace geos 00116 00117 #endif // GEOS_NODING_SEGMENTNODE_H