GEOS
3.4.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/snapround/SimpleSnapRounder.java r320 (JTS-1.12) 00016 * 00017 **********************************************************************/ 00018 00019 #ifndef GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H 00020 #define GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H 00021 00022 #include <geos/export.h> 00023 00024 #include <vector> 00025 00026 #include <geos/inline.h> 00027 00028 #include <geos/noding/Noder.h> // for inheritance 00029 #include <geos/algorithm/LineIntersector.h> // for composition 00030 #include <geos/geom/Coordinate.h> // for use in vector 00031 #include <geos/geom/PrecisionModel.h> // for inlines (should drop) 00032 00033 // Forward declarations 00034 namespace geos { 00035 namespace geom { 00036 //class PrecisionModel; 00037 } 00038 namespace algorithm { 00039 class LineIntersector; 00040 } 00041 namespace noding { 00042 class SegmentString; 00043 class NodedSegmentString; 00044 namespace snapround { 00045 class HotPixel; 00046 } 00047 } 00048 } 00049 00050 namespace geos { 00051 namespace noding { // geos::noding 00052 namespace snapround { // geos::noding::snapround 00053 00073 class GEOS_DLL SimpleSnapRounder: public Noder { // implements NoderIface 00074 00075 public: 00076 00077 SimpleSnapRounder(const geom::PrecisionModel& newPm); 00078 00079 std::vector<SegmentString*>* getNodedSubstrings() const; 00080 00081 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings); 00082 00083 void add(const SegmentString* segStr); 00084 00092 void computeVertexSnaps(const std::vector<SegmentString*>& edges); 00093 00094 private: 00095 00096 const geom::PrecisionModel& pm; 00097 algorithm::LineIntersector li; 00098 double scaleFactor; 00099 std::vector<SegmentString*>* nodedSegStrings; 00100 00101 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings); 00102 00103 void snapRound(std::vector<SegmentString*>* segStrings, 00104 algorithm::LineIntersector& li); 00105 00117 void findInteriorIntersections(std::vector<SegmentString*>& segStrings, 00118 algorithm::LineIntersector& li, std::vector<geom::Coordinate>& ret); 00119 00125 void computeSnaps(const std::vector<SegmentString*>& segStrings, 00126 std::vector<geom::Coordinate>& snapPts); 00127 00128 void computeSnaps(NodedSegmentString* ss, std::vector<geom::Coordinate>& snapPts); 00129 00135 void computeVertexSnaps(NodedSegmentString* e0, NodedSegmentString* e1); 00136 00137 // Declare type as noncopyable 00138 SimpleSnapRounder(const SimpleSnapRounder& other); 00139 SimpleSnapRounder& operator=(const SimpleSnapRounder& rhs); 00140 }; 00141 00142 } // namespace geos::noding::snapround 00143 } // namespace geos::noding 00144 } // namespace geos 00145 00146 #endif // GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H