GEOS 3.11.1
UnaryUnionNG.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************/
14
15#pragma once
16
17#include <geos/export.h>
18#include <geos/geom/PrecisionModel.h>
19#include <geos/operation/union/UnionStrategy.h>
20#include <geos/operation/overlayng/OverlayNG.h>
21#include <geos/operation/overlayng/OverlayUtil.h>
22
23
24
25// Forward declarations
26namespace geos {
27namespace geom {
28class Geometry;
29}
30}
31
32namespace geos { // geos.
33namespace operation { // geos.operation
34namespace overlayng { // geos.operation.overlayng
35
44class GEOS_DLL UnaryUnionNG {
45
46private:
47
48 // Members
49
50
51
52public:
53
58
59 public:
60
62 : pm(p_pm)
63 {};
64
65 std::unique_ptr<geom::Geometry>
66 Union(const geom::Geometry* g0, const geom::Geometry* g1) override
67 {
68 return OverlayNG::overlay(g0, g1, OverlayNG::UNION, &pm);
69 }
70
71 bool
72 isFloatingPrecision() const override
73 {
74 return OverlayUtil::isFloating(&pm);
75 }
76
77 private:
78
79 const geom::PrecisionModel& pm;
80
81 };
82
83
84 // static methods
85 static std::unique_ptr<Geometry> Union(const Geometry* geom, const PrecisionModel& pm);
86 static std::unique_ptr<Geometry> Union(const Geometry* geom);
87
88
89};
90
91
92} // namespace geos.operation.overlayng
93} // namespace geos.operation
94} // namespace geos
95
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:90
Definition: UnionStrategy.h:40
static std::unique_ptr< Geometry > overlay(const Geometry *geom0, const Geometry *geom1, int opCode, const PrecisionModel *pm)
bool isFloatingPrecision() const override
Definition: UnaryUnionNG.h:72
std::unique_ptr< geom::Geometry > Union(const geom::Geometry *g0, const geom::Geometry *g1) override
Definition: UnaryUnionNG.h:66
Definition: UnaryUnionNG.h:44
Basic namespace for all GEOS functionalities.
Definition: geos.h:39