IntersectionFinderAdder.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/IntersectionFinderAdder.java rev. 1.5 (JTS-1.9)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <vector>
#include <iostream>
#include <geos/geom/Coordinate.h> // for use in vector
#include <geos/noding/SegmentIntersector.h> // for inheritance
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
}
namespace noding {
class SegmentString;
}
namespace algorithm {
class LineIntersector;
}
}
namespace geos {
namespace noding { // geos.noding
class GEOS_DLL IntersectionFinderAdder: public SegmentIntersector {
public:
IntersectionFinderAdder(algorithm::LineIntersector& newLi,
std::vector<geom::Coordinate>& v)
:
li(newLi),
interiorIntersections(v)
{}
void processIntersections(
SegmentString* e0, std::size_t segIndex0,
SegmentString* e1, std::size_t segIndex1) override;
std::vector<geom::Coordinate>&
getInteriorIntersections()
{
return interiorIntersections;
}
bool
isDone() const override
{
return false;
}
private:
algorithm::LineIntersector& li;
std::vector<geom::Coordinate>& interiorIntersections;
// Declare type as noncopyable
IntersectionFinderAdder(const IntersectionFinderAdder& other) = delete;
IntersectionFinderAdder& operator=(const IntersectionFinderAdder& 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::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::noding::IntersectionFinderAdder
Finds proper and interior intersections in a set of SegmentStrings, and adds them as nodes.
Definition IntersectionFinderAdder.h:50
geos::noding::IntersectionFinderAdder::processIntersections
void processIntersections(SegmentString *e0, std::size_t segIndex0, SegmentString *e1, std::size_t segIndex1) override
This method is called by clients of the SegmentIntersector class to process intersections for two seg...
geos::noding::IntersectionFinderAdder::isDone
bool isDone() const override
Definition IntersectionFinderAdder.h:94
geos::noding::IntersectionFinderAdder::IntersectionFinderAdder
IntersectionFinderAdder(algorithm::LineIntersector &newLi, std::vector< geom::Coordinate > &v)
Creates an intersection finder which finds all proper intersections and stores them in the provided C...
Definition IntersectionFinderAdder.h:61
geos::noding::SegmentString
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:47
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
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