GEOS 3.6.2
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 {
32 namespace geom {
33 class GeometryFactory;
34 class Point;
35 }
36 namespace geomgraph {
37 class Node;
38 }
39 namespace algorithm {
40 class PointLocator;
41 }
42 namespace operation {
43 namespace overlay {
44 class 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
81public:
82
83 PointBuilder(OverlayOp *newOp,
84 const geom::GeometryFactory *newGeometryFactory,
85 algorithm::PointLocator *newPtLocator=NULL)
86 :
87 op(newOp),
88 geometryFactory(newGeometryFactory),
89 resultPointList(new std::vector<geom::Point *>())
90 {
91 ::geos::ignore_unused_variable_warning(newPtLocator);
92 }
93
98 std::vector<geom::Point*>* build(OverlayOp::OpCode opCode);
99};
100
101
102} // namespace geos::operation::overlay
103} // namespace geos::operation
104} // namespace geos
105
106#endif // ndef GEOS_OP_OVERLAY_POINTBUILDER_H
Computes the topological relationship (Location) of a single point to a Geometry.
Definition PointLocator.h:58
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:67
Definition Point.h:68
Definition geomgraph/Node.h:62
Computes the geometric overlay of two Geometry.
Definition OverlayOp.h:68
OpCode
The spatial functions supported by this class.
Definition OverlayOp.h:77
std::vector< geom::Point * > * build(OverlayOp::OpCode opCode)
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:33
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement topology graphs.
Definition IndexedNestedRingTester.h:34
Contains classes that perform a topological overlay to compute boolean spatial functions.
Definition BufferBuilder.h:62
Provides classes for implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25