GEOS 3.14.0dev
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 {
47
48private:
49
50 // Members
51
52
53
54public:
55
60
61 public:
62
64 : pm(p_pm)
65 {};
66
67 std::unique_ptr<geom::Geometry>
68 Union(const geom::Geometry* g0, const geom::Geometry* g1) override
69 {
70 return OverlayNG::overlay(g0, g1, OverlayNG::UNION, &pm);
71 }
72
73 bool
74 isFloatingPrecision() const override
75 {
76 return OverlayUtil::isFloating(&pm);
77 }
78
79 private:
80
81 const geom::PrecisionModel& pm;
82
83 };
84
85
86 // static methods
87 static std::unique_ptr<Geometry> Union(const Geometry* geom, const PrecisionModel& pm);
88 static std::unique_ptr<Geometry> Union(const Geometry* geom);
89
90
91};
92
93
94} // namespace geos.operation.overlayng
95} // namespace geos.operation
96} // namespace geos
97
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:88
Definition UnionStrategy.h:40
bool isFloatingPrecision() const override
Definition UnaryUnionNG.h:74
std::unique_ptr< geom::Geometry > Union(const geom::Geometry *g0, const geom::Geometry *g1) override
Definition UnaryUnionNG.h:68
Definition UnaryUnionNG.h:44
Basic namespace for all GEOS functionalities.
Definition geos.h:39