PolygonNodeConverter.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (c) 2024 Martin Davis
* Copyright (C) 2024 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/operation/relateng/NodeSection.h>
#include <geos/export.h>
#include <vector>
#include <memory>
// Forward declarations
namespace geos {
namespace operation {
namespace relateng {
// class NodeSection;
}
}
}
// using geos::geom::CoordinateXY;
// using geos::geom::Geometry;
namespace geos { // geos.
namespace operation { // geos.operation
namespace relateng { // geos.operation.relateng
class GEOS_DLL PolygonNodeConverter {
using CoordinateXY = geos::geom::CoordinateXY;
public:
static std::vector<std::unique_ptr<NodeSection>> convert(
std::vector<const NodeSection*>& polySections);
private:
static std::size_t convertShellAndHoles(
std::vector<const NodeSection*>& sections,
std::size_t shellIndex,
std::vector<std::unique_ptr<NodeSection>>& convertedSections);
static std::vector<std::unique_ptr<NodeSection>> convertHoles(
std::vector<const NodeSection*>& sections);
static NodeSection* createSection(
const NodeSection* ns,
const CoordinateXY* v0,
const CoordinateXY* v1);
static std::vector<const NodeSection*> extractUnique(
std::vector<const NodeSection*>& sections);
static std::size_t next(
std::vector<const NodeSection *>& ns, std::size_t i);
static std::size_t findShell(
std::vector<const NodeSection *>& polySections);
};
} // namespace geos.operation.relateng
} // namespace geos.operation
} // namespace geos
geos::operation::relateng::NodeSection
Definition NodeSection.h:50
geos::operation::relateng::PolygonNodeConverter
Definition PolygonNodeConverter.h:66
geos::operation::relateng::PolygonNodeConverter::convert
static std::vector< std::unique_ptr< NodeSection > > convert(std::vector< const NodeSection * > &polySections)
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38