FastNodingValidator.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* 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)
*
**********************************************************************/
#pragma once
#include <geos/noding/NodingIntersectionFinder.h> // for composition
#include <geos/algorithm/LineIntersector.h> // for composition
#include <memory>
#include <string>
#include <cassert>
// Forward declarations
namespace geos {
namespace noding {
class SegmentString;
}
}
namespace geos {
namespace noding { // geos.noding
class FastNodingValidator {
public:
FastNodingValidator(std::vector<noding::SegmentString*>& newSegStrings)
:
li(), // robust...
segStrings(newSegStrings),
segInt(),
isValidVar(true)
{
}
bool
isValid()
{
execute();
return isValidVar;
}
std::string getErrorMessage() const;
void checkValid();
private:
geos::algorithm::LineIntersector li;
std::vector<noding::SegmentString*>& segStrings;
std::unique_ptr<NodingIntersectionFinder> segInt;
bool isValidVar;
void
execute()
{
if(segInt.get() != nullptr) {
return;
}
checkInteriorIntersections();
}
void checkInteriorIntersections();
// Declare type as noncopyable
FastNodingValidator(const FastNodingValidator& other) = delete;
FastNodingValidator& operator=(const FastNodingValidator& rhs) = delete;
};
} // namespace geos.noding
} // namespace geos
geos::algorithm::LineIntersector
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:53
geos::noding::FastNodingValidator::checkValid
void checkValid()
Checks for an intersection and throws a TopologyException if one is found.
geos::noding::FastNodingValidator::getErrorMessage
std::string getErrorMessage() const
Returns an error message indicating the segments containing the intersection.
geos::noding::FastNodingValidator::isValid
bool isValid()
Checks for an intersection and reports if one is found.
Definition FastNodingValidator.h:79
geos::noding::SegmentString
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:47
geos::noding
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition CoverageCleaner.h:42
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38