23#include <geos/export.h>
24#include <geos/geom/Location.h>
25#include <geos/geom/Position.h>
45 static constexpr int NULL_VALUE = -1;
54 if(location == geom::Location::EXTERIOR) {
57 if(location == geom::Location::INTERIOR) {
67 for(std::size_t i = 0; i < 2; i++) {
68 for(std::size_t j = 0; j < 3; j++) {
69 depth[i][j] = NULL_VALUE;
74 virtual ~Depth() =
default;
76 int getDepth(
int geomIndex,
int posIndex)
const
78 return depth[geomIndex][posIndex];
81 void setDepth(
int geomIndex,
int posIndex,
int depthValue)
83 depth[geomIndex][posIndex] = depthValue;
88 if(depth[geomIndex][posIndex] <= 0) {
89 return geom::Location::EXTERIOR;
91 return geom::Location::INTERIOR;
96 if(location == geom::Location::INTERIOR) {
97 depth[geomIndex][posIndex]++;
106 for(std::size_t i = 0; i < 2; i++) {
107 for(std::size_t j = 0; j < 3; j++) {
108 if(depth[i][j] != NULL_VALUE) {
116 bool isNull(uint8_t geomIndex)
const
118 return depth[geomIndex][1] == NULL_VALUE;
121 bool isNull(uint8_t geomIndex, uint8_t posIndex)
const
123 return depth[geomIndex][posIndex] == NULL_VALUE;
126 int getDelta(
int geomIndex)
const
128 return depth[geomIndex][geom::Position::RIGHT] - depth[geomIndex][geom::Position::LEFT];
133 void add(
const Label& lbl);
135 std::string toString()
const;
A Depth object records the topological depth of the sides of an Edge for up to two Geometries.
Definition: Depth.h:41
bool isNull() const
Definition: Depth.h:104
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition: Label.h:58
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:32
Basic namespace for all GEOS functionalities.
Definition: geos.h:39