InvalidSegmentDetector.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2022 Paul Ramsey <pramsey@cleverelephant.ca>
*
* 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.
*
**********************************************************************/
#pragma once
#include <geos/noding/SegmentIntersector.h>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
}
namespace noding {
class SegmentString;
}
namespace coverage {
class CoverageRing;
}
}
namespace geos { // geos.
namespace coverage { // geos.coverage
class GEOS_DLL InvalidSegmentDetector : public geos::noding::SegmentIntersector {
using SegmentString = geos::noding::SegmentString;
using Coordinate = geos::geom::Coordinate;
private:
// Members
double distanceTol;
// Methods
bool isInvalid(const Coordinate& tgt0, const Coordinate& tgt1,
const Coordinate& adj0, const Coordinate& adj1,
CoverageRing* adj, std::size_t indexAdj);
bool isEqual(
const Coordinate& t0, const Coordinate& t1,
const Coordinate& adj0, const Coordinate& adj1);
bool isCollinearOrInterior(
const Coordinate& tgt0, const Coordinate& tgt1,
const Coordinate& adj0, const Coordinate& adj1,
CoverageRing* adj, std::size_t indexAdj);
bool isInteriorSegment(
const Coordinate& intVertex,
const Coordinate& tgt0, const Coordinate& tgt1,
CoverageRing* adj, std::size_t indexAdj);
static bool isNearlyParallel(
const Coordinate& p00, const Coordinate& p01,
const Coordinate& p10, const Coordinate& p11,
double distanceTol);
public:
InvalidSegmentDetector() {};
InvalidSegmentDetector(double p_distanceTol)
: distanceTol(p_distanceTol) {};
bool isDone() const override {
// process all intersections
return false;
};
void processIntersections(
SegmentString* ssAdj, std::size_t iAdj,
SegmentString* ssTarget, std::size_t iTarget) override;
};
} // namespace geos.coverage
} // namespace geos
geos::coverage::InvalidSegmentDetector
Definition InvalidSegmentDetector.h:49
geos::coverage::InvalidSegmentDetector::processIntersections
void processIntersections(SegmentString *ssAdj, std::size_t iAdj, SegmentString *ssTarget, std::size_t iTarget) override
geos::coverage::InvalidSegmentDetector::isDone
bool isDone() const override
Reports whether the client of this class needs to continue testing all intersections in an arrangemen...
Definition InvalidSegmentDetector.h:107
geos::coverage::InvalidSegmentDetector::InvalidSegmentDetector
InvalidSegmentDetector()
Definition InvalidSegmentDetector.h:101
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::noding::SegmentIntersector
Processes possible intersections detected by a Noder.
Definition noding/SegmentIntersector.h:45
geos::noding::SegmentString
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:47
geos::geom
Definition Angle.h:26
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