GEOS  3.9.1dev
CommonBitsOp.h
Go to the documentation of this file.
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 
29 namespace geos {
30 namespace geom {
31 class Geometry;
32 }
33 namespace precision {
34 //class CommonBitsRemover;
35 }
36 }
37 
38 namespace geos {
39 namespace precision { // geos.precision
40 
51 
52 private:
53 
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 
78 public:
79 
83  CommonBitsOp();
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
#define GEOS_DLL
Definition: export.h:28
std::unique_ptr< CommonBitsRemover > cbr
Definition: CommonBitsOp.h:56
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
Basic namespace for all GEOS functionalities.