TopologyPredicate.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/geom/Location.h>
#include <geos/export.h>
#include <ostream> // for operator<<
#include <string>
// Forward declarations
namespace geos {
namespace geom {
class Envelope;
}
}
namespace geos { // geos.
namespace operation { // geos.operation
namespace relateng { // geos.operation.relateng
class GEOS_DLL TopologyPredicate {
using Envelope = geos::geom::Envelope;
using Location = geos::geom::Location;
public:
/* Virtual destructor to ensure proper cleanup of derived classes */
virtual ~TopologyPredicate() {};
virtual std::string name() const = 0;
virtual void finish() = 0;
virtual bool isKnown() const = 0;
virtual bool value() const = 0;
virtual bool requireSelfNoding() const {
return true;
};
virtual bool requireInteraction() const {
return true;
};
virtual bool requireCovers(bool isSourceA) {
(void)isSourceA;
return false;
}
virtual bool requireExteriorCheck(bool isSourceA) const {
(void)isSourceA;
return true;
}
virtual void init(int dimA, int dimB) {
(void)dimA;
(void)dimB;
};
virtual void init(const Envelope& envA, const Envelope& envB)
{
//-- default if envelopes provide no information
(void)envA;
(void)envB;
};
virtual void updateDimension(Location locA, Location locB, int dimension) = 0;
friend std::ostream&
operator<<(std::ostream& os, const TopologyPredicate& ns)
{
os << ns.name();
return os;
}
};
} // namespace geos.operation.relateng
} // namespace geos.operation
} // namespace geos
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::geom
Definition Angle.h:26
geos::geom::Location
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38