NodeSection.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/export.h>
#include <geos/geom/Coordinate.h>
#include <string>
#include <sstream>
// Forward declarations
namespace geos {
namespace geom {
class Geometry;
}
}
namespace geos { // geos.
namespace operation { // geos.operation
namespace relateng { // geos.operation.relateng
class GEOS_DLL NodeSection {
using CoordinateXY = geos::geom::CoordinateXY;
using Geometry = geos::geom::Geometry;
private:
// Members
bool m_isA;
int m_dim;
int m_id;
int m_ringId;
const Geometry* m_poly;
bool m_isNodeAtVertex;
const CoordinateXY* m_v0;
const CoordinateXY m_nodePt;
const CoordinateXY* m_v1;
// Methods
static int compareWithNull(const CoordinateXY* v0, const CoordinateXY* v1);
static int compare(int a, int b);
public:
NodeSection(
bool isA,
int dim,
int id,
int ringId,
const Geometry* poly,
bool isNodeAtVertex,
const CoordinateXY* v0,
const CoordinateXY nodePt,
const CoordinateXY* v1)
: m_isA(isA)
, m_dim(dim)
, m_id(id)
, m_ringId(ringId)
, m_poly(poly)
, m_isNodeAtVertex(isNodeAtVertex)
, m_v0(v0)
, m_nodePt(nodePt)
, m_v1(v1)
{};
NodeSection(const NodeSection* ns)
: m_isA(ns->isA())
, m_dim(ns->dimension())
, m_id(ns->id())
, m_ringId(ns->ringId())
, m_poly(ns->getPolygonal())
, m_isNodeAtVertex(ns->isNodeAtVertex())
, m_v0(ns->getVertex(0))
, m_nodePt(ns->nodePt())
, m_v1(ns->getVertex(1))
{};
const CoordinateXY* getVertex(int i) const;
const CoordinateXY& nodePt() const;
int dimension() const;
int id() const;
int ringId() const;
const Geometry* getPolygonal() const;
bool isShell() const;
bool isArea() const;
static bool isAreaArea(const NodeSection& a, const NodeSection& b);
bool isA() const;
bool isSameGeometry(const NodeSection& ns) const;
bool isSamePolygon(const NodeSection& ns) const;
bool isNodeAtVertex() const;
bool isProper() const;
static bool isProper(const NodeSection& a, const NodeSection& b);
std::string toString() const;
static std::string edgeRep(const CoordinateXY* p0, const CoordinateXY* p1);
friend std::ostream& operator<<(std::ostream& os, const NodeSection& ns);
int compareTo(const NodeSection& o) const;
};
} // namespace geos.operation.relateng
} // namespace geos.operation
} // namespace geos
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::operation::relateng::NodeSection::getPolygonal
const Geometry * getPolygonal() const
geos::operation::relateng::NodeSection::compareTo
int compareTo(const NodeSection &o) const
geos::geom
Definition Angle.h:26
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38