📄 fastnodingvalidator.h
字号:
/********************************************************************** * $Id: SinglePassNoder.h 1820 2006-09-06 16:54:23Z mloskot $ * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2006 Refractions Research Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * ********************************************************************** * * Last port: noding/FastNodingValidator.java rev. ??? (JTS-1.8) * **********************************************************************/#ifndef GEOS_NODING_FASTNODINGVALIDATOR_H#define GEOS_NODING_FASTNODINGVALIDATOR_H#include <geos/noding/SingleInteriorIntersectionFinder.h> // for composition#include <geos/algorithm/LineIntersector.h> // for composition#include <cassert>#include <string>// Forward declarationsnamespace geos { namespace noding { class SegmentString; }}namespace geos {namespace noding { // geos.noding/** \brief * Validates that a collection of {@link SegmentString}s is correctly noded. * * Uses indexes to improve performance. * Does NOT check a-b-a collapse situations. * Also does not check for endpt-interior vertex intersections. * This should not be a problem, since the noders should be * able to compute intersections between vertices correctly. * User may either test the valid condition, or request that a * {@link TopologyException} * be thrown. * * @version 1.7 */class FastNodingValidator {public: FastNodingValidator(std::vector<noding::SegmentString*>& newSegStrings) : li(), // robust... segStrings(newSegStrings), segInt(), isValidVar(true) { } /** * Checks for an intersection and * reports if one is found. * * @return true if the arrangement contains an interior intersection */ bool isValid() { execute(); return isValidVar; } /** * Returns an error message indicating the segments containing * the intersection. * * @return an error message documenting the intersection location */ std::string getErrorMessage() const; /** * Checks for an intersection and throws * a TopologyException if one is found. * * @throws TopologyException if an intersection is found */ void checkValid();private: geos::algorithm::LineIntersector li; std::vector<noding::SegmentString*>& segStrings; std::auto_ptr<SingleInteriorIntersectionFinder> segInt; bool isValidVar; void execute() { if (segInt.get() != NULL) return; checkInteriorIntersections(); } void checkInteriorIntersections(); };} // namespace geos.noding} // namespace geos#endif // GEOS_NODING_FASTNODINGVALIDATOR_H/********************************************************************** * $Log$ **********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -