GEOS 3.9.1
CommonBitsOp.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
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#ifndef GEOS_PRECISION_COMMONBITSOP_H
16#define GEOS_PRECISION_COMMONBITSOP_H
17
18#include <geos/export.h>
19#include <geos/precision/CommonBitsRemover.h> // for unique_ptr composition
20
21#include <vector>
22#include <memory>
23
24#ifdef _MSC_VER
25#pragma warning(push)
26#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
27#endif
28
29namespace geos {
30namespace geom {
31class Geometry;
32}
33namespace precision {
34//class CommonBitsRemover;
35}
36}
37
38namespace geos {
39namespace precision { // geos.precision
40
50class GEOS_DLL CommonBitsOp {
51
52private:
53
54 bool returnToOriginalPrecision;
55
56 std::unique_ptr<CommonBitsRemover> cbr;
57
66 std::unique_ptr<geom::Geometry> removeCommonBits(const geom::Geometry* geom0);
67
71 void removeCommonBits(
72 const geom::Geometry* geom0,
73 const geom::Geometry* geom1,
74 std::unique_ptr<geom::Geometry>& rgeom0,
75 std::unique_ptr<geom::Geometry>& rgeom1);
76
77
78public:
79
84
91 CommonBitsOp(bool nReturnToOriginalPrecision);
92
101 std::unique_ptr<geom::Geometry> intersection(
102 const geom::Geometry* geom0,
103 const geom::Geometry* geom1);
104
113 std::unique_ptr<geom::Geometry> Union(
114 const geom::Geometry* geom0,
115 const geom::Geometry* geom1);
116
125 std::unique_ptr<geom::Geometry> difference(
126 const geom::Geometry* geom0,
127 const geom::Geometry* geom1);
128
137 std::unique_ptr<geom::Geometry> symDifference(
138 const geom::Geometry* geom0,
139 const geom::Geometry* geom1);
140
148 std::unique_ptr<geom::Geometry> buffer(
149 const geom::Geometry* geom0,
150 double distance);
151
163 std::unique_ptr<geom::Geometry> computeResultPrecision(
164 std::unique_ptr<geom::Geometry> result);
165};
166
167} // namespace geos.precision
168} // namespace geos
169
170#ifdef _MSC_VER
171#pragma warning(pop)
172#endif
173
174#endif // GEOS_PRECISION_COMMONBITSOP_H
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:188
Provides versions of Geometry spatial functions which use common bit removal to reduce the likelihood...
Definition CommonBitsOp.h:50
std::unique_ptr< geom::Geometry > difference(const geom::Geometry *geom0, const geom::Geometry *geom1)
Computes the set-theoretic difference of two Geometry, using enhanced precision.
std::unique_ptr< geom::Geometry > symDifference(const geom::Geometry *geom0, const geom::Geometry *geom1)
Computes the set-theoretic symmetric difference of two geometries, using enhanced precision.
std::unique_ptr< geom::Geometry > intersection(const geom::Geometry *geom0, const geom::Geometry *geom1)
Computes the set-theoretic intersection of two Geometry, using enhanced precision.
std::unique_ptr< geom::Geometry > Union(const geom::Geometry *geom0, const geom::Geometry *geom1)
Computes the set-theoretic union of two Geometry, using enhanced precision.
std::unique_ptr< geom::Geometry > buffer(const geom::Geometry *geom0, double distance)
Computes the buffer a geometry, using enhanced precision.
std::unique_ptr< geom::Geometry > computeResultPrecision(std::unique_ptr< geom::Geometry > result)
If required, returning the result to the orginal precision if required.
CommonBitsOp()
Creates a new instance of class, which reshifts result Geometry.
CommonBitsOp(bool nReturnToOriginalPrecision)
Creates a new instance of class, specifying whether the result geom::Geometrys should be reshifted.
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26