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/IteratedNoder.java r591 (JTS-1.12+) 00016 * 00017 **********************************************************************/ 00018 00019 #ifndef GEOS_NODING_ITERATEDNODER_H 00020 #define GEOS_NODING_ITERATEDNODER_H 00021 00022 #include <geos/export.h> 00023 00024 #include <vector> 00025 #include <iostream> 00026 00027 #include <geos/inline.h> 00028 00029 #include <geos/algorithm/LineIntersector.h> 00030 #include <geos/noding/SegmentString.h> // due to inlines 00031 #include <geos/noding/Noder.h> // for inheritance 00032 00033 // Forward declarations 00034 namespace geos { 00035 namespace geom { 00036 class PrecisionModel; 00037 } 00038 } 00039 00040 namespace geos { 00041 namespace noding { // geos::noding 00042 00055 class GEOS_DLL IteratedNoder : public Noder { // implements Noder 00056 00057 private: 00058 static const int MAX_ITER = 5; 00059 00060 00061 const geom::PrecisionModel *pm; 00062 algorithm::LineIntersector li; 00063 std::vector<SegmentString*>* nodedSegStrings; 00064 int maxIter; 00065 00070 void node(std::vector<SegmentString*>* segStrings, 00071 int *numInteriorIntersections); 00072 00073 public: 00074 00075 IteratedNoder(const geom::PrecisionModel *newPm) 00076 : 00077 pm(newPm), 00078 li(pm), 00079 maxIter(MAX_ITER) 00080 { 00081 } 00082 00083 virtual ~IteratedNoder() {} 00084 00094 void setMaximumIterations(int n) { maxIter = n; } 00095 00096 std::vector<SegmentString*>* getNodedSubstrings() const { 00097 return nodedSegStrings; 00098 } 00099 00100 00110 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings); // throw(GEOSException); 00111 }; 00112 00113 } // namespace geos::noding 00114 } // namespace geos 00115 00116 00117 #endif // GEOS_NODING_ITERATEDNODER_H