GEOS 3.9.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#ifndef GEOS_OP_OVERLAY_POINTBUILDER_H
20#define GEOS_OP_OVERLAY_POINTBUILDER_H
21
22#include <geos/export.h>
23
24#include <geos/geom/GeometryFactory.h> // for inlines
25#include <geos/operation/overlay/OverlayOp.h> // for OpCode enum
26#include <geos/util.h>
27
28#include <vector>
29
30// Forward declarations
31namespace geos {
32namespace geom {
33class GeometryFactory;
34class Point;
35}
36namespace geomgraph {
37class Node;
38}
39namespace algorithm {
40class PointLocator;
41}
42namespace operation {
43namespace overlay {
44class OverlayOp;
45}
46}
47}
48
49namespace geos {
50namespace operation { // geos::operation
51namespace overlay { // geos::operation::overlay
52
56class GEOS_DLL PointBuilder {
57private:
58
59 OverlayOp* op;
60 const geom::GeometryFactory* geometryFactory;
61 void extractNonCoveredResultNodes(OverlayOp::OpCode opCode);
62
63 /*
64 * Converts non-covered nodes to Point objects and adds them to
65 * the result.
66 *
67 * A node is covered if it is contained in another element Geometry
68 * with higher dimension (e.g. a node point might be contained in
69 * a polygon, in which case the point can be eliminated from
70 * the result).
71 *
72 * @param n the node to test
73 */
74 void filterCoveredNodeToPoint(const geomgraph::Node*);
75
79 std::vector<geom::Point*>* resultPointList;
80
81 PointBuilder(const PointBuilder&) = delete;
82 PointBuilder& operator=(const PointBuilder&) = delete;
83
84public:
85
87 const geom::GeometryFactory* newGeometryFactory,
88 algorithm::PointLocator* newPtLocator = nullptr)
89 :
90 op(newOp),
91 geometryFactory(newGeometryFactory),
92 resultPointList(new std::vector<geom::Point *>())
93 {
94 ::geos::ignore_unused_variable_warning(newPtLocator);
95 }
96
101 std::vector<geom::Point*>* build(OverlayOp::OpCode opCode);
102};
103
104
105} // namespace geos::operation::overlay
106} // namespace geos::operation
107} // namespace geos
108
109#endif // ndef GEOS_OP_OVERLAY_POINTBUILDER_H
Computes the topological relationship (Location) of a single point to a Geometry.
Definition: PointLocator.h:57
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:68
The node component of a geometry graph.
Definition: geomgraph/Node.h:62
Computes the geometric overlay of two Geometry.
Definition: OverlayOp.h:70
OpCode
The spatial functions supported by this class.
Definition: OverlayOp.h:79
Constructs geom::Point s from the nodes of an overlay graph.
Definition: PointBuilder.h:56
std::vector< geom::Point * > * build(OverlayOp::OpCode opCode)
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26