GEOS 3.11.1
PointBuilder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 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 * Last port: operation/overlay/PointBuilder.java rev. 1.16 (JTS-1.10)
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22
23#include <geos/geom/GeometryFactory.h> // for inlines
24#include <geos/operation/overlay/OverlayOp.h> // for OpCode enum
25
26#include <vector>
27
28// Forward declarations
29namespace geos {
30namespace geom {
31class GeometryFactory;
32class Point;
33}
34namespace geomgraph {
35class Node;
36}
37namespace algorithm {
38class PointLocator;
39}
40namespace operation {
41namespace overlay {
42class OverlayOp;
43}
44}
45}
46
47namespace geos {
48namespace operation { // geos::operation
49namespace overlay { // geos::operation::overlay
50
54class GEOS_DLL PointBuilder {
55private:
56
57 OverlayOp* op;
58 const geom::GeometryFactory* geometryFactory;
59 void extractNonCoveredResultNodes(OverlayOp::OpCode opCode);
60
61 /*
62 * Converts non-covered nodes to Point objects and adds them to
63 * the result.
64 *
65 * A node is covered if it is contained in another element Geometry
66 * with higher dimension (e.g. a node point might be contained in
67 * a polygon, in which case the point can be eliminated from
68 * the result).
69 *
70 * @param n the node to test
71 */
72 void filterCoveredNodeToPoint(const geomgraph::Node*);
73
77 std::vector<geom::Point*>* resultPointList;
78
79 PointBuilder(const PointBuilder&) = delete;
80 PointBuilder& operator=(const PointBuilder&) = delete;
81
82public:
83
85 const geom::GeometryFactory* newGeometryFactory,
86 algorithm::PointLocator* newPtLocator = nullptr)
87 :
88 op(newOp),
89 geometryFactory(newGeometryFactory),
90 resultPointList(new std::vector<geom::Point *>())
91 {
92 ::geos::ignore_unused_variable_warning(newPtLocator);
93 }
94
99 std::vector<geom::Point*>* build(OverlayOp::OpCode opCode);
100};
101
102
103} // namespace geos::operation::overlay
104} // namespace geos::operation
105} // namespace geos
106
Computes the topological relationship (Location) of a single point to a Geometry.
Definition: PointLocator.h:56
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
The node component of a geometry graph.
Definition: geomgraph/Node.h:59
Computes the geometric overlay of two Geometry.
Definition: OverlayOp.h:69
OpCode
The spatial functions supported by this class.
Definition: OverlayOp.h:78
Constructs geom::Point s from the nodes of an overlay graph.
Definition: PointBuilder.h:54
std::vector< geom::Point * > * build(OverlayOp::OpCode opCode)
Basic namespace for all GEOS functionalities.
Definition: geos.h:39