ComponentJumpChecker.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://libgeos.org
*
* Copyright (C) 2006 Refractions Research Inc.
* Copyright (C) 2023 Martin Davis <mtnclimb@gmail.com>
* Copyright (C) 2023 Paul Ramsey <pramsey@cleverelephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <vector>
#include <memory>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
class CoordinateSequence;
class Envelope;
class LineSegment;
}
namespace simplify {
class TaggedLineString;
}
}
namespace geos {
namespace simplify { // geos::simplify
class GEOS_DLL ComponentJumpChecker {
using Coordinate = geos::geom::Coordinate;
using Envelope = geos::geom::Envelope;
using LineSegment = geos::geom::LineSegment;
private:
const std::vector<TaggedLineString*>& components;
static bool hasJumpAtComponent(
const Coordinate& compPt,
const TaggedLineString* line,
std::size_t start, std::size_t end,
const LineSegment& seg);
static bool hasJumpAtComponent(
const Coordinate& compPt,
const LineSegment* seg1, const LineSegment* seg2,
const LineSegment& seg);
static std::size_t crossingCount(
const Coordinate& compPt,
const LineSegment& seg);
static std::size_t crossingCount(
const Coordinate& compPt,
const LineSegment* seg1, const LineSegment* seg2);
std::size_t static crossingCount(
const Coordinate& compPt,
const TaggedLineString* line,
std::size_t start, std::size_t end);
static Envelope computeEnvelope(
const LineSegment* seg1, const LineSegment* seg2);
static Envelope computeEnvelope(
const TaggedLineString* line,
std::size_t start, std::size_t end);
public:
ComponentJumpChecker(const std::vector<TaggedLineString*>& taggedLines)
: components(taggedLines)
{}
bool hasJump(
const TaggedLineString* line,
std::size_t start, std::size_t end,
const LineSegment& seg) const;
bool hasJump(
const TaggedLineString* line,
const LineSegment* seg1,
const LineSegment* seg2,
const LineSegment& seg) const;
};
} // namespace geos::simplify
} // namespace geos
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::geom::LineSegment
Definition LineSegment.h:61
geos::simplify::TaggedLineString
Contains and owns a list of TaggedLineSegments.
Definition TaggedLineString.h:57
geos::geom
Definition Angle.h:26
geos::simplify
Classes which implement algorithms for simplifying or generalizing geometries.
Definition Corner.h:26
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38